From 6c4b7702df584d472e9f214a351fc3d37ac36dc4 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 27 Aug 2019 08:06:30 +0200 Subject: record: Add CPU to idle thread names Update #3665. --- trace/record/record-main-lttng.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'trace/record') diff --git a/trace/record/record-main-lttng.c b/trace/record/record-main-lttng.c index b08623c..bde15c1 100644 --- a/trace/record/record-main-lttng.c +++ b/trace/record/record-main-lttng.c @@ -209,6 +209,19 @@ static void copy_thread_name( } memcpy( dst, name, THREAD_NAME_SIZE ); + + if ( is_idle_task_by_api_index( api_index ) ) { + /* + * In Linux, the idle threads are bound to a specific CPU (swapper/n). In + * RTEMS, the idle threads can move around, so mimic this Linux behaviour. + */ + snprintf( + (char *) dst + 4, + THREAD_NAME_SIZE - 4, + "/%lu", + (unsigned long) item->cpu + ); + } } static void write_sched_switch( -- cgit v1.2.3