Skip to contentSkip to conversation

trace-cmd: Clean up library and KernelShark remnants

PATCH New Steven Rostedt 1 participant 4 messages Jul 26, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

cover trace-cmd: Clean up library and KernelShark remnants

From: "Steven Rostedt (VMware)" <[email protected]>

Remove leftover remnants of building KernelShark, libtraceevent and libtracefs from the trace-cmd Makefiles.

Steven Rostedt (VMware) (3):
trace-cmd: Remove traceevent/ and tracefs/ from include headers
trace-cmd: Remove leftover traces of libtraceevent in Makefiles
trace-cmd: Remove remnants of KernelShark build

 .gitignore                                    |  1 -
 Makefile                                      | 39 ++-----------------
 include/trace-cmd/trace-cmd.h                 |  4 +-
 .../include/private/trace-cmd-private.h       |  2 +-
 lib/trace-cmd/trace-util.c                    |  4 +-
 python/Makefile                               |  2 +-
 6 files changed, 9 insertions(+), 43 deletions(-)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/3 trace-cmd: Remove traceevent/ and tracefs/ from include headers

From: "Steven Rostedt (VMware)" <[email protected]>

trace-cmd now depends on the external libraries of both libtraceevent and libtracefs and uses pkg-config to find their headers. As pkg-config will find the full path to the headers, do not include parts of the path when including them, because they may change, and the hardcoded path in the code will not.

---
 include/trace-cmd/trace-cmd.h                     | 4 ++--
 lib/trace-cmd/include/private/trace-cmd-private.h | 2 +-
 lib/trace-cmd/trace-util.c                        | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
include/trace-cmd/trace-cmd.h +2 -2
index 6984db863303..7fea4e017b26 100644
@@ -6,8 +6,8 @@
 #ifndef _TRACE_CMD_H
 #define _TRACE_CMD_H
 
-#include "traceevent/event-parse.h"
-#include "tracefs/tracefs.h"
+#include "event-parse.h"
+#include "tracefs.h"
 
 struct tracecmd_input;
 
lib/trace-cmd/include/private/trace-cmd-private.h +1 -1
index 6440084ddd9d..c58b09e9da48 100644
@@ -8,7 +8,7 @@
 
 #include <fcntl.h> /* for iovec */
 #include <sys/types.h>
-#include "traceevent/event-parse.h"
+#include "event-parse.h"
 #include "trace-cmd/trace-cmd.h"
 
 #define __packed __attribute__((packed))
lib/trace-cmd/trace-util.c +2 -2
index b0c98c724363..9bc948224732 100644
@@ -20,8 +20,8 @@
 #include <sys/stat.h>
 #include <sys/sysinfo.h>
 #include <time.h>
-#include <traceevent/event-parse.h>
-#include <traceevent/event-utils.h>
+#include <event-parse.h>
+#include <event-utils.h>
 
 #include "trace-cmd-private.h"
 #include "trace-cmd-local.h"
Signature · 1 line
2.30.2
#2 lore raw

PATCH 2/3 trace-cmd: Remove leftover traces of libtraceevent in Makefiles

In reply to Steven Rostedt

From: "Steven Rostedt (VMware)" <[email protected]>

There's still references to libtraceevent that was used for handling the libtraceevent that was located in the repo. As these are now handled by the libtraceevent external repo, they no longer need to be handled here.

---
 .gitignore      |  1 -
 Makefile        | 23 ++---------------------
 python/Makefile |  2 +-
 3 files changed, 3 insertions(+), 23 deletions(-)
.gitignore +0 -1
index f0719c5ef126..eb1b0dbea6f2 100644
@@ -20,7 +20,6 @@ ctracecmdgui_wrap.c
 tags
 TAGS
 cscope*
-traceevent_plugin_dir
 trace_python_dir
 tracecmd_plugin_dir
 libtracecmd.pc
Makefile +2 -21
index d6fd09d8d0e5..951e717e1d87 100644
@@ -89,17 +89,13 @@ export img_install img_install_SQ libdir libdir_SQ includedir_SQ
 export DESTDIR DESTDIR_SQ
 
 ifeq ($(prefix),$(HOME))
-plugin_traceevent_dir = $(HOME)/.local/lib/traceevent/plugins
 plugin_tracecmd_dir = $(libdir)/trace-cmd/plugins
-python_dir ?= $(libdir)/traceevent/python
+python_dir ?= $(libdir)/trace-cmd/python
 var_dir = $(HOME)/.trace-cmd/
 else
-plugin_traceevent_dir = $(libdir)/trace-cmd/plugins
 python_dir ?= $(libdir)/trace-cmd/python
-PLUGIN_DIR_TRACEEVENT = -DPLUGIN_TRACEEVENT_DIR="$(plugin_traceevent_dir)"
 PLUGIN_DIR_TRACECMD = -DPLUGIN_TRACECMD_DIR="$(plugin_tracecmd_dir)"
 PYTHON_DIR = -DPYTHON_DIR="$(python_dir)"
-PLUGIN_DIR_TRACEEVENT_SQ = '$(subst ','\'',$(PLUGIN_DIR_TRACEEVENT))'
 PLUGIN_DIR_TRACECMD_SQ = '$(subst ','\'',$(PLUGIN_DIR_TRACECMD))'
 PYTHON_DIR_SQ = '$(subst ','\'',$(PYTHON_DIR))'
 var_dir = /var
@@ -108,7 +104,6 @@ endif
 # Shell quotes
 bindir_SQ = $(subst ','\'',$(bindir))
 bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
-plugin_traceevent_dir_SQ = $(subst ','\'',$(plugin_traceevent_dir))
 plugin_tracecmd_dir_SQ = $(subst ','\'',$(plugin_tracecmd_dir))
 python_dir_SQ = $(subst ','\'',$(python_dir))
 
@@ -124,11 +119,9 @@ HELP_DIR_SQ = '$(subst ','\'',$(HELP_DIR))'
 
 BASH_COMPLETE_DIR ?= $(etcdir)/bash_completion.d
 
-export PLUGIN_DIR_TRACEEVENT
 export PLUGIN_DIR_TRACECMD
 export PYTHON_DIR
 export PYTHON_DIR_SQ
-export plugin_traceevent_dir_SQ
 export plugin_tracecmd_dir_SQ
 export python_dir_SQ
 export var_dir
@@ -346,7 +339,7 @@ endif
 
 # Append required CFLAGS
 override CFLAGS += $(INCLUDES) $(VAR_DIR)
-override CFLAGS += $(PLUGIN_DIR_TRACEEVENT_SQ) $(PLUGIN_DIR_TRACECMD_SQ)
+override CFLAGS += $(PLUGIN_DIR_TRACECMD_SQ)
 override CFLAGS += $(udis86-flags) $(blk-flags)
 override LDFLAGS += $(udis86-ldflags)
 
@@ -431,24 +424,14 @@ ifneq ($(CUNIT_INSTALLED),1)
 endif
 	$(Q)$(MAKE) -C $(src)/utest $@
 
-plugins_traceevent: force $(obj)/lib/traceevent/plugins/traceevent_plugin_dir \
-		   $(obj)/lib/traceevent/plugins/trace_python_dir
-	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins
-
 plugins_tracecmd: force $(obj)/lib/trace-cmd/plugins/tracecmd_plugin_dir
 	$(Q)$(MAKE) -C $(src)/lib/trace-cmd/plugins
 
 plugins: plugins_tracecmd
 
-$(obj)/lib/traceevent/plugins/traceevent_plugin_dir: force
-	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins $@
-
 $(obj)/lib/trace-cmd/plugins/tracecmd_plugin_dir: force
 	$(Q)$(MAKE) -C $(src)/lib/trace-cmd/plugins $@
 
-$(obj)/lib/traceevent/plugins/trace_python_dir: force
-	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins $@
-
 show_other_make:
 	@echo "Note: to build man pages, type \"make doc\""
 	@echo "      to build unit tests, type \"make test\""
@@ -472,8 +455,6 @@ cscope: force
 	$(RM) cscope*
 	$(call find_tag_files) | cscope -b -q
 
-install_plugins_traceevent: force
-	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins install_plugins
 install_plugins_tracecmd: force
 	$(Q)$(MAKE) -C $(src)/lib/trace-cmd/plugins install_plugins
 
python/Makefile +1 -1
index acd67e918033..63f5736dec45 100644
@@ -9,7 +9,7 @@ PYTHON_PY_LIBS := tracecmd.install
 endif
 
 ctracecmd.so: ctracecmd.i $(LIBTRACECMD_STATIC)
-	swig -Wall -python -noproxy -I$(src)/include/traceevent -I$(src)/include/trace-cmd $(LIBTRACEEVENT_CFLAGS) ctracecmd.i
+	swig -Wall -python -noproxy -I$(src)/include/trace-cmd $(LIBTRACEEVENT_CFLAGS) ctracecmd.i
 	$(CC) -fpic -c $(CPPFLAGS) $(CFLAGS) $(PYTHON_INCLUDES)  ctracecmd_wrap.c
 	$(CC) --shared $(LIBTRACECMD_STATIC) $(LDFLAGS) ctracecmd_wrap.o -o ctracecmd.so $(TRACE_LIBS)
 
Signature · 1 line
2.30.2
#3 lore raw

PATCH 3/3 trace-cmd: Remove remnants of KernelShark build

In reply to Steven Rostedt

From: "Steven Rostedt (VMware)" <[email protected]>

There were still some KernelShark make commands for building the gui and cleaning up the files. Remove them as KernelShark is lives in its own repository now.

---
 Makefile | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
Makefile +1 -15
index 951e717e1d87..91f628593ee4 100644
@@ -70,9 +70,7 @@ bindir_relative = bin
 bindir = $(prefix)/$(bindir_relative)
 man_dir = $(prefix)/share/man
 man_dir_SQ = '$(subst ','\'',$(man_dir))'
-html_install = $(prefix)/share/kernelshark/html
 html_install_SQ = '$(subst ','\'',$(html_install))'
-img_install = $(prefix)/share/kernelshark/html/images
 img_install_SQ = '$(subst ','\'',$(img_install))'
 libdir = $(prefix)/$(libdir_relative)
 libdir_SQ = '$(subst ','\'',$(libdir))'
@@ -207,9 +205,7 @@ PKG_CONFIG_FILE := $(addprefix $(BUILD_OUTPUT)/,$(PKG_CONFIG_SOURCE_FILE))
 
 export pkgconfig_dir PKG_CONFIG_FILE
 
-kshark-dir	= $(src)/kernel-shark
-
-export prefix bindir src obj kshark-dir
+export prefix bindir src obj
 
 LIBS = -ldl
 
@@ -355,11 +351,6 @@ all: all_cmd plugins show_other_make
 
 all_cmd: $(CMD_TARGETS)
 
-CMAKE_COMMAND = /usr/bin/cmake
-
-# Build with "BUILD_TYPE=Release" to remove cmake debug info
-BUILD_TYPE ?= RelWithDebInfo
-
 BUILD_PREFIX := $(BUILD_OUTPUT)/build_prefix
 
 $(BUILD_PREFIX): force
@@ -368,9 +359,6 @@ $(BUILD_PREFIX): force
 $(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template $(BUILD_PREFIX) $(VERSION_FILE)
 	$(Q) $(call do_make_pkgconfig_file,$(prefix))
 
-$(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt
-	$(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -D_INSTALL_PREFIX=$(prefix) -D_LIBDIR=$(libdir) ..
-
 trace-cmd: force $(LIBTRACECMD_STATIC) \
 	force $(obj)/lib/trace-cmd/plugins/tracecmd_plugin_dir
 	$(Q)$(MAKE) -C $(src)/tracecmd $(obj)/tracecmd/$@
@@ -496,8 +484,6 @@ clean:
 	$(MAKE) -C $(src)/utest clean
 	$(MAKE) -C $(src)/python clean
 	$(MAKE) -C $(src)/tracecmd clean
-	if [ -f $(kshark-dir)/build/Makefile ]; then $(MAKE) -C $(kshark-dir)/build clean; fi
-	cd $(kshark-dir)/build; ./cmake_clean.sh
 
 define build_uninstall_script
 	$(Q)mkdir $(BUILD_OUTPUT)/tmp_build
Signature · 1 line
2.30.2