From a4626b96395abfc2b5fd9f76a081150952600772 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 12 Apr 2025 18:18:44 -0700 Subject: charts: add an RSS vwm_column_type_t This is necessary if we're going to actually rendering an RSS value in overlay text. --- src/charts.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/charts.c') diff --git a/src/charts.c b/src/charts.c index 2111ef8..9c3e1d4 100644 --- a/src/charts.c +++ b/src/charts.c @@ -83,6 +83,7 @@ typedef enum _vwm_column_type_t { VWM_COLUMN_PROC_PID, VWM_COLUMN_PROC_WCHAN, VWM_COLUMN_PROC_STATE, + VWM_COLUMN_PROC_RSS, VWM_COLUMN_CNT } vwm_column_type_t; @@ -756,6 +757,17 @@ static void draw_row_columns(vwm_charts_t *charts, vwm_chart_t *chart, vwm_row_c break; + case VWM_COLUMN_PROC_RSS: { /* print the process' RSS in kb */ + if (heading) /* RSS doesn't get a heading currently, as it's always below the process row and considered obvious with a units suffix */ + break; + + assert(!proc->is_thread); /* why are we printing RSS for threads? */ + + str_len = snpf(str, sizeof(str), "%'u KiB ^", proc_stat->rss * (4096 / 1024)); + + break; + } + default: assert(0); } -- cgit v1.2.3