From 8d950879b446946cf05a3ff7749387f9c49e840a Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 20 Jan 2017 11:08:21 -0700 Subject: [PATCH] event: pass lcore to set_reactor_thread_name() Simplify and remove a direct call to a DPDK function. Change-Id: I08eaf86a48df67e3248eeaa764ae924b784d9277 Signed-off-by: Daniel Verkamp --- lib/event/reactor.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/event/reactor.c b/lib/event/reactor.c index 459bfec3b..75550d889 100644 --- a/lib/event/reactor.c +++ b/lib/event/reactor.c @@ -227,12 +227,11 @@ spdk_event_queue_run_batch(uint32_t lcore) This makes the reactor threads distinguishable in top and gdb. */ -static void set_reactor_thread_name(void) +static void set_reactor_thread_name(uint32_t lcore) { char thread_name[16]; - snprintf(thread_name, sizeof(thread_name), "reactor_%d", - rte_lcore_id()); + snprintf(thread_name, sizeof(thread_name), "reactor_%u", lcore); #if defined(__linux__) prctl(PR_SET_NAME, thread_name, 0, 0, 0); @@ -317,7 +316,7 @@ _spdk_reactor_run(void *arg) uint32_t sleep_us; spdk_allocate_thread(); - set_reactor_thread_name(); + set_reactor_thread_name(reactor->lcore); SPDK_NOTICELOG("Reactor started on core %u on socket %u\n", reactor->lcore, reactor->socket_id);