Skip to content

Commit 77aadb2

Browse files
garlickmergify[bot]
authored andcommitted
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
1 parent e6f5d18 commit 77aadb2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/shell/plugins/interthread.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct interthread {
3535
flux_watcher_t *w;
3636
struct handler handlers[MAX_HANDLERS];
3737
int handler_count;
38-
bool trace_flag;
38+
int verbose;
3939
};
4040

4141
int interthread_register (struct interthread *it,
@@ -100,7 +100,7 @@ static void interthread_recv (flux_reactor_t *r,
100100
flux_msg_decref (msg);
101101
return;
102102
}
103-
if (it->trace_flag) {
103+
if (it->verbose > 1) {
104104
const char *payload;
105105
if (flux_msg_get_payload (msg, (const void **)&payload, NULL) == 0)
106106
shell_trace ("pmix server %s %s", topic, payload);
@@ -144,7 +144,7 @@ struct interthread *interthread_create (flux_shell_t *shell)
144144
it)))
145145
goto error;
146146
flux_watcher_start (it->w);
147-
it->trace_flag = 1; // temporarily force this on
147+
(void)flux_shell_getopt_unpack (shell, "verbose", "i", &it->verbose);
148148
return it;
149149
error:
150150
interthread_destroy (it);

0 commit comments

Comments
 (0)