[rtems-tools commit] record: Add CPU to idle thread names
Sebastian Huber
sebh at rtems.org
Tue Aug 27 06:52:37 UTC 2019
Module: rtems-tools
Branch: master
Commit: 6c4b7702df584d472e9f214a351fc3d37ac36dc4
Changeset: http://git.rtems.org/rtems-tools/commit/?id=6c4b7702df584d472e9f214a351fc3d37ac36dc4
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Aug 27 08:06:30 2019 +0200
record: Add CPU to idle thread names
Update #3665.
---
trace/record/record-main-lttng.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
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(
More information about the vc
mailing list