summaryrefslogtreecommitdiffstats
path: root/vpp/stats
diff options
context:
space:
mode:
authorTodd Foggoa <tfoggoa@cisco.com>2016-02-02 12:47:46 -0500
committerTodd Foggoa <tfoggoa@cisco.com>2016-02-02 12:47:46 -0500
commit4189c17afb7b62977b359929e42cacf942900425 (patch)
tree7fdacdd20f32172b804cdd8e53ec6e4e2db27c7d /vpp/stats
parenta28f44b34e12b09106bb060eb5d8de24836a6bbb (diff)
Set the thread name for the stats thread if a thread name prefix is given.
Change-Id: Ie66d29bfbf6d106e9c49fb4f3738b26798c3a63c Signed-off-by: Todd Foggoa <tfoggoa@cisco.com>
Diffstat (limited to 'vpp/stats')
-rw-r--r--vpp/stats/stats.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vpp/stats/stats.c b/vpp/stats/stats.c
index 3bebaf9eece..daaced43dd8 100644
--- a/vpp/stats/stats.c
+++ b/vpp/stats/stats.c
@@ -614,6 +614,7 @@ static void stats_thread_fn (void *arg)
{
stats_main_t *sm = &stats_main;
vlib_worker_thread_t *w = (vlib_worker_thread_t *)arg;
+ vlib_thread_main_t *tm = vlib_get_thread_main();
/* stats thread wants no signals. */
{
@@ -622,6 +623,10 @@ static void stats_thread_fn (void *arg)
pthread_sigmask (SIG_SETMASK, &s, 0);
}
+ if (vec_len(tm->thread_prefix))
+ vlib_set_thread_name((char *)
+ format(0, "%v_stats%c", tm->thread_prefix, '\0'));
+
clib_mem_set_heap (w->thread_mheap);
while (1) {