diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2025-04-12 18:53:34 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2025-04-19 13:11:33 -0700 |
commit | b5b612701b1ed579eedebafe0dfaff716ab3b14d (patch) | |
tree | 58d3aa30742d502dfdcc5b220d5f1cef8df93b84 /src/charts.c | |
parent | bbdf7986b9966524e2ee1313b22f8378d5636ac8 (diff) |
charts: introduce some mem columns
The extra per-proc row showing RSS needs overlay text for at least showing
the numeric RSS KiB value, that's achieved via row-columns
This only adds and initalizes the columns, they're not being drawn anywhere
yet.
Diffstat (limited to 'src/charts.c')
-rw-r--r-- | src/charts.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/charts.c b/src/charts.c index be14f63..fd70714 100644 --- a/src/charts.c +++ b/src/charts.c @@ -138,11 +138,15 @@ typedef struct _vwm_chart_t { char *name; /* name if provided, included in chart by the \/\/\ */ vwm_column_t top_columns[CHART_MAX_COLUMNS]; /* "top" columns in the chart (vwm logo, hz) */ vwm_column_t proc_cpu_columns[CHART_MAX_COLUMNS]; /* per-proc+thread CPU columns in the chart TODO, for now just stowing the widths here */ + vwm_column_t proc_mem_columns[CHART_MAX_COLUMNS]; /* per-proc Memory columns in the chart TODO, for now just stowing the widths here */ vwm_column_t snowflake_cpu_columns[CHART_MAX_COLUMNS]; /* per-proc+thread CPU columns in the snowflaked rows */ + vwm_column_t snowflake_mem_columns[CHART_MAX_COLUMNS]; /* per-proc Memory columns in the snowflaked rows */ vwm_row_column_t top_row_columns[CHART_MAX_COLUMNS]; /* "top" columns in the chart (vwm logo, hz) */ vwm_row_column_t proc_cpu_row_columns[CHART_MAX_COLUMNS]; + vwm_row_column_t proc_mem_row_columns[CHART_MAX_COLUMNS]; vwm_row_column_t snowflake_cpu_row_columns[CHART_MAX_COLUMNS]; /* per-proc+thread CPU columns in the snowflaked rows */ + vwm_row_column_t snowflake_mem_row_columns[CHART_MAX_COLUMNS]; /* per-proc Memory columns in the snowflaked rows */ } vwm_chart_t; /* space we need for every process being monitored */ @@ -1278,12 +1282,17 @@ vwm_chart_t * vwm_chart_create(vwm_charts_t *charts, int pid, int width, int hei chart->proc_cpu_columns[7] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_PROC_PID }; chart->proc_cpu_columns[8] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_PROC_WCHAN }; + chart->proc_mem_columns[0] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_ROW }; + chart->proc_mem_columns[1] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_PROC_RSS }; + chart->snowflake_cpu_columns[0] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_PROC_PID }; chart->snowflake_cpu_columns[1] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_PROC_USER }; chart->snowflake_cpu_columns[2] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_PROC_SYS }; chart->snowflake_cpu_columns[3] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_PROC_WALL }; chart->snowflake_cpu_columns[4] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_PROC_ARGV }; + chart->snowflake_mem_columns[0] = (vwm_column_t){ .enabled = 1, .type = VWM_COLUMN_PROC_RSS }; + chart->top_row_columns[0] = (vwm_row_column_t){ .column = &chart->top_columns[0], .side = VWM_SIDE_RIGHT, .justify = VWM_JUSTIFY_RIGHT }; @@ -1298,12 +1307,18 @@ vwm_chart_t * vwm_chart_create(vwm_charts_t *charts, int pid, int width, int hei chart->proc_cpu_row_columns[8] = (vwm_row_column_t){ .column = &chart->proc_cpu_columns[7], .side = VWM_SIDE_RIGHT, .justify = VWM_JUSTIFY_RIGHT }; chart->proc_cpu_row_columns[9] = (vwm_row_column_t){ .column = &chart->proc_cpu_columns[8], .side = VWM_SIDE_RIGHT, .justify = VWM_JUSTIFY_RIGHT }; + chart->proc_mem_row_columns[0] = (vwm_row_column_t){ .column = &chart->proc_mem_columns[0], .side = VWM_SIDE_LEFT, .justify = VWM_JUSTIFY_LEFT }; + chart->proc_mem_row_columns[1] = (vwm_row_column_t){ .column = &chart->proc_cpu_columns[0], .side = VWM_SIDE_RIGHT, .justify = VWM_JUSTIFY_RIGHT }; + chart->proc_mem_row_columns[2] = (vwm_row_column_t){ .column = &chart->proc_mem_columns[1], .side = VWM_SIDE_RIGHT, .justify = VWM_JUSTIFY_RIGHT }; + chart->snowflake_cpu_row_columns[0] = (vwm_row_column_t){ .column = &chart->snowflake_cpu_columns[0], .side = VWM_SIDE_LEFT, .justify = VWM_JUSTIFY_RIGHT }; chart->snowflake_cpu_row_columns[1] = (vwm_row_column_t){ .column = &chart->snowflake_cpu_columns[1], .side = VWM_SIDE_LEFT, .justify = VWM_JUSTIFY_RIGHT }; chart->snowflake_cpu_row_columns[2] = (vwm_row_column_t){ .column = &chart->snowflake_cpu_columns[2], .side = VWM_SIDE_LEFT, .justify = VWM_JUSTIFY_RIGHT }; chart->snowflake_cpu_row_columns[3] = (vwm_row_column_t){ .column = &chart->snowflake_cpu_columns[3], .side = VWM_SIDE_LEFT, .justify = VWM_JUSTIFY_RIGHT }; chart->snowflake_cpu_row_columns[4] = (vwm_row_column_t){ .column = &chart->snowflake_cpu_columns[4], .side = VWM_SIDE_LEFT, .justify = VWM_JUSTIFY_LEFT }; + chart->snowflake_mem_row_columns[0] = (vwm_row_column_t){ .column = &chart->snowflake_mem_columns[0], .side = VWM_SIDE_LEFT, .justify = VWM_JUSTIFY_RIGHT }; + /* add the client process to the monitoring hierarchy */ /* XXX note libvmon here maintains a unique callback for each unique callback+xwin pair, so multi-window processes work */ chart->proc = vmon_proc_monitor(&charts->vmon, pid, VMON_WANT_PROC_INHERIT, (void (*)(vmon_t *, void *, vmon_proc_t *, void *))proc_sample_callback, chart); |