build: Add c++ build support
PATCH 1/4 build: Add c++ build support
Add c++ build support or use specific c++ compiler
configure.ac +12 -0
@@ -79,6 +79,18 @@ AC_ARG_WITH(cc, ]) AC_PROG_CC +AC_ARG_WITH(cxx, + AS_HELP_STRING([--with-cxx=compiler],[use specific C++ compiler]), + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([You must supply an argument to --with-cxx]) + ;; + esac + CXX="$withval" + ]) +AC_PROG_CXX + # Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then CFLAGS=""
Signature · 1 line
2.17.1
PATCH 2/4 build: add options to build plugins of kernelshark and libtraceevent
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
configure.ac +36 -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=""
@@ -831,6 +833,40 @@ 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 ;; + /*) 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 ;; + /*) 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) + PKG_CHECK_VAR(XENO_LIBTRACEEVENT_INSTALLDIR, libtraceevent, libdir) +fi + +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark) + PKG_CHECK_VAR(XENO_KSHARK_INSTALLDIR, libkshark, libdir) +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.17.1
Re: [PATCH 2/4] build: add options to build plugins of kernelshark and libtraceevent
Quoted 19 lines · Hongzhan Chen
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>configure.ac +2
-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=""
configure.ac AC_ARG_WITH(demodir, · line 842
Quoted 10 lines
configure.ac +7
-0@@ -831,6 +833,40 @@ 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 ;; + /*) kernelshark_plugin=y ;;
These /* matches can be dropped I think. They backdate to the time of accepting a path here. I'll remove them on merge.
Quoted 20 lines
configure.ac +20
-0+ *) 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 ;; + /*) 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) + PKG_CHECK_VAR(XENO_LIBTRACEEVENT_INSTALLDIR, libtraceevent, libdir)
configure.ac AC_ARG_WITH(demodir, · line 872
Quoted 10 lines
configure.ac +7
-0+fi + +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark) + PKG_CHECK_VAR(XENO_KSHARK_INSTALLDIR, libkshark, libdir) +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)])
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
Re: [PATCH 2/4] build: add options to build plugins of kernelshark and libtraceevent
Quoted 58 lines · Jan Kiszka via Xenomai
Quoted 19 lines · Hongzhan Chen
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>configure.ac +2
-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=""configure.ac AC_ARG_WITH(demodir, · line 842
Quoted 10 lines
configure.ac +7
-0@@ -831,6 +833,40 @@ 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 ;; + /*) kernelshark_plugin=y ;;These /* matches can be dropped I think. They backdate to the time of accepting a path here. I'll remove them on merge.
Quoted 24 lines
configure.ac +24
-0+ *) 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 ;; + /*) 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) + PKG_CHECK_VAR(XENO_LIBTRACEEVENT_INSTALLDIR, libtraceevent, libdir) +fi + +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark)
Quoted 9 lines
configure.ac AC_ARG_WITH(demodir, · line 872
Quoted 6 lines
configure.ac +3
-0+ PKG_CHECK_VAR(XENO_KSHARK_INSTALLDIR, libkshark, libdir) +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)])Jan
CFLAGS and LDFLAGS are not set for both plugins, so the build fails. I'll fix this up as well.
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
RE: [PATCH 2/4] build: add options to build plugins of kernelshark and libtraceevent
Quoted 18 lines
Quoted 8 lines
Quoted 8 lines
configure.ac +8
-0+ +if test x$kernelshark_plugin = xy -o x$libtraceevent_plugin = xy; then + PKG_CHECK_MODULES(LIBTRACEEVENT, libtraceevent) + PKG_CHECK_VAR(XENO_LIBTRACEEVENT_INSTALLDIR, libtraceevent, libdir) +fi + +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark)Quoted 9 lines
configure.ac AC_ARG_WITH(demodir, · line 872
Quoted 6 lines
configure.ac +3
-0+ PKG_CHECK_VAR(XENO_KSHARK_INSTALLDIR, libkshark, libdir) +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)])Jan
Quoted 2 lines
CFLAGS and LDFLAGS are not set for both plugins, so the build fails. I'll fix this up as well.
When PKG_CHECK_MODULES(VARIABLE, module) check successfully , it automatically create variable VARIABLE_CFLAGS and VARIABLE_LIBS which should be LDFLAGS. Both patch 3 and patch 4 use them accordingly. I do not why build fails on your side. On my Ubuntu 18.04 system, It always build successfully.
Regards
Hongzhan Chen
Quoted 2 lines
Jan
Re: [PATCH 2/4] build: add options to build plugins of kernelshark and libtraceevent
In reply to Jan KiszkaQuoted 69 lines · Jan Kiszka via Xenomai
Quoted 58 lines · Jan Kiszka via Xenomai
Quoted 19 lines · Hongzhan Chen
To build plugins of kernelshark and libtraceevent, add options and do necessary configuration.
Signed-off-by Hongzhan Chen <[email protected]>configure.ac +2
-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=""configure.ac AC_ARG_WITH(demodir, · line 842
Quoted 10 lines
configure.ac +7
-0@@ -831,6 +833,40 @@ 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 ;; + /*) kernelshark_plugin=y ;;These /* matches can be dropped I think. They backdate to the time of accepting a path here. I'll remove them on merge.
Quoted 24 lines
configure.ac +24
-0+ *) 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 ;; + /*) 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) + PKG_CHECK_VAR(XENO_LIBTRACEEVENT_INSTALLDIR, libtraceevent, libdir) +fi + +if test x$kernelshark_plugin = xy; then + PKG_CHECK_MODULES(LIBKSHARK, libkshark)Quoted 9 lines
configure.ac AC_ARG_WITH(demodir, · line 872
Quoted 6 lines
configure.ac +3
-0+ PKG_CHECK_VAR(XENO_KSHARK_INSTALLDIR, libkshark, libdir) +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)])Jan
Quoted 3 lines
CFLAGS and LDFLAGS are not set for both plugins, so the build fails. I'll fix this up as well.
It was rather related to missing dependencies (libtraceevent and libtracefs).
Also, *_INSTALLDIR does not work properly. It ignores --prefix and DESTDIR. Will try to resolve this.
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
RE: [PATCH 2/4] build: add options to build plugins of kernelshark and libtraceevent
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Jan
CFLAGS and LDFLAGS are not set for both plugins, so the build fails. I'll fix this up as well.
Quoted 5 lines
It was rather related to missing dependencies (libtraceevent and libtracefs).
Also,
*_INSTALLDIRdoes not work properly. It ignores --prefix and DESTDIR. Will try to resolve this.
I am wondering if it is meaningful to call local pkg-config to get local configuration for these dependencies to do compile and get correct installdir to install plugins in our case but we also need to service cross platform installing for both Xenomai and kernelshark with same set of --prefix an DESTDIR which may confuse users.
Regards
Hongzhan Chen
Quoted 6 lines
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
PATCH 3/4 KernelShark: Add xenomai_cobalt_switch_events plugin for KernelShark
In reply to Hongzhan ChenFor 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 -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
@@ -984,6 +984,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 @@ + +lib_LTLIBRARIES = libplugin_xenomai_cobalt_switch_events.la + +libplugin_xenomai_cobalt_switch_events_la_SOURCES = \ + CobaltSwitchEvents.cpp \ + xenomai_cobalt_switch_events.c \ + xenomai_cobalt_switch_events.h + +libplugin_xenomai_cobalt_switch_events_la_CPPFLAGS = \ + $(LIBKSHARK_CFLAGS) + +libplugin_xenomai_cobalt_switch_events_la_LDFLAGS = \ + $(LIBKSHARK_LIBS) + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install \ + $(INSTALL_DATA) $(lib_LTLIBRARIES) "$(XENO_KSHARK_INSTALLDIR)/kernelshark/plugins/" + +uninstall-libLTLIBRARIES: $(lib_LTLIBRARIES) + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall $(RM) "$(XENO_KSHARK_INSTALLDIR)/kernelshark/plugins/$(lib_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.17.1
PATCH 4/4 libtraceevent: Add xenomai_schedparams plugin for libtraceevent
In reply to Hongzhan ChenFor 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 -0
@@ -986,6 +986,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 @@ + +lib_LTLIBRARIES = libplugin_xenomai_schedparams.la + +libplugin_xenomai_schedparams_la_SOURCES = \ + plugin_xenomai_schedparams.c + +libplugin_xenomai_schedparams_la_CPPFLAGS = \ + $(LIBTRACEEVENT_CFLAGS) \ + -I$(top_srcdir)/include + +libplugin_xenomai_schedparams_la_LDFLAGS = \ + $(LIBTRACEEVENT_LIBS) + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install \ + $(INSTALL_DATA) $(lib_LTLIBRARIES) "$(XENO_LIBTRACEEVENT_INSTALLDIR)/traceevent/plugins/" + +uninstall-libLTLIBRARIES: $(lib_LTLIBRARIES) + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall $(RM) "$(XENO_LIBTRACEEVENT_INSTALLDIR)/traceevent/plugins/$(lib_LTLIBRARIES)"
tracing/libtraceevent/plugin_xenomai_schedparams.c new file +158 -0
158 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 17 lines · Hongzhan Chen
Add c++ build support or use specific c++ compiler
Signed-off-by Hongzhan Chen <[email protected]>configure.ac +5
-0@@ -79,6 +79,18 @@ AC_ARG_WITH(cc, ]) AC_PROG_CC +AC_ARG_WITH(cxx, + AS_HELP_STRING([--with-cxx=compiler],[use specific C++ compiler]), + [ + case "$withval" in + "" | y | ye | yes | n | no)
configure.ac AC_ARG_WITH(cc, · line 96
Quoted 10 lines
configure.ac +7
-0+ AC_MSG_ERROR([You must supply an argument to --with-cxx]) + ;; + esac + CXX="$withval" + ]) +AC_PROG_CXX + # Do not let autoconf set the default value of CFLAGS if $XENO_EMPTY_CFLAGS; then CFLAGS=""
Thanks, this one applied as-is. Will send the others as v7 because I modified the build system.
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux