For Xenomai-cobalt enabled system, cobalt_switch_context means that there is context switch in companion core(realtime core), which we may need to do special treatment and take correct action as main kernel sched_switch to visualize out-of-band state of realtime tasks running in cobalt core. To achive our target, we implement following: 1. store corresponding cobalt_switch_context events into container data. 2. modify pid stored in entry to be equal to next_pid to show correct color in cpu bar when cobalt_switch_context event happen. 3. show blue hollow box to mark out-of-band state underneath the baseline of task plots according to cobalt_switch_context events. 4. clickable cobalt_switch_context plugin shapes. I do not know if this patch can be accepted in upstream from function's view because it is xenomai related which still be different from pure kernel-shark for pure linux. But it is still independent plugin which would not influence other kernel-shark's functions and the plugin would not take effect if there is no cobalt_switch_context event found in trace data. Hongzhan Chen (1): kernel-shark: Add plugin for handling Xenomai cobalt_context_switch src/libkshark-tepdata.c | 1 + src/plugins/CMakeLists.txt | 4 + src/plugins/CobaltSwitchEvents.cpp | 204 +++++++++++++++++++++ src/plugins/xenomai_cobalt_switch_events.c | 198 ++++++++++++++++++++ src/plugins/xenomai_cobalt_switch_events.h | 64 +++++++ 5 files changed, 471 insertions(+) create mode 100644 src/plugins/CobaltSwitchEvents.cpp create mode 100644 src/plugins/xenomai_cobalt_switch_events.c create mode 100644 src/plugins/xenomai_cobalt_switch_events.h -- 2.17.1