aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2024-06-06 10:46:50 +0200
committerDamjan Marion <dmarion@0xa5.net>2024-06-10 13:12:52 +0000
commitfa500e98543989e4cdcbedac19a525d55a8558d5 (patch)
tree15e0a23186bb737b1d2bbc9fae3e8fa897c76a41 /src/vlib
parent282f2ecd8e7d68b9930d6f1e2c62205c9dfe8285 (diff)
vlib: fix gdb_show_traces()
When using gdb_show_traces() in debug mode, don't assert if workers are not parked, as it is typically called from gdb. Type: fix Change-Id: Iabf175d96dc152da4d1abfbce9ccc9020d0b5d61 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/threads.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vlib/threads.h b/src/vlib/threads.h
index ac0c1d5d266..c671aa78c39 100644
--- a/src/vlib/threads.h
+++ b/src/vlib/threads.h
@@ -200,7 +200,7 @@ vlib_smp_unsafe_warning (void)
}
always_inline int
-__foreach_vlib_main_helper (vlib_main_t *ii, vlib_main_t **p)
+__foreach_vlib_main_helper (vlib_main_t *ii, vlib_main_t **p, int checks)
{
vlib_main_t *vm;
u32 index = ii - (vlib_main_t *) 0;
@@ -209,15 +209,17 @@ __foreach_vlib_main_helper (vlib_main_t *ii, vlib_main_t **p)
return 0;
*p = vm = vlib_global_main.vlib_mains[index];
- ASSERT (index == 0 || vm->parked_at_barrier == 1);
+ ASSERT (!checks || index == 0 || vm->parked_at_barrier == 1);
return 1;
}
-#define foreach_vlib_main() \
+#define foreach_vlib_main__(checks) \
for (vlib_main_t *ii = 0, *this_vlib_main; \
- __foreach_vlib_main_helper (ii, &this_vlib_main); ii++) \
+ __foreach_vlib_main_helper (ii, &this_vlib_main, checks); ii++) \
if (this_vlib_main)
+#define foreach_vlib_main() foreach_vlib_main__ (1)
+
#define foreach_sched_policy_posix \
_ (SCHED_OTHER, OTHER, "other") \
_ (SCHED_FIFO, FIFO, "fifo") \