From b29b33ebb9ae80a95e7d09eb537e0fccc5043d68 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Tue, 27 Dec 2022 04:57:52 +0400 Subject: {Memory,Swap}Meter: add "compressed memory" metrics For now, the semantics are mostly fit for Linux zswap subsystem. For instance, we add the third swap usage metric that indicates the amount of memory that is accounted to swap but in fact stored elsewhere. This exactly matches the definition of frontswap/zswap, and is probably of little use to all other platforms. --- Action.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Action.c') diff --git a/Action.c b/Action.c index a67233cc..18c990e0 100644 --- a/Action.c +++ b/Action.c @@ -674,10 +674,11 @@ static Htop_Reaction actionHelp(State* st) { mvaddstr(line++, 0, "Memory bar: "); addattrstr(CRT_colors[BAR_BORDER], "["); addbartext(CRT_colors[MEMORY_USED], "", "used"); + addbartext(CRT_colors[MEMORY_COMPRESSED], "/", "compressed"); addbartext(CRT_colors[MEMORY_BUFFERS_TEXT], "/", "buffers"); addbartext(CRT_colors[MEMORY_SHARED], "/", "shared"); addbartext(CRT_colors[MEMORY_CACHE], "/", "cache"); - addbartext(CRT_colors[BAR_SHADOW], " ", "used"); + addbartext(CRT_colors[BAR_SHADOW], " ", "used"); addbartext(CRT_colors[BAR_SHADOW], "/", "total"); addattrstr(CRT_colors[BAR_BORDER], "]"); @@ -687,10 +688,11 @@ static Htop_Reaction actionHelp(State* st) { addbartext(CRT_colors[SWAP], "", "used"); #ifdef HTOP_LINUX addbartext(CRT_colors[SWAP_CACHE], "/", "cache"); + addbartext(CRT_colors[SWAP_FRONTSWAP], "/", "frontswap"); #else addbartext(CRT_colors[SWAP_CACHE], " ", ""); #endif - addbartext(CRT_colors[BAR_SHADOW], " ", "used"); + addbartext(CRT_colors[BAR_SHADOW], " ", "used"); addbartext(CRT_colors[BAR_SHADOW], "/", "total"); addattrstr(CRT_colors[BAR_BORDER], "]"); -- cgit v1.2.3