Kernel-Shark and libtraceevent plugins
v7 cover Kernel-Shark and libtraceevent plugins
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
Makefile.am | 4 + configure.ac | 36 ++++ tracing/Makefile.am | 13 ++ tracing/README | 84 +++++++++ tracing/kernelshark/CobaltSwitchEvents.cpp | 156 ++++++++++++++++ tracing/kernelshark/Makefile.am | 23 +++ .../xenomai_cobalt_switch_events.c | 174 ++++++++++++++++++ .../xenomai_cobalt_switch_events.h | 58 ++++++ tracing/libtraceevent/Makefile.am | 19 ++ .../plugin_xenomai_schedparams.c | 158 ++++++++++++++++ 10 files changed, 725 insertions(+) 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 v7 1/3 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 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
configure.ac +33 -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,37 @@ 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) + PKG_CHECK_MODULES(LIBTRACEFS, libtracefs) +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 v7 2/3 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 | 23 +++ .../xenomai_cobalt_switch_events.c | 174 ++++++++++++++++++ .../xenomai_cobalt_switch_events.h | 58 ++++++ 7 files changed, 425 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
@@ -976,6 +976,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 +23 -0
@@ -0,0 +1,23 @@ +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) \ + $(LIBTRACEEVENT_CFLAGS) \ + $(LIBTRACEFS_CFLAGS) + +plugin_xenomai_cobalt_switch_events_la_LDFLAGS = \ + $(LIBKSHARK_LIBS) \ + $(LIBTRACEEVENT_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 v7 3/3 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
@@ -978,6 +978,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
RE: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceevent
In reply to Jan KiszkaQuoted 57 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Saturday, March 12, 2022 9:00 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventFrom: Hongzhan Chen <[email protected]>
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>[Jan: cleaned up AC_ARG_ENABLE matches, add missing kshark dep, drop INSTALLDIRs]Signed-off-by Jan Kiszka <[email protected]>---
configure.ac | 33 +++++++++++++++++++++++++++++++++1 file changed, 33 insertions(+)configure.ac +0
-0@@ -91,6 +91,8 @@ AC_ARG_WITH(cxx, ])
AC_PROG_CXXconfigure.ac +2
-0+PKG_PROG_PKG_CONFIG +# Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then
CFLAGS=""configure.ac +19
-0@@ -826,6 +828,37 @@ 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])
configure.ac AC_ARG_WITH(demodir, · line 859
Quoted 10 lines
configure.ac +10
-0+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) + PKG_CHECK_MODULES(LIBTRACEFS, libtracefs)
I do not quite understand why we check LIBTRAEFS here because kernelshark depend on libtracefs
as described in [1] which should be handled by kernelshark module itself.
If we have to check libtracefs, why we do not check other dependency module like libtraceevent for kernelshark_plugin?
Regards
Hongzhan Chen
[1]: https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/tree/README
Quoted 14 lines
configure.ac +2
-0+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
RE: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceevent
Quoted 61 lines
Quoted 61 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Saturday, March 12, 2022 9:00 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventFrom: Hongzhan Chen <[email protected]>
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>[Jan: cleaned up AC_ARG_ENABLE matches, add missing kshark dep, drop INSTALLDIRs]Signed-off-by Jan Kiszka <[email protected]>---
configure.ac | 33 +++++++++++++++++++++++++++++++++1 file changed, 33 insertions(+)configure.ac +0
-0@@ -91,6 +91,8 @@ AC_ARG_WITH(cxx, ])
AC_PROG_CXXconfigure.ac +2
-0+PKG_PROG_PKG_CONFIG +# Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then
CFLAGS=""configure.ac +25
-0@@ -826,6 +828,37 @@ 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
Quoted 8 lines
configure.ac AC_ARG_WITH(demodir, · line 859
Quoted 4 lines
configure.ac +4
-0+ +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark) + PKG_CHECK_MODULES(LIBTRACEFS, libtracefs)I do not quite understand why we check LIBTRAEFS here because kernelshark depend on libtracefs
as described in [1] which should be handled by kernelshark module itself.
If we have to check libtracefs, why we do not check other dependency module like libtraceevent forkernelshark_plugin?
I just found libtraceevent module already be checked in previous code. But kernelshark also depends on trace-cmd. Do we need to check it here?
Regards
Hongzhan Chen
Quoted 15 lines
Regards
Hongzhan Chen
[1]: https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/tree/README
Quoted 8 lines
configure.ac +2
-0+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
RE: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceevent
Quoted 78 lines
Message-----
From: Chen, Hongzhan
Sent: Monday, March 14, 2022 9:40 AM
To: 'Jan Kiszka' <[email protected]>; '[email protected]' <[email protected]>
Subject: RE: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventQuoted 61 lines
Quoted 61 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Saturday, March 12, 2022 9:00 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventFrom: Hongzhan Chen <[email protected]>
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>[Jan: cleaned up AC_ARG_ENABLE matches, add missing kshark dep, drop INSTALLDIRs]Signed-off-by Jan Kiszka <[email protected]>---
configure.ac | 33 +++++++++++++++++++++++++++++++++1 file changed, 33 insertions(+)configure.ac +0
-0@@ -91,6 +91,8 @@ AC_ARG_WITH(cxx, ])
AC_PROG_CXXconfigure.ac +2
-0+PKG_PROG_PKG_CONFIG +# Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then
CFLAGS=""configure.ac +25
-0@@ -826,6 +828,37 @@ 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) +fiQuoted 8 lines
configure.ac AC_ARG_WITH(demodir, · line 859
Quoted 4 lines
configure.ac +4
-0+ +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark) + PKG_CHECK_MODULES(LIBTRACEFS, libtracefs)I do not quite understand why we check LIBTRAEFS here because kernelshark depend on libtracefs
as described in [1] which should be handled by kernelshark module itself.
If we have to check libtracefs, why we do not check other dependency module like libtraceevent forkernelshark_plugin?
Quoted 1 line
I just found libtraceevent module already be checked in previous code. But kernelshark also depends on trace-cmd. Do we need to check it here?
Following is error when I remove libtracefs in checking libkshark:
configure: error: Package requirements (libkshark) were not met:
Package 'libtracefs', required by 'libtracecmd', not found
Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix.
Following is error when remove trace-cmd:
checking for LIBKSHARK... no
configure: error: Package requirements (libkshark) were not met:
Package 'libtracecmd', required by 'libkshark', not found
Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix.
Regards
Hongzhan Chen
Quoted 20 lines
Regards
Hongzhan Chen
Quoted 15 lines
Regards
Hongzhan Chen
[1]: https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/tree/README
Quoted 8 lines
configure.ac +2
-0+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
Re: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceevent
In reply to Chen, HongzhanQuoted 63 lines · Hongzhan
Quoted 63 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Saturday, March 12, 2022 9:00 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventFrom: Hongzhan Chen <[email protected]>
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>[Jan: cleaned up AC_ARG_ENABLE matches, add missing kshark dep, drop INSTALLDIRs]Signed-off-by Jan Kiszka <[email protected]>---
configure.ac | 33 +++++++++++++++++++++++++++++++++1 file changed, 33 insertions(+)configure.ac +0
-0@@ -91,6 +91,8 @@ AC_ARG_WITH(cxx, ])
AC_PROG_CXXconfigure.ac +2
-0+PKG_PROG_PKG_CONFIG +# Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then
CFLAGS=""configure.ac +25
-0@@ -826,6 +828,37 @@ 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
Quoted 9 lines
configure.ac AC_ARG_WITH(demodir, · line 859
Quoted 4 lines
configure.ac +4
-0+ +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark) + PKG_CHECK_MODULES(LIBTRACEFS, libtracefs)I do not quite understand why we check LIBTRAEFS here because kernelshark depend on libtracefs
as described in [1] which should be handled by kernelshark module itself.
If we have to check libtracefs, why we do not check other dependency module like libtraceevent forkernelshark_plugin?
Without this inclusion (and the corresponding usage of LIBTRACEFS_CFLAGS), you will get
CC plugin_xenomai_cobalt_switch_events_la-xenomai_cobalt_switch_events.lo
In file included from ../../../tracing/kernelshark/xenomai_cobalt_switch_events.c:17:0:/usr/local/include/trace-cmd/trace-cmd.h:10:10: fatal error: tracefs.h: No such file or directory
#include "tracefs.h"
^~~~~~~~~~~compilation terminated.
I do not have libtracefs installed via my distro, thus everything must be explored and properly appended to the search path.
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
RE: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceevent
-----Original Message-----
From: Jan Kiszka <[email protected]>
Quoted 84 lines
Sent: Monday, March 14, 2022 2:41 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventQuoted 63 lines · Hongzhan
Quoted 63 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Saturday, March 12, 2022 9:00 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventFrom: Hongzhan Chen <[email protected]>
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>[Jan: cleaned up AC_ARG_ENABLE matches, add missing kshark dep, drop INSTALLDIRs]Signed-off-by Jan Kiszka <[email protected]>---
configure.ac | 33 +++++++++++++++++++++++++++++++++1 file changed, 33 insertions(+)configure.ac +0
-0@@ -91,6 +91,8 @@ AC_ARG_WITH(cxx, ])
AC_PROG_CXXconfigure.ac +2
-0+PKG_PROG_PKG_CONFIG +# Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then
CFLAGS=""configure.ac +25
-0@@ -826,6 +828,37 @@ 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) +fiQuoted 9 lines
configure.ac AC_ARG_WITH(demodir, · line 859
Quoted 4 lines
configure.ac +4
-0+ +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark) + PKG_CHECK_MODULES(LIBTRACEFS, libtracefs)I do not quite understand why we check LIBTRAEFS here because kernelshark depend on libtracefs
as described in [1] which should be handled by kernelshark module itself.
If we have to check libtracefs, why we do not check other dependency module like libtraceevent forkernelshark_plugin?Without this inclusion (and the corresponding usage of
LIBTRACEFS_CFLAGS), you will getCC plugin_xenomai_cobalt_switch_events_la-xenomai_cobalt_switch_events.lo
In file included from../../../tracing/kernelshark/xenomai_cobalt_switch_events.c:17:0:/usr/local/include/trace-cmd/trace-cmd.h:10:10: fatal error:tracefs.h: No such file or directory
Quoted 6 lines
#include "tracefs.h" ^~~~~~~~~~~compilation terminated.
I do not have libtracefs installed via my distro, thus everything must be explored and properly appended to the search path.
According to my test on my platform, if we have not instaledl libtracefs, PKG_CHECK_MODULES(LIBKSHARK, libkshark) would fail at first reporting following error.
configure: error: Package requirements (libkshark) were not met:
Package 'libtracefs', required by 'libtracecmd', not found
Regards
Hongzhan Chen
Quoted 6 lines
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
Re: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceevent
Quoted 93 lines · Hongzhan
-----Original Message-----
From: Jan Kiszka <[email protected]>Quoted 84 lines
Sent: Monday, March 14, 2022 2:41 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventQuoted 63 lines · Hongzhan
Quoted 63 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Saturday, March 12, 2022 9:00 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventFrom: Hongzhan Chen <[email protected]>
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>[Jan: cleaned up AC_ARG_ENABLE matches, add missing kshark dep, drop INSTALLDIRs]Signed-off-by Jan Kiszka <[email protected]>---
configure.ac | 33 +++++++++++++++++++++++++++++++++1 file changed, 33 insertions(+)configure.ac +0
-0@@ -91,6 +91,8 @@ AC_ARG_WITH(cxx, ])
AC_PROG_CXXconfigure.ac +2
-0+PKG_PROG_PKG_CONFIG +# Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then
CFLAGS=""configure.ac +25
-0@@ -826,6 +828,37 @@ 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) +fiQuoted 9 lines
configure.ac AC_ARG_WITH(demodir, · line 859
Quoted 4 lines
configure.ac +4
-0+ +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark) + PKG_CHECK_MODULES(LIBTRACEFS, libtracefs)I do not quite understand why we check LIBTRAEFS here because kernelshark depend on libtracefs
as described in [1] which should be handled by kernelshark module itself.
If we have to check libtracefs, why we do not check other dependency module like libtraceevent forkernelshark_plugin?Without this inclusion (and the corresponding usage of
LIBTRACEFS_CFLAGS), you will getCC plugin_xenomai_cobalt_switch_events_la-xenomai_cobalt_switch_events.lo
In file included from../../../tracing/kernelshark/xenomai_cobalt_switch_events.c:17:0:/usr/local/include/trace-cmd/trace-cmd.h:10:10: fatal error:tracefs.h: No such file or directoryQuoted 6 lines
#include "tracefs.h" ^~~~~~~~~~~compilation terminated.
I do not have libtracefs installed via my distro, thus everything must be explored and properly appended to the search path.
Quoted 8 lines
According to my test on my platform, if we have not instaledl libtracefs,
PKG_CHECK_MODULES(LIBKSHARK, libkshark)would fail at first reporting following error.configure: error: Package requirements (libkshark) were not met:
Package 'libtracefs', required by 'libtracecmd', not found
Right, but this alone does not fill and propagate LIBTRACEFS_CFLAGS.
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
RE: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceevent
Quoted 98 lines · Hongzhan
Quoted 86 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>Quoted 4 lines
Sent: Monday, March 14, 2022 2:41 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventQuoted 74 lines
Quoted 72 lines · Hongzhan
Quoted 57 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Saturday, March 12, 2022 9:00 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventFrom: Hongzhan Chen <[email protected]>
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>[Jan: cleaned up AC_ARG_ENABLE matches, add missing kshark dep, drop INSTALLDIRs]Signed-off-by Jan Kiszka <[email protected]>---
configure.ac | 33 +++++++++++++++++++++++++++++++++1 file changed, 33 insertions(+)configure.ac +0
-0@@ -91,6 +91,8 @@ AC_ARG_WITH(cxx, ])
AC_PROG_CXXconfigure.ac +2
-0+PKG_PROG_PKG_CONFIG +# Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then
CFLAGS=""configure.ac +19
-0@@ -826,6 +828,37 @@ 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])configure.ac AC_ARG_WITH(demodir, · line 859
Quoted 10 lines
configure.ac +10
-0+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) + PKG_CHECK_MODULES(LIBTRACEFS, libtracefs)I do not quite understand why we check LIBTRAEFS here because kernelshark depend on libtracefs
as described in [1] which should be handled by kernelshark module itself.
If we have to check libtracefs, why we do not check other dependency module like libtraceevent forkernelshark_plugin?Without this inclusion (and the corresponding usage of
LIBTRACEFS_CFLAGS), you will getCC plugin_xenomai_cobalt_switch_events_la-xenomai_cobalt_switch_events.lo
In file included from../../../tracing/kernelshark/xenomai_cobalt_switch_events.c:17:0:/usr/local/include/trace-cmd/trace-cmd.h:10:10: fatal error:tracefs.h: No such file or directoryQuoted 6 lines
#include "tracefs.h" ^~~~~~~~~~~compilation terminated.
I do not have libtracefs installed via my distro, thus everything must be explored and properly appended to the search path.
According to my test on my platform, if we have not instaledl libtracefs,
PKG_CHECK_MODULES(LIBKSHARK, libkshark)would fail at first reporting following error.
Quoted 6 lines
configure: error: Package requirements (libkshark) were not met:
Package 'libtracefs', required by 'libtracecmd', not found
Right, but this alone does not fill and propagate
LIBTRACEFS_CFLAGS.
Why do we need LIBTRACEFS_CFLAGS? We do not try to compile libtracefs. when PKG_CHECK_MODULES(LIBKSHARK, libkshark) successfully, LIBKSHARK_CFLAGS already include needed tracefs path like following. The cause of the issue you met should be that Libtracefs is not installed correctly on you platform? If libtracefs had not been installed why configure stage did not report error?
-I/usr/local/include/kernelshark -I/usr/local/include/trace-cmd -I/usr/local/include/tracefs -I/usr/local/include/traceevent -I/usr/include/json-c
Regards
Hongzhan Chen
Quoted 7 lines
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
Re: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceevent
Quoted 103 lines · Hongzhan
Quoted 103 lines · Hongzhan
Quoted 86 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>Quoted 4 lines
Sent: Monday, March 14, 2022 2:41 PM
To: Chen, Hongzhan <[email protected]>; [email protected]
Subject: Re: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventQuoted 74 lines
Quoted 72 lines · Hongzhan
Quoted 57 lines
-----Original Message-----
From: Jan Kiszka <[email protected]>
Sent: Saturday, March 12, 2022 9:00 PM
To: [email protected]
Cc: Chen, Hongzhan <[email protected]>
Subject: [PATCH v7 1/3] build: add options to build plugins of kernelshark and libtraceeventFrom: Hongzhan Chen <[email protected]>
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>[Jan: cleaned up AC_ARG_ENABLE matches, add missing kshark dep, drop INSTALLDIRs]Signed-off-by Jan Kiszka <[email protected]>---
configure.ac | 33 +++++++++++++++++++++++++++++++++1 file changed, 33 insertions(+)configure.ac +0
-0@@ -91,6 +91,8 @@ AC_ARG_WITH(cxx, ])
AC_PROG_CXXconfigure.ac +2
-0+PKG_PROG_PKG_CONFIG +# Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then
CFLAGS=""configure.ac +19
-0@@ -826,6 +828,37 @@ 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])configure.ac AC_ARG_WITH(demodir, · line 859
Quoted 10 lines
configure.ac +10
-0+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) + PKG_CHECK_MODULES(LIBTRACEFS, libtracefs)I do not quite understand why we check LIBTRAEFS here because kernelshark depend on libtracefs
as described in [1] which should be handled by kernelshark module itself.
If we have to check libtracefs, why we do not check other dependency module like libtraceevent forkernelshark_plugin?Without this inclusion (and the corresponding usage of
LIBTRACEFS_CFLAGS), you will getCC plugin_xenomai_cobalt_switch_events_la-xenomai_cobalt_switch_events.lo
In file included from../../../tracing/kernelshark/xenomai_cobalt_switch_events.c:17:0:/usr/local/include/trace-cmd/trace-cmd.h:10:10: fatal error:tracefs.h: No such file or directoryQuoted 6 lines
#include "tracefs.h" ^~~~~~~~~~~compilation terminated.
I do not have libtracefs installed via my distro, thus everything must be explored and properly appended to the search path.
According to my test on my platform, if we have not instaledl libtracefs,
PKG_CHECK_MODULES(LIBKSHARK, libkshark)would fail at first reporting following error.configure: error: Package requirements (libkshark) were not met:
Package 'libtracefs', required by 'libtracecmd', not found
Quoted 8 lines
Quoted 1 line
Right, but this alone does not fill and propagate
LIBTRACEFS_CFLAGS.Why do we need
LIBTRACEFS_CFLAGS? We do not try to compile libtracefs. whenPKG_CHECK_MODULES(LIBKSHARK, libkshark)successfully,LIBKSHARK_CFLAGSalready include needed tracefs path like following. The cause of the issue you met should be that Libtracefs is not installed correctly on you platform? If libtracefs had not been installed why configure stage did not report error?-I/usr/local/include/kernelshark -I/usr/local/include/trace-cmd -I/usr/local/include/tracefs -I/usr/local/include/traceevent -I/usr/include/json-c
Not here so far:
$ pkg-config libkshark --cflags -I/usr/local/include/kernelshark -I/usr/local/include/trace-cmd -I/usr/include/json-c
I dug deeper and it turned out that my local installation of trace-cmd was outdated - "make install" vs. "make install_libs"...
OK, we can simplify then again. Let me check...
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux