]> granicus.if.org Git - procps-ng/commit
top: refactor graph support of cpu/mem summary display
authorJim Warner <james.warner@comcast.net>
Fri, 9 Sep 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Mon, 12 Sep 2022 12:15:28 +0000 (22:15 +1000)
commit2d5b51d1a2aa19d077a2f3db5be187f982d70e70
tree2b2a5da3194a54911b40b77a467b5e5447f23b83
parent08d0f377a76fb1cb710208cbff3752f59f9fe945
top: refactor graph support of cpu/mem summary display

The logic (illogic?) in the sum_tics() and do_memory()
functions has grown to become almost unfathomable over
time. Additionally, though perhaps not apparent in the
code, many steps are duplicated within those routines.

So, this patch refactors all the summary graph support
to consolidate duplicated code and (hopefully) make it
more understandable with an eye to future maintenance.

[ additionally, that show_special guy's workload has ]
[ been reduced by eliminating any special directives ]
[ previously embedded in some cpu graphs even though ]
[ a cpu may have been idle during the last interval. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
src/top/top.c
src/top/top.h