summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-10-09 12:03:50 +0300
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-10-11 14:30:16 +0000
commit77b57b4e51edf437b4af9b23230cb086bd2ea945 (patch)
treeb0088de9911feafa238c616960a63553f96575e3 /lib
parent964c166f4b11b6c378bfe038f167634663cbbe02 (diff)
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> (cherry picked from commit 3ff671b830698abbf39586c6677f3142dcfa72f1)
Diffstat (limited to 'lib')
-rw-r--r--lib/event.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/event.c b/lib/event.c
index 122d3cd9a1..d3bc0205ae 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) {
/*