summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2025-03-30 13:44:18 -0700
committerVito Caputo <vcaputo@pengaru.com>2025-04-11 18:26:03 -0700
commit451593bfc3f891b532f91f60cc74814674b74050 (patch)
treeec0a4e447b29b16b79f2afe89a77597f9f2a1e89
parentd68b2deb370fc474f3b2adc8e4e1e37d385e2893 (diff)
vmon: stub out -T/--no-threads argument
This will suppress showing threads in the output, and save on much of the overhead associated with monitoring them. Subsequent commits will augment libvmon to support this use case, followed by charts changes to support a threads-hidden mode which must still consider any of the threads children.
-rw-r--r--src/vmon.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vmon.c b/src/vmon.c
index 6a08a14..ababea6 100644
--- a/src/vmon.c
+++ b/src/vmon.c
@@ -50,6 +50,7 @@ typedef struct vmon_t {
int dump_procs;
int mem_locked;
int reaper;
+ int no_threads;
time_t start_time;
int snapshots_interval;
int snapshot;
@@ -207,6 +208,7 @@ static void print_help(void)
" -D --dump-procs Dump libvmon internal processes table (debugging aid)\n"
" -L --mem-locked Lock in memory using mlockall(MCL_CURRENT|MCL_FUTURE)\n"
" -R --reaper Become the child subreaper (see prctl(2); PR_SET_CHILD_SUBREAPER)\n"
+ " -T --no-threads Don't monitor threads beyond tracking their potential children\n"
" -W --width Chart width\n"
" -z --hertz Sample rate in hertz\n"
"-------------------------------------------------------------------------------"
@@ -503,6 +505,9 @@ static int vmon_handle_argv(vmon_t *vmon, int argc, const char * const *argv)
} else if (is_flag(*argv, "-R", "--reaper")) {
vmon->reaper = 1;
last = argv;
+ } else if (is_flag(*argv, "-T", "--no-threads")) {
+ vmon->no_threads = 1;
+ last = argv;
} else if ((*argv)[0] == '-') {
VWM_ERROR("Unrecognized argument: \"%s\", try --help\n", argv[0]);
exit(EXIT_FAILURE);
© All Rights Reserved