Add support to show only top N process
Compare changes
+ 79
− 42
@@ -46,6 +46,7 @@ typedef struct process_ctx {
@@ -204,44 +205,83 @@ static void procps_get_cmdline(char *buf, int bufsz, const char *pid, const char
@@ -262,10 +302,12 @@ static void init_process_list(void)
@@ -274,20 +316,25 @@ static void init_process_list(void)
@@ -302,6 +349,15 @@ static void free_process_list(void)
@@ -322,29 +378,9 @@ static void run_refresh_process_list(void)
@@ -545,6 +581,7 @@ static void free_global_cpu_info(void)