diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-10-09 11:03:50 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-10-11 08:52:19 +0200 |
commit | 3ff671b830698abbf39586c6677f3142dcfa72f1 (patch) | |
tree | 0499749791eec6b19ea648b414426e5853a620c8 /lib/event.c | |
parent | Merge pull request #10733 from anlancs/zebra-remove-update (diff) | |
download | frr-3ff671b830698abbf39586c6677f3142dcfa72f1.tar.xz frr-3ff671b830698abbf39586c6677f3142dcfa72f1.zip |
lib: Suppress HOB/STARVATION warnings when running in vtysh
Running ping/traceroute/etc. (any kind of commands that use execute_command()
suffer with this kind of warnings.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'lib/event.c')
-rw-r--r-- | lib/event.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/event.c b/lib/event.c index 122d3cd9a..d3bc0205a 100644 --- a/lib/event.c +++ b/lib/event.c @@ -1946,6 +1946,7 @@ void event_getrusage(RUSAGE_T *r) void event_call(struct event *thread) { RUSAGE_T before, after; + bool suppress_warnings = EVENT_ARG(thread); /* if the thread being called is the CLI, it may change cputime_enabled * ("service cputime-stats" command), which can result in nonsensical @@ -2006,6 +2007,9 @@ void event_call(struct event *thread) atomic_fetch_or_explicit(&thread->hist->types, 1 << thread->add_type, memory_order_seq_cst); + if (suppress_warnings) + return; + if (cputime_enabled_here && cputime_enabled && cputime_threshold && cputime > cputime_threshold) { /* |