← Commit list

ac78f2ac9

Denys Vlasenko
Denys Vlasenko
2019-08-11
SUCCESS Duration: 155s

Subject

top: do not use previous colleced data wheh "h" toggles threads display

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

procps/top.c+4 -1
@@ -979,6 +979,9 @@ static unsigned handle_input(unsigned scan_mask, duration_t interval)
IF_FEATURE_TOPMEM(&& scan_mask != TOPMEM_MASK)
) {
scan_mask ^= PSSCAN_TASKS;
+ free(prev_hist);
+ prev_hist = NULL;
+ prev_hist_count = 0;
continue;
}
# endif
@@ -1000,10 +1003,10 @@ static unsigned handle_input(unsigned scan_mask, duration_t interval)
# if ENABLE_FEATURE_TOPMEM
if (c == 's') {
scan_mask = TOPMEM_MASK;
+ sort_field = (sort_field + 1) % NUM_SORT_FIELD;
free(prev_hist);
prev_hist = NULL;
prev_hist_count = 0;
- sort_field = (sort_field + 1) % NUM_SORT_FIELD;
continue;
}
# endif