From 77aadb2c16eacde4f22e5915c3b1d43cefd92f00 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Tue, 4 Nov 2025 08:28:30 -0800 Subject: [PATCH] shell: suppress tracing if verbose < 2 Problem: shell_trace() is called for all pmix server upcalls even when they are suppressed at the shell. Since these log entries could be large at scale, avoid the memcpy overhead by suppressing them locally unless -o verbose=N (N > 1). Fixes #76 --- src/shell/plugins/interthread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shell/plugins/interthread.c b/src/shell/plugins/interthread.c index bd109b1..28ce284 100644 --- a/src/shell/plugins/interthread.c +++ b/src/shell/plugins/interthread.c @@ -35,7 +35,7 @@ struct interthread { flux_watcher_t *w; struct handler handlers[MAX_HANDLERS]; int handler_count; - bool trace_flag; + int verbose; }; int interthread_register (struct interthread *it, @@ -100,7 +100,7 @@ static void interthread_recv (flux_reactor_t *r, flux_msg_decref (msg); return; } - if (it->trace_flag) { + if (it->verbose > 1) { const char *payload; if (flux_msg_get_payload (msg, (const void **)&payload, NULL) == 0) shell_trace ("pmix server %s %s", topic, payload); @@ -144,7 +144,7 @@ struct interthread *interthread_create (flux_shell_t *shell) it))) goto error; flux_watcher_start (it->w); - it->trace_flag = 1; // temporarily force this on + (void)flux_shell_getopt_unpack (shell, "verbose", "i", &it->verbose); return it; error: interthread_destroy (it);