summaryrefslogtreecommitdiffstats
path: root/lib/event.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-10-09 11:03:50 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2023-10-11 08:52:19 +0200
commit3ff671b830698abbf39586c6677f3142dcfa72f1 (patch)
tree0499749791eec6b19ea648b414426e5853a620c8 /lib/event.c
parentMerge pull request #10733 from anlancs/zebra-remove-update (diff)
downloadfrr-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.c4
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) {
/*