Add bh_print_proc_mem() to dump memory info of current process (#1734)

Only support Posix platforms currently, read memory consumption info from
file "/proc/self/status".
This commit is contained in:
liang.he
2022-11-25 08:33:44 +08:00
committed by GitHub
parent 29b76dd275
commit eaedceca2f
14 changed files with 178 additions and 8 deletions

View File

@ -73,6 +73,14 @@ bh_log(LogLevel log_level, const char *file, int line, const char *fmt, ...);
void
bh_print_time(const char *prompt);
void
bh_print_proc_mem(const char *prompt);
void
bh_log_proc_mem(const char *function, uint32 line);
#define LOG_PROC_MEM(...) bh_log_proc_mem(__FUNCTION__, __LINE__)
#ifdef __cplusplus
}
#endif