Skip to contentSkip to conversation

kernel-shark: Add plugin for handling Xenomai cobalt_context_switch

PATCH In review Hongzhan Chen 2 participants 3 messages Jan 18, 2022 – Jan 26, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-shark: Add plugin for handling Xenomai cobalt_context_switch

For Xenomai-cobalt enabled system, cobalt_switch_context means that there is schedule and 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 cobalt blue hollow box to mark out-of-band state according to cobalt_switch_context events.
4. clickable cobalt_switch_context plugin shapes.

src/plugins/CMakeLists.txt +4 -0
index 3e170fa..16f080b 100644
@@ -44,6 +44,10 @@ if (Qt5Widgets_FOUND AND TT_FONT_FILE)
                      SOURCE sched_events.c SchedEvents.cpp)
     list(APPEND PLUGIN_LIST "sched_events")
 
+    BUILD_GUI_PLUGIN(NAME xenomai_cobalt_switch_events
+                     SOURCE xenomai_cobalt_switch_events.c CobaltSwitchEvents.cpp)
+    list(APPEND PLUGIN_LIST "xenomai_cobalt_switch_events")
+
     BUILD_GUI_PLUGIN(NAME event_field_plot
                      MOC EventFieldDialog.hpp
                      SOURCE event_field_plot.c EventFieldDialog.cpp EventFieldPlot.cpp)
src/plugins/CobaltSwitchEvents.cpp new file +157 -0

157 lines not on this page · raw message

src/plugins/xenomai_cobalt_switch_events.c new file +174 -0

174 lines not on this page · raw message

src/plugins/xenomai_cobalt_switch_events.h new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

src/plugins/CMakeLists.txt

Quoted 22 lines · Hongzhan Chen

For Xenomai-cobalt enabled system, cobalt_switch_context means that there is schedule and 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 cobalt blue hollow box to mark out-of-band state according to cobalt_switch_context events.
4. clickable cobalt_switch_context plugin shapes.

src/plugins/CMakeLists.txt +0 -0
index 3e170fa..16f080b 100644

This is targeting the kernel-shark repo, right? But isn't the plan rather to have this as an out-of-tree (/wrt kernel-shark) plugin, hosted inside the Xenomai repo? Then we need a different structure and a hook into the Xenomai build system - or at least a README how to build that manually.

Jan

Signature · 2 lines
Siemens AG, Technology
Competence Center Embedded Linux
#2 lore raw

-----Original Message-----

Quoted 24 lines

From: Jan Kiszka <[email protected]>
Sent: Wednesday, January 26, 2022 12:37 AM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH] kernel-shark: Add plugin for handling Xenomai cobalt_context_switch

Quoted 18 lines · Hongzhan Chen

For Xenomai-cobalt enabled system, cobalt_switch_context means that there is schedule and 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 cobalt blue hollow box to mark out-of-band state according to cobalt_switch_context events.
4. clickable cobalt_switch_context plugin shapes.

Quoted 8 lines

src/plugins/CMakeLists.txt

Quoted 4 lines
src/plugins/CMakeLists.txt +0 -0
index 3e170fa..16f080b 100644

This is targeting the kernel-shark repo, right? But isn't the plan rather to have this as an out-of-tree (/wrt kernel-shark) plugin, hosted inside the Xenomai repo? Then we need a different structure and a hook

Yes. As one of plugin in kernelshark, it should be finial patch based on updated upstream kernel-shark source because there is some modification to avoid duplication compared to last one that I submitted to our xenomai community.

If there is no more comments to modify or improve the patch itself as kernel-shark plugin, I would go forward and make a new patch hosted inside xenomai repo as we suggested.

Regards

Hongzhan Chen

Quoted 3 lines

into the Xenomai build system - or at least a README how to build that manually.

Jan

Signature · 2 lines
Siemens AG, Technology
Competence Center Embedded Linux