summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBud Grise <griseb@cisco.com>2016-03-16 13:09:46 -0400
committerGerrit Code Review <gerrit@fd.io>2016-04-12 11:44:50 +0000
commit42f2006975c5a0ea58c835df4461213072f8813f (patch)
treed8921fa7f1297685deac7ff91376003ede28f1b0
parentcbed90c8cbf8449ff8ed6da08ec248f1e49a374d (diff)
Add counter for the number of barrier syncs performed.
Change-Id: I42b26c8f95c17577006f13e3419b8ccc9ef7c4f3 Signed-off-by: Todd Foggoa <tfoggoa@cisco.com>
-rw-r--r--vlib/vlib/threads.c2
-rw-r--r--vlib/vlib/threads.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/vlib/vlib/threads.c b/vlib/vlib/threads.c
index 970e4a55b34..a69e4555af0 100644
--- a/vlib/vlib/threads.c
+++ b/vlib/vlib/threads.c
@@ -1083,6 +1083,8 @@ void vlib_worker_thread_barrier_sync(vlib_main_t *vm)
if (++vlib_worker_threads[0].recursion_level > 1)
return;
+ vlib_worker_threads[0].barrier_sync_count++;
+
ASSERT (os_get_cpu_number() == 0);
deadline = vlib_time_now (vm) + BARRIER_SYNC_TIMEOUT;
diff --git a/vlib/vlib/threads.h b/vlib/vlib/threads.h
index 6c16878a5b5..5773ed05a62 100644
--- a/vlib/vlib/threads.h
+++ b/vlib/vlib/threads.h
@@ -93,6 +93,7 @@ typedef struct {
u32 instance_id;
vlib_thread_registration_t *registration;
u8 *name;
+ u64 barrier_sync_count;
long lwp;
int dpdk_lcore_id;