Kernel-Shark and libtraceevent plugins
v8 cover Kernel-Shark and libtraceevent plugins
Changes in v8:
- drop explicit deps again - no longer unneeded after refreshing local libtracecmd installation
Changes in v7:
- reworked installation
- fixed build of kernelshark plugin (missing dep)
- dropped applied first patch
Jan
Hongzhan Chen (3):
build: add options to build plugins of kernelshark and libtraceevent
KernelShark: Add xenomai_cobalt_switch_events plugin for KernelShark
libtraceevent: Add xenomai_schedparams plugin for libtraceevent
Jan Kiszka (1):
libs: Silence installation output of libtool
Makefile.am | 4 + configure.ac | 35 ++++ lib/alchemy/Makefile.am | 2 + lib/analogy/Makefile.am | 2 + lib/cobalt/Makefile.am | 2 + lib/copperplate/Makefile.am | 2 + lib/mercury/Makefile.am | 3 +- lib/psos/Makefile.am | 2 + lib/smokey/Makefile.am | 2 + lib/trank/Makefile.am | 3 +- lib/vxworks/Makefile.am | 2 + tracing/Makefile.am | 13 ++ tracing/README | 84 +++++++++ tracing/kernelshark/CobaltSwitchEvents.cpp | 156 ++++++++++++++++ tracing/kernelshark/Makefile.am | 20 ++ .../xenomai_cobalt_switch_events.c | 174 ++++++++++++++++++ .../xenomai_cobalt_switch_events.h | 58 ++++++ tracing/libtraceevent/Makefile.am | 19 ++ .../plugin_xenomai_schedparams.c | 158 ++++++++++++++++ 19 files changed, 739 insertions(+), 2 deletions(-) create mode 100644 tracing/Makefile.am create mode 100644 tracing/README create mode 100644 tracing/kernelshark/CobaltSwitchEvents.cpp create mode 100644 tracing/kernelshark/Makefile.am create mode 100644 tracing/kernelshark/xenomai_cobalt_switch_events.c create mode 100644 tracing/kernelshark/xenomai_cobalt_switch_events.h create mode 100644 tracing/libtraceevent/Makefile.am create mode 100644 tracing/libtraceevent/plugin_xenomai_schedparams.c
Signature · 1 line
2.34.1
PATCH v8 1/4 build: add options to build plugins of kernelshark and libtraceevent
From: Hongzhan Chen <[email protected]>
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
--- configure.ac | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
configure.ac +32 -0
@@ -91,6 +91,8 @@ AC_ARG_WITH(cxx, ]) AC_PROG_CXX +PKG_PROG_PKG_CONFIG + # Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then CFLAGS=""
@@ -826,6 +828,36 @@ AC_ARG_WITH(demodir, ], [XENO_DEMO_DIR=$demodir]) AC_MSG_RESULT($XENO_DEMO_DIR) +kernelshark_plugin= +AC_MSG_CHECKING(whether KernelShark plugin should be built) +AC_ARG_ENABLE(kernelshark_plugin, + AS_HELP_STRING([--enable-kernelshark-plugin], [build KernelShark plugin]), + [case "$enableval" in + y | yes) kernelshark_plugin=y ;; + *) unset kernelshark_plugin ;; + esac]) +AC_MSG_RESULT(${kernelshark_plugin:-no}) +AM_CONDITIONAL(XENO_KSHARK_PLUGIN, [test x$kernelshark_plugin = xy]) + +libtraceevent_plugin= +AC_MSG_CHECKING(whether libtraceevent plugin should be built) +AC_ARG_ENABLE(libtraceevent_plugin, + AS_HELP_STRING([--enable-libtraceevent-plugin], [build libtraceevent plugin]), + [case "$enableval" in + y | yes) libtraceevent_plugin=y ;; + *) unset libtraceevent_plugin ;; + esac]) +AC_MSG_RESULT(${libtraceevent_plugin:-no}) +AM_CONDITIONAL(XENO_LIBTRACEEVENT_PLUGIN, [test x$libtraceevent_plugin = xy]) + +if test x$kernelshark_plugin = xy -o x$libtraceevent_plugin = xy; then + PKG_CHECK_MODULES(LIBTRACEEVENT, libtraceevent) +fi + +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark) +fi + AC_MSG_CHECKING([for test source generation]) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ]])], [AC_MSG_RESULT(ok)], [AC_MSG_RESULT(failed)], [AC_MSG_RESULT(untestable)])
Signature · 1 line
2.34.1
PATCH v8 2/4 KernelShark: Add xenomai_cobalt_switch_events plugin for KernelShark
In reply to Jan KiszkaFrom: Hongzhan Chen <[email protected]>
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 blue hollow box to mark out-of-band state according to cobalt_switch_context events.
4. clickable cobalt_switch_context plugin shapes.
--- Makefile.am | 4 + configure.ac | 2 + tracing/Makefile.am | 8 + tracing/kernelshark/CobaltSwitchEvents.cpp | 156 ++++++++++++++++ tracing/kernelshark/Makefile.am | 20 ++ .../xenomai_cobalt_switch_events.c | 174 ++++++++++++++++++ .../xenomai_cobalt_switch_events.h | 58 ++++++ 7 files changed, 422 insertions(+) create mode 100644 tracing/Makefile.am create mode 100644 tracing/kernelshark/CobaltSwitchEvents.cpp create mode 100644 tracing/kernelshark/Makefile.am create mode 100644 tracing/kernelshark/xenomai_cobalt_switch_events.c create mode 100644 tracing/kernelshark/xenomai_cobalt_switch_events.h
Makefile.am +4 -0
@@ -18,6 +18,9 @@ SUBDIRS += \ testsuite endif +SUBDIRS += \ + tracing + EXTRA_DIST = kernel debian DIST_SUBDIRS = \
@@ -26,6 +29,7 @@ DIST_SUBDIRS = \ doc \ include \ lib \ + tracing \ scripts \ testsuite \ utils
configure.ac +2 -0
@@ -975,6 +975,8 @@ AC_CONFIG_FILES([ \ scripts/Makefile \ scripts/xeno-config:scripts/xeno-config-$rtcore_type.in \ scripts/xeno \ + tracing/Makefile \ + tracing/kernelshark/Makefile \ lib/Makefile \ lib/boilerplate/Makefile \ lib/boilerplate/init/Makefile \
tracing/Makefile.am new file +8 -0
@@ -0,0 +1,8 @@ +SUBDIRS = + +if XENO_KSHARK_PLUGIN +SUBDIRS += kernelshark +endif + +DIST_SUBDIRS = \ + kernelshark
tracing/kernelshark/CobaltSwitchEvents.cpp new file +156 -0
156 lines not on this page · raw message
tracing/kernelshark/Makefile.am new file +20 -0
@@ -0,0 +1,20 @@ +libsub_LTLIBRARIES = plugin_xenomai_cobalt_switch_events.la + +plugin_xenomai_cobalt_switch_events_la_SOURCES = \ + CobaltSwitchEvents.cpp \ + xenomai_cobalt_switch_events.c \ + xenomai_cobalt_switch_events.h + +plugin_xenomai_cobalt_switch_events_la_CPPFLAGS = \ + $(LIBKSHARK_CFLAGS) + +plugin_xenomai_cobalt_switch_events_la_LDFLAGS = \ + $(LIBKSHARK_LIBS) \ + -module -avoid-version + +AM_LIBTOOLFLAGS = --silent --tag=disable-static + +libsubdir := $(libdir)/kernelshark/plugins + +install-data-hook: + $(RM) $(DESTDIR)$(libsubdir)/$(libsub_LTLIBRARIES)
tracing/kernelshark/xenomai_cobalt_switch_events.c new file +174 -0
174 lines not on this page · raw message
tracing/kernelshark/xenomai_cobalt_switch_events.h new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v8 3/4 libtraceevent: Add xenomai_schedparams plugin for libtraceevent
In reply to Jan KiszkaFrom: Hongzhan Chen <[email protected]>
For cobalt thread, there is special struct param_ex data stored in data record, we need to parse and print its content out correctly to hint user.
--- configure.ac | 1 + tracing/Makefile.am | 7 +- tracing/README | 84 ++++++++++ tracing/libtraceevent/Makefile.am | 19 +++ .../plugin_xenomai_schedparams.c | 158 ++++++++++++++++++ 5 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 tracing/README create mode 100644 tracing/libtraceevent/Makefile.am create mode 100644 tracing/libtraceevent/plugin_xenomai_schedparams.c
configure.ac +1 -0
@@ -977,6 +977,7 @@ AC_CONFIG_FILES([ \ scripts/xeno \ tracing/Makefile \ tracing/kernelshark/Makefile \ + tracing/libtraceevent/Makefile \ lib/Makefile \ lib/boilerplate/Makefile \ lib/boilerplate/init/Makefile \
tracing/Makefile.am +6 -1
@@ -4,5 +4,10 @@ if XENO_KSHARK_PLUGIN SUBDIRS += kernelshark endif +if XENO_LIBTRACEEVENT_PLUGIN +SUBDIRS += libtraceevent +endif + DIST_SUBDIRS = \ - kernelshark + kernelshark \ + libtraceevent
tracing/README new file +84 -0
84 lines not on this page · raw message
tracing/libtraceevent/Makefile.am new file +19 -0
@@ -0,0 +1,19 @@ +libsub_LTLIBRARIES = plugin_xenomai_schedparams.la + +plugin_xenomai_schedparams_la_SOURCES = \ + plugin_xenomai_schedparams.c + +plugin_xenomai_schedparams_la_CPPFLAGS = \ + $(LIBTRACEEVENT_CFLAGS) \ + -I$(top_srcdir)/include + +plugin_xenomai_schedparams_la_LDFLAGS = \ + $(LIBTRACEEVENT_LIBS) \ + -module -avoid-version -nostartfiles + +AM_LIBTOOLFLAGS = --silent --tag=disable-static + +libsubdir := $(libdir)/traceevent/plugins + +install-data-hook: + $(RM) $(DESTDIR)$(libsubdir)/$(libsub_LTLIBRARIES)
tracing/libtraceevent/plugin_xenomai_schedparams.c new file +158 -0
158 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v8 4/4 libs: Silence installation output of libtool
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
--- lib/alchemy/Makefile.am | 2 ++ lib/analogy/Makefile.am | 2 ++ lib/cobalt/Makefile.am | 2 ++ lib/copperplate/Makefile.am | 2 ++ lib/mercury/Makefile.am | 3 ++- lib/psos/Makefile.am | 2 ++ lib/smokey/Makefile.am | 2 ++ lib/trank/Makefile.am | 3 ++- lib/vxworks/Makefile.am | 2 ++ 9 files changed, 18 insertions(+), 2 deletions(-)
lib/alchemy/Makefile.am +2 -0
@@ -43,6 +43,8 @@ libalchemy@CORE@_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib +AM_LIBTOOLFLAGS = --silent + EXTRA_DIST = testsuite SPARSE = sparse
lib/analogy/Makefile.am +2 -0
@@ -21,3 +21,5 @@ libanalogy_la_CPPFLAGS = \ @XENO_USER_CFLAGS@ \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib/boilerplate + +AM_LIBTOOLFLAGS = --silent
lib/cobalt/Makefile.am +2 -0
@@ -54,6 +54,8 @@ libmodechk_la_CPPFLAGS = \ -I$(top_srcdir)/include/cobalt \ -I$(top_srcdir)/include +AM_LIBTOOLFLAGS = --silent + install-data-local: $(mkinstalldirs) $(DESTDIR)$(libdir) $(INSTALL_DATA) $(srcdir)/cobalt.wrappers $(DESTDIR)$(libdir)
lib/copperplate/Makefile.am +2 -0
@@ -51,6 +51,8 @@ libcopperplate@CORE@_la_SOURCES += heapobj-malloc.c endif endif +AM_LIBTOOLFLAGS = --silent + SUBDIRS = . if XENO_REGISTRY
lib/mercury/Makefile.am +2 -1
@@ -1,4 +1,3 @@ - lib_LTLIBRARIES = libmercury.la libmercury_la_SOURCES =
@@ -7,3 +6,5 @@ libmercury_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0 -lpthread -lrt libmercury_la_LIBADD = \ ../boilerplate/libboilerplate.la + +AM_LIBTOOLFLAGS = --silent
lib/psos/Makefile.am +2 -0
@@ -28,6 +28,8 @@ libpsos@CORE@_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib +AM_LIBTOOLFLAGS = --silent + EXTRA_DIST = testsuite SPARSE = sparse
lib/smokey/Makefile.am +2 -0
@@ -11,3 +11,5 @@ libsmokey@CORE@_la_CPPFLAGS = \ @XENO_USER_CFLAGS@ \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib + +AM_LIBTOOLFLAGS = --silent
lib/trank/Makefile.am +2 -1
@@ -1,4 +1,3 @@ - lib_LTLIBRARIES = libtrank@[email protected] libtrank@CORE@_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
@@ -19,3 +18,5 @@ libtrank@CORE@_la_CPPFLAGS = \ -D__XENO_COMPAT__ \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib + +AM_LIBTOOLFLAGS = --silent
lib/vxworks/Makefile.am +2 -0
@@ -37,6 +37,8 @@ libvxworks@CORE@_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib +AM_LIBTOOLFLAGS = --silent + EXTRA_DIST = testsuite SPARSE = sparse
Signature · 1 line
2.34.1
Looks good to me. Thanks for your help.
Regards
Hongzhan Chen
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Monday, March 14, 2022 6:01 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v8 0/4] Kernel-Shark and libtraceevent plugins
Changes in v8:
- drop explicit deps again - no longer unneeded after refreshing local libtracecmd installation
Changes in v7:
- reworked installation
- fixed build of kernelshark plugin (missing dep)
- dropped applied first patch
Jan
Hongzhan Chen (3):
build: add options to build plugins of kernelshark and libtraceevent
KernelShark: Add xenomai_cobalt_switch_events plugin for KernelShark
libtraceevent: Add xenomai_schedparams plugin for libtraceevent
Jan Kiszka (1):
libs: Silence installation output of libtool
Makefile.am | 4 + configure.ac | 35 ++++ lib/alchemy/Makefile.am | 2 + lib/analogy/Makefile.am | 2 + lib/cobalt/Makefile.am | 2 + lib/copperplate/Makefile.am | 2 + lib/mercury/Makefile.am | 3 +- lib/psos/Makefile.am | 2 + lib/smokey/Makefile.am | 2 + lib/trank/Makefile.am | 3 +- lib/vxworks/Makefile.am | 2 + tracing/Makefile.am | 13 ++ tracing/README | 84 +++++++++ tracing/kernelshark/CobaltSwitchEvents.cpp | 156 ++++++++++++++++ tracing/kernelshark/Makefile.am | 20 ++ .../xenomai_cobalt_switch_events.c | 174 ++++++++++++++++++ .../xenomai_cobalt_switch_events.h | 58 ++++++ tracing/libtraceevent/Makefile.am | 19 ++ .../plugin_xenomai_schedparams.c | 158 ++++++++++++++++ 19 files changed, 739 insertions(+), 2 deletions(-) create mode 100644 tracing/Makefile.am create mode 100644 tracing/README create mode 100644 tracing/kernelshark/CobaltSwitchEvents.cpp create mode 100644 tracing/kernelshark/Makefile.am create mode 100644 tracing/kernelshark/xenomai_cobalt_switch_events.c create mode 100644 tracing/kernelshark/xenomai_cobalt_switch_events.h create mode 100644 tracing/libtraceevent/Makefile.am create mode 100644 tracing/libtraceevent/plugin_xenomai_schedparams.c
Signature · 1 line
2.34.1
Quoted 2 lines · Hongzhan
Looks good to me. Thanks for your help.
Thanks for your effort! The last "few percentages" to get autoconf/automake integration were indeed tougher than I thought.
Jan
Quoted 62 lines
Regards
Hongzhan Chen
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Monday, March 14, 2022 6:01 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v8 0/4] Kernel-Shark and libtraceevent pluginsChanges in v8:
- drop explicit deps again - no longer unneeded after refreshing local libtracecmd installationChanges in v7:
- reworked installation
- fixed build of kernelshark plugin (missing dep)
- dropped applied first patchJan
CC Hongzhan Chen <[email protected]>Hongzhan Chen (3):
build: add options to build plugins of kernelshark and libtraceevent
KernelShark: Addxenomai_cobalt_switch_eventsplugin for KernelShark
libtraceevent: Addxenomai_schedparamsplugin for libtraceeventJan Kiszka (1):
libs: Silence installation output of libtoolMakefile.am | 4 + configure.ac | 35 ++++ lib/alchemy/Makefile.am | 2 + lib/analogy/Makefile.am | 2 + lib/cobalt/Makefile.am | 2 + lib/copperplate/Makefile.am | 2 + lib/mercury/Makefile.am | 3 +- lib/psos/Makefile.am | 2 + lib/smokey/Makefile.am | 2 + lib/trank/Makefile.am | 3 +- lib/vxworks/Makefile.am | 2 + tracing/Makefile.am | 13 ++ tracing/README | 84 +++++++++ tracing/kernelshark/CobaltSwitchEvents.cpp | 156 ++++++++++++++++ tracing/kernelshark/Makefile.am | 20 ++ .../xenomai_cobalt_switch_events.c | 174 ++++++++++++++++++ .../xenomai_cobalt_switch_events.h | 58 ++++++ tracing/libtraceevent/Makefile.am | 19 ++ .../plugin_xenomai_schedparams.c | 158 ++++++++++++++++ 19 files changed, 739 insertions(+), 2 deletions(-) create mode 100644 tracing/Makefile.am create mode 100644 tracing/README create mode 100644 tracing/kernelshark/CobaltSwitchEvents.cpp create mode 100644 tracing/kernelshark/Makefile.am create mode 100644 tracing/kernelshark/xenomai_cobalt_switch_events.c create mode 100644 tracing/kernelshark/xenomai_cobalt_switch_events.h create mode 100644 tracing/libtraceevent/Makefile.am create mode 100644 tracing/libtraceevent/plugin_xenomai_schedparams.c
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux