linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] perf always use system libtraceevent
@ 2022-11-17 22:49 Ian Rogers
  2022-11-17 22:49 ` [PATCH v1 1/2] perf build: Require libtraceevent from the system Ian Rogers
       [not found] ` <20221117224952.358639-3-irogers@google.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Ian Rogers @ 2022-11-17 22:49 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Steven Rostedt, Masami Hiramatsu, linux-kernel, linux-perf-users,
	Steven Rostedt, Adrian Hunter, Linux Trace Devel
  Cc: Stephane Eranian, Ian Rogers

Force the perf build to use the previously optional non-default
LIBTRACEEVENT_DYNAMIC, ie the system libtraceevent. With nothing using
the now out-of-date tools/lib/traceevent remove it.

Discussed on LKML here:
https://lore.kernel.org/lkml/CAP-5=fWxAjEia-Qbm0RVzKOxyiod8rUOBieqaGK=DtQboDe3Qw@mail.gmail.com/

Builds upon:
https://lore.kernel.org/lkml/20221116224631.207631-1-irogers@google.com/

Ian Rogers (2):
  perf build: Require libtraceevent from the system
  tools lib traceevent: Remove libtraceevent

 tools/lib/traceevent/.gitignore               |    4 -
 tools/lib/traceevent/Build                    |    8 -
 tools/lib/traceevent/Documentation/Makefile   |  207 -
 .../traceevent/Documentation/asciidoc.conf    |  120 -
 .../Documentation/libtraceevent-commands.txt  |  153 -
 .../Documentation/libtraceevent-cpus.txt      |   77 -
 .../libtraceevent-endian_read.txt             |   78 -
 .../libtraceevent-event_find.txt              |  103 -
 .../Documentation/libtraceevent-event_get.txt |   99 -
 .../libtraceevent-event_list.txt              |  122 -
 .../libtraceevent-event_print.txt             |  130 -
 .../libtraceevent-field_find.txt              |  118 -
 .../libtraceevent-field_get_val.txt           |  122 -
 .../libtraceevent-field_print.txt             |  126 -
 .../libtraceevent-field_read.txt              |   81 -
 .../Documentation/libtraceevent-fields.txt    |  105 -
 .../libtraceevent-file_endian.txt             |   91 -
 .../Documentation/libtraceevent-filter.txt    |  209 -
 .../Documentation/libtraceevent-func_apis.txt |  183 -
 .../Documentation/libtraceevent-func_find.txt |   88 -
 .../Documentation/libtraceevent-handle.txt    |  101 -
 .../libtraceevent-header_page.txt             |  102 -
 .../libtraceevent-host_endian.txt             |  104 -
 .../Documentation/libtraceevent-long_size.txt |   78 -
 .../Documentation/libtraceevent-page_size.txt |   82 -
 .../libtraceevent-parse_event.txt             |   90 -
 .../libtraceevent-parse_head.txt              |   82 -
 .../Documentation/libtraceevent-plugins.txt   |  122 -
 .../libtraceevent-record_parse.txt            |  137 -
 .../libtraceevent-reg_event_handler.txt       |  156 -
 .../libtraceevent-reg_print_func.txt          |  155 -
 .../Documentation/libtraceevent-set_flag.txt  |  104 -
 .../Documentation/libtraceevent-strerror.txt  |   85 -
 .../Documentation/libtraceevent-tseq.txt      |  158 -
 .../Documentation/libtraceevent.txt           |  192 -
 .../traceevent/Documentation/manpage-1.72.xsl |   14 -
 .../traceevent/Documentation/manpage-base.xsl |   35 -
 .../Documentation/manpage-bold-literal.xsl    |   17 -
 .../Documentation/manpage-normal.xsl          |   13 -
 .../Documentation/manpage-suppress-sp.xsl     |   21 -
 tools/lib/traceevent/Makefile                 |  300 -
 tools/lib/traceevent/event-parse-api.c        |  333 -
 tools/lib/traceevent/event-parse-local.h      |  123 -
 tools/lib/traceevent/event-parse.c            | 7624 -----------------
 tools/lib/traceevent/event-parse.h            |  750 --
 tools/lib/traceevent/event-plugin.c           |  711 --
 tools/lib/traceevent/event-utils.h            |   67 -
 tools/lib/traceevent/kbuffer-parse.c          |  809 --
 tools/lib/traceevent/kbuffer.h                |   68 -
 .../lib/traceevent/libtraceevent.pc.template  |   10 -
 tools/lib/traceevent/parse-filter.c           | 2281 -----
 tools/lib/traceevent/parse-utils.c            |   71 -
 tools/lib/traceevent/plugins/Build            |   12 -
 tools/lib/traceevent/plugins/Makefile         |  225 -
 .../lib/traceevent/plugins/plugin_cfg80211.c  |   43 -
 .../lib/traceevent/plugins/plugin_function.c  |  282 -
 tools/lib/traceevent/plugins/plugin_futex.c   |  123 -
 tools/lib/traceevent/plugins/plugin_hrtimer.c |   74 -
 tools/lib/traceevent/plugins/plugin_jbd2.c    |   61 -
 tools/lib/traceevent/plugins/plugin_kmem.c    |   80 -
 tools/lib/traceevent/plugins/plugin_kvm.c     |  527 --
 .../lib/traceevent/plugins/plugin_mac80211.c  |   88 -
 .../traceevent/plugins/plugin_sched_switch.c  |  146 -
 tools/lib/traceevent/plugins/plugin_scsi.c    |  434 -
 tools/lib/traceevent/plugins/plugin_tlb.c     |   66 -
 tools/lib/traceevent/plugins/plugin_xen.c     |  138 -
 tools/lib/traceevent/tep_strerror.c           |   53 -
 tools/lib/traceevent/trace-seq.c              |  249 -
 tools/lib/traceevent/trace-seq.h              |   55 -
 tools/perf/Makefile.config                    |   51 +-
 tools/perf/Makefile.perf                      |   95 +-
 71 files changed, 28 insertions(+), 19993 deletions(-)
 delete mode 100644 tools/lib/traceevent/.gitignore
 delete mode 100644 tools/lib/traceevent/Build
 delete mode 100644 tools/lib/traceevent/Documentation/Makefile
 delete mode 100644 tools/lib/traceevent/Documentation/asciidoc.conf
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-commands.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_get.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_list.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_find.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_print.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_read.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-fields.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_find.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-handle.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_page.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-long_size.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq.txt
 delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent.txt
 delete mode 100644 tools/lib/traceevent/Documentation/manpage-1.72.xsl
 delete mode 100644 tools/lib/traceevent/Documentation/manpage-base.xsl
 delete mode 100644 tools/lib/traceevent/Documentation/manpage-bold-literal.xsl
 delete mode 100644 tools/lib/traceevent/Documentation/manpage-normal.xsl
 delete mode 100644 tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl
 delete mode 100644 tools/lib/traceevent/Makefile
 delete mode 100644 tools/lib/traceevent/event-parse-api.c
 delete mode 100644 tools/lib/traceevent/event-parse-local.h
 delete mode 100644 tools/lib/traceevent/event-parse.c
 delete mode 100644 tools/lib/traceevent/event-parse.h
 delete mode 100644 tools/lib/traceevent/event-plugin.c
 delete mode 100644 tools/lib/traceevent/event-utils.h
 delete mode 100644 tools/lib/traceevent/kbuffer-parse.c
 delete mode 100644 tools/lib/traceevent/kbuffer.h
 delete mode 100644 tools/lib/traceevent/libtraceevent.pc.template
 delete mode 100644 tools/lib/traceevent/parse-filter.c
 delete mode 100644 tools/lib/traceevent/parse-utils.c
 delete mode 100644 tools/lib/traceevent/plugins/Build
 delete mode 100644 tools/lib/traceevent/plugins/Makefile
 delete mode 100644 tools/lib/traceevent/plugins/plugin_cfg80211.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_function.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_futex.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_hrtimer.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_jbd2.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_kmem.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_kvm.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_mac80211.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_sched_switch.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_scsi.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_tlb.c
 delete mode 100644 tools/lib/traceevent/plugins/plugin_xen.c
 delete mode 100644 tools/lib/traceevent/tep_strerror.c
 delete mode 100644 tools/lib/traceevent/trace-seq.c
 delete mode 100644 tools/lib/traceevent/trace-seq.h

-- 
2.38.1.584.g0f3c55d4c2-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v1 1/2] perf build: Require libtraceevent from the system
  2022-11-17 22:49 [PATCH v1 0/2] perf always use system libtraceevent Ian Rogers
@ 2022-11-17 22:49 ` Ian Rogers
  2022-11-18  9:30   ` Peter Zijlstra
       [not found] ` <20221117224952.358639-3-irogers@google.com>
  1 sibling, 1 reply; 8+ messages in thread
From: Ian Rogers @ 2022-11-17 22:49 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Steven Rostedt, Masami Hiramatsu, linux-kernel, linux-perf-users,
	Steven Rostedt, Adrian Hunter, Linux Trace Devel
  Cc: Stephane Eranian, Ian Rogers

Unconditionally require libtraceevent to come from the system. Force
the determination of the libtracefs version if it is present.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/Makefile.config | 51 +++++++++-----------
 tools/perf/Makefile.perf   | 95 ++------------------------------------
 2 files changed, 28 insertions(+), 118 deletions(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 9cc3c48f3288..38dd686277c1 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -1182,34 +1182,29 @@ ifdef LIBPFM4
   endif
 endif
 
-ifdef LIBTRACEEVENT_DYNAMIC
-  $(call feature_check,libtraceevent)
-  ifeq ($(feature-libtraceevent), 1)
-    EXTLIBS += -ltraceevent
-    LIBTRACEEVENT_VERSION := $(shell $(PKG_CONFIG) --modversion libtraceevent)
-    LIBTRACEEVENT_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
-    LIBTRACEEVENT_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
-    LIBTRACEEVENT_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
-    LIBTRACEEVENT_VERSION_CPP := $(shell expr $(LIBTRACEEVENT_VERSION_1) \* 255 \* 255 + $(LIBTRACEEVENT_VERSION_2) \* 255 + $(LIBTRACEEVENT_VERSION_3))
-    CFLAGS += -DLIBTRACEEVENT_VERSION=$(LIBTRACEEVENT_VERSION_CPP)
-  else
-    dummy := $(error Error: No libtraceevent devel library found, please install libtraceevent-devel);
-  endif
-endif
-
-ifdef LIBTRACEFS_DYNAMIC
-  $(call feature_check,libtracefs)
-  ifeq ($(feature-libtracefs), 1)
-    EXTLIBS += -ltracefs
-    LIBTRACEFS_VERSION := $(shell $(PKG_CONFIG) --modversion libtracefs)
-    LIBTRACEFS_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEFS_VERSION)))
-    LIBTRACEFS_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEFS_VERSION)))
-    LIBTRACEFS_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEFS_VERSION)))
-    LIBTRACEFS_VERSION_CPP := $(shell expr $(LIBTRACEFS_VERSION_1) \* 255 \* 255 + $(LIBTRACEFS_VERSION_2) \* 255 + $(LIBTRACEFS_VERSION_3))
-    CFLAGS += -DLIBTRACEFS_VERSION=$(LIBTRACEFS_VERSION_CPP)
-  else
-    dummy := $(error Error: No libtracefs devel library found, please install libtracefs-dev);
-  endif
+# libtraceevent is a required dependency picked up from the system.
+$(call feature_check,libtraceevent)
+ifeq ($(feature-libtraceevent), 1)
+  EXTLIBS += -ltraceevent
+  LIBTRACEEVENT_VERSION := $(shell $(PKG_CONFIG) --modversion libtraceevent)
+  LIBTRACEEVENT_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
+  LIBTRACEEVENT_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
+  LIBTRACEEVENT_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
+  LIBTRACEEVENT_VERSION_CPP := $(shell expr $(LIBTRACEEVENT_VERSION_1) \* 255 \* 255 + $(LIBTRACEEVENT_VERSION_2) \* 255 + $(LIBTRACEEVENT_VERSION_3))
+  CFLAGS += -DLIBTRACEEVENT_VERSION=$(LIBTRACEEVENT_VERSION_CPP)
+else
+  dummy := $(error Error: libtraceevent is missing, please install libtraceevent-dev)
+endif
+
+$(call feature_check,libtracefs)
+ifeq ($(feature-libtracefs), 1)
+  EXTLIBS += -ltracefs
+  LIBTRACEFS_VERSION := $(shell $(PKG_CONFIG) --modversion libtracefs)
+  LIBTRACEFS_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEFS_VERSION)))
+  LIBTRACEFS_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEFS_VERSION)))
+  LIBTRACEFS_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEFS_VERSION)))
+  LIBTRACEFS_VERSION_CPP := $(shell expr $(LIBTRACEFS_VERSION_1) \* 255 \* 255 + $(LIBTRACEFS_VERSION_2) \* 255 + $(LIBTRACEFS_VERSION_3))
+  CFLAGS += -DLIBTRACEFS_VERSION=$(LIBTRACEFS_VERSION_CPP)
 endif
 
 # Among the variables below, these:
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 59c4e8f9b014..2e5617b64046 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -128,10 +128,6 @@ include ../scripts/utilities.mak
 #
 # Define BUILD_BPF_SKEL to enable BPF skeletons
 #
-# Define LIBTRACEEVENT_DYNAMIC to enable libtraceevent dynamic linking
-#
-# Define LIBTRACEFS_DYNAMIC to enable libtracefs dynamic linking
-#
 
 # As per kernel Makefile, avoid funny character set dependencies
 unexport LC_ALL
@@ -242,10 +238,6 @@ sub-make: fixdep
 else # force_fixdep
 
 LIBAPI_DIR      = $(srctree)/tools/lib/api/
-ifndef LIBTRACEEVENT_DYNAMIC
-LIBTRACEEVENT_DIR = $(srctree)/tools/lib/traceevent/
-LIBTRACEEVENT_PLUGINS_DIR = $(LIBTRACEEVENT_DIR)/plugins
-endif
 LIBBPF_DIR      = $(srctree)/tools/lib/bpf/
 LIBSUBCMD_DIR   = $(srctree)/tools/lib/subcmd/
 LIBSYMBOL_DIR   = $(srctree)/tools/lib/symbol/
@@ -295,31 +287,6 @@ SCRIPT_SH += perf-iostat.sh
 grep-libs = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
 
-ifndef LIBTRACEEVENT_DYNAMIC
-ifneq ($(OUTPUT),)
-  LIBTRACEEVENT_OUTPUT = $(abspath $(OUTPUT))/libtraceevent
-else
-  LIBTRACEEVENT_OUTPUT = $(CURDIR)/libtraceevent
-endif
-LIBTRACEEVENT_PLUGINS_OUTPUT = $(LIBTRACEEVENT_OUTPUT)_plugins
-LIBTRACEEVENT_DESTDIR = $(LIBTRACEEVENT_OUTPUT)
-LIBTRACEEVENT_PLUGINS_DESTDIR = $(LIBTRACEEVENT_PLUGINS_OUTPUT)
-LIBTRACEEVENT_INCLUDE = $(LIBTRACEEVENT_DESTDIR)/include
-LIBTRACEEVENT = $(LIBTRACEEVENT_OUTPUT)/libtraceevent.a
-export LIBTRACEEVENT
-LIBTRACEEVENT_DYNAMIC_LIST = $(LIBTRACEEVENT_PLUGINS_OUTPUT)/libtraceevent-dynamic-list
-CFLAGS += -I$(LIBTRACEEVENT_OUTPUT)/include
-#
-# The static build has no dynsym table, so this does not work for
-# static build. Looks like linker starts to scream about that now
-# (in Fedora 26) so we need to switch it off for static build.
-DYNAMIC_LIST_LDFLAGS               = -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST)
-LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS = $(if $(findstring -static,$(LDFLAGS)),,$(DYNAMIC_LIST_LDFLAGS))
-else
-LIBTRACEEVENT_DYNAMIC_LIST =
-LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS =
-endif
-
 ifneq ($(OUTPUT),)
   LIBAPI_OUTPUT = $(abspath $(OUTPUT))/libapi
 else
@@ -381,11 +348,7 @@ export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
 python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so
 
 PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
-ifndef LIBTRACEEVENT_DYNAMIC
-PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPI)
-else
 PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBAPI)
-endif
 
 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
 
@@ -430,9 +393,6 @@ ifndef NO_LIBBPF
     PERFLIBS += $(LIBBPF)
   endif
 endif
-ifndef LIBTRACEEVENT_DYNAMIC
-  PERFLIBS += $(LIBTRACEEVENT)
-endif
 
 # We choose to avoid "if .. else if .. else .. endif endif"
 # because maintaining the nesting to match is a pain.  If
@@ -682,9 +642,9 @@ all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
 # Create python binding output directory if not already present
 _dummy := $(shell [ -d '$(OUTPUT)python' ] || mkdir -p '$(OUTPUT)python')
 
-$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST) $(LIBPERF)
+$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBPERF)
 	$(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \
-        CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS)' \
+        CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \
 	  $(PYTHON_WORD) util/setup.py \
 	  --quiet build_ext; \
 	cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/
@@ -710,8 +670,8 @@ $(PERF_IN): prepare FORCE
 $(PMU_EVENTS_IN): FORCE prepare
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events
 
-$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
-	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
+$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN)
+	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) \
 		$(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
 
 $(GTK_IN): FORCE
@@ -797,10 +757,6 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc
 	$(LIBSYMBOL) \
 	bpf-skel
 
-ifndef LIBTRACEEVENT_DYNAMIC
-prepare: $(LIBTRACEEVENT)
-endif
-
 $(OUTPUT)%.o: %.c prepare FORCE
 	$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
 
@@ -856,38 +812,6 @@ endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
 
-ifndef LIBTRACEEVENT_DYNAMIC
-LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(filter-out -static,$(LDFLAGS))'
-
-$(LIBTRACEEVENT): FORCE | $(LIBTRACEEVENT_OUTPUT)
-	$(Q)$(MAKE) -C $(LIBTRACEEVENT_DIR) O=$(LIBTRACEEVENT_OUTPUT) \
-		DESTDIR=$(LIBTRACEEVENT_DESTDIR) prefix= \
-		$@ install_headers
-
-$(LIBTRACEEVENT)-clean:
-	$(call QUIET_CLEAN, libtraceevent)
-	$(Q)$(RM) -r -- $(LIBTRACEEVENT_OUTPUT)
-
-libtraceevent_plugins: FORCE | $(LIBTRACEEVENT_PLUGINS_OUTPUT)
-	$(Q)$(MAKE) -C $(LIBTRACEEVENT_PLUGINS_DIR) O=$(LIBTRACEEVENT_PLUGINS_OUTPUT) \
-		DESTDIR=$(LIBTRACEEVENT_PLUGINS_DESTDIR) prefix= \
-		plugins
-
-libtraceevent_plugins-clean:
-	$(call QUIET_CLEAN, libtraceevent_plugins)
-	$(Q)$(RM) -r -- $(LIBTRACEEVENT_PLUGINS_OUTPUT)
-
-$(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins
-	$(Q)$(MAKE) -C $(LIBTRACEEVENT_PLUGINS_DIR) O=$(LIBTRACEEVENT_PLUGINS_OUTPUT) \
-		DESTDIR=$(LIBTRACEEVENT_PLUGINS_DESTDIR) prefix= \
-		$(LIBTRACEEVENT_FLAGS) $@
-
-install-traceevent-plugins: libtraceevent_plugins
-	$(Q)$(MAKE) -C $(LIBTRACEEVENT_PLUGINS_DIR) O=$(LIBTRACEEVENT_PLUGINS_OUTPUT) \
-		DESTDIR=$(LIBTRACEEVENT_PLUGINS_DESTDIR) prefix= \
-		$(LIBTRACEEVENT_FLAGS) install
-endif
-
 $(LIBAPI): FORCE | $(LIBAPI_OUTPUT)
 	$(Q)$(MAKE) -C $(LIBAPI_DIR) O=$(LIBAPI_OUTPUT) \
 		DESTDIR=$(LIBAPI_DESTDIR) prefix= \
@@ -1120,11 +1044,6 @@ SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h
 $(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_OUTPUT) $(LIBSYMBOL_OUTPUT):
 	$(Q)$(MKDIR) -p $@
 
-ifndef LIBTRACEEVENT_DYNAMIC
-$(LIBTRACEEVENT_OUTPUT) $(LIBTRACEEVENT_PLUGINS_OUTPUT):
-	$(Q)$(MKDIR) -p $@
-endif
-
 ifdef BUILD_BPF_SKEL
 BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool
 BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE)
@@ -1207,10 +1126,6 @@ clean:: $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBSYMBOL)-clean $(
 	$(call QUIET_CLEAN, Documentation) \
 	$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) clean >/dev/null
 
-ifndef LIBTRACEEVENT_DYNAMIC
-clean:: $(LIBTRACEEVENT)-clean libtraceevent_plugins-clean
-endif
-
 #
 # To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY)
 # file if defined, with no further action.
@@ -1228,6 +1143,6 @@ FORCE:
 .PHONY: all install clean config-clean strip install-gtk
 .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
 .PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope FORCE prepare
-.PHONY: libtraceevent_plugins archheaders
+.PHONY: archheaders
 
 endif # force_fixdep
-- 
2.38.1.584.g0f3c55d4c2-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 2/2] tools lib traceevent: Remove libtraceevent
       [not found] ` <20221117224952.358639-3-irogers@google.com>
@ 2022-11-17 23:16   ` Steven Rostedt
  0 siblings, 0 replies; 8+ messages in thread
From: Steven Rostedt @ 2022-11-17 23:16 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Masami Hiramatsu, linux-kernel, linux-perf-users, Steven Rostedt,
	Adrian Hunter, Linux Trace Devel, Stephane Eranian

On Thu, 17 Nov 2022 14:49:52 -0800
Ian Rogers <irogers@google.com> wrote:

> libtraceevent is now out-of-date and it is better to depend on the
> system version. Remove this code that is no longer depended upon by
> any builds.
> 

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve

> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/lib/traceevent/.gitignore               |    4 -
>  tools/lib/traceevent/Build                    |    8 -
>  tools/lib/traceevent/Documentation/Makefile   |  207 -
>  .../traceevent/Documentation/asciidoc.conf    |  120 -
>  .../Documentation/libtraceevent-commands.txt  |  153 -
>  .../Documentation/libtraceevent-cpus.txt      |   77 -
>  .../libtraceevent-endian_read.txt             |   78 -
>  .../libtraceevent-event_find.txt              |  103 -
>  .../Documentation/libtraceevent-event_get.txt |   99 -
>  .../libtraceevent-event_list.txt              |  122 -
>  .../libtraceevent-event_print.txt             |  130 -
>  .../libtraceevent-field_find.txt              |  118 -
>  .../libtraceevent-field_get_val.txt           |  122 -
>  .../libtraceevent-field_print.txt             |  126 -
>  .../libtraceevent-field_read.txt              |   81 -
>  .../Documentation/libtraceevent-fields.txt    |  105 -
>  .../libtraceevent-file_endian.txt             |   91 -
>  .../Documentation/libtraceevent-filter.txt    |  209 -
>  .../Documentation/libtraceevent-func_apis.txt |  183 -
>  .../Documentation/libtraceevent-func_find.txt |   88 -
>  .../Documentation/libtraceevent-handle.txt    |  101 -
>  .../libtraceevent-header_page.txt             |  102 -
>  .../libtraceevent-host_endian.txt             |  104 -
>  .../Documentation/libtraceevent-long_size.txt |   78 -
>  .../Documentation/libtraceevent-page_size.txt |   82 -
>  .../libtraceevent-parse_event.txt             |   90 -
>  .../libtraceevent-parse_head.txt              |   82 -
>  .../Documentation/libtraceevent-plugins.txt   |  122 -
>  .../libtraceevent-record_parse.txt            |  137 -
>  .../libtraceevent-reg_event_handler.txt       |  156 -
>  .../libtraceevent-reg_print_func.txt          |  155 -
>  .../Documentation/libtraceevent-set_flag.txt  |  104 -
>  .../Documentation/libtraceevent-strerror.txt  |   85 -
>  .../Documentation/libtraceevent-tseq.txt      |  158 -
>  .../Documentation/libtraceevent.txt           |  192 -
>  .../traceevent/Documentation/manpage-1.72.xsl |   14 -
>  .../traceevent/Documentation/manpage-base.xsl |   35 -
>  .../Documentation/manpage-bold-literal.xsl    |   17 -
>  .../Documentation/manpage-normal.xsl          |   13 -
>  .../Documentation/manpage-suppress-sp.xsl     |   21 -
>  tools/lib/traceevent/Makefile                 |  300 -
>  tools/lib/traceevent/event-parse-api.c        |  333 -
>  tools/lib/traceevent/event-parse-local.h      |  123 -
>  tools/lib/traceevent/event-parse.c            | 7624 -----------------
>  tools/lib/traceevent/event-parse.h            |  750 --
>  tools/lib/traceevent/event-plugin.c           |  711 --
>  tools/lib/traceevent/event-utils.h            |   67 -
>  tools/lib/traceevent/kbuffer-parse.c          |  809 --
>  tools/lib/traceevent/kbuffer.h                |   68 -
>  .../lib/traceevent/libtraceevent.pc.template  |   10 -
>  tools/lib/traceevent/parse-filter.c           | 2281 -----
>  tools/lib/traceevent/parse-utils.c            |   71 -
>  tools/lib/traceevent/plugins/Build            |   12 -
>  tools/lib/traceevent/plugins/Makefile         |  225 -
>  .../lib/traceevent/plugins/plugin_cfg80211.c  |   43 -
>  .../lib/traceevent/plugins/plugin_function.c  |  282 -
>  tools/lib/traceevent/plugins/plugin_futex.c   |  123 -
>  tools/lib/traceevent/plugins/plugin_hrtimer.c |   74 -
>  tools/lib/traceevent/plugins/plugin_jbd2.c    |   61 -
>  tools/lib/traceevent/plugins/plugin_kmem.c    |   80 -
>  tools/lib/traceevent/plugins/plugin_kvm.c     |  527 --
>  .../lib/traceevent/plugins/plugin_mac80211.c  |   88 -
>  .../traceevent/plugins/plugin_sched_switch.c  |  146 -
>  tools/lib/traceevent/plugins/plugin_scsi.c    |  434 -
>  tools/lib/traceevent/plugins/plugin_tlb.c     |   66 -
>  tools/lib/traceevent/plugins/plugin_xen.c     |  138 -
>  tools/lib/traceevent/tep_strerror.c           |   53 -
>  tools/lib/traceevent/trace-seq.c              |  249 -
>  tools/lib/traceevent/trace-seq.h              |   55 -
>  69 files changed, 19875 deletions(-)
>  delete mode 100644 tools/lib/traceevent/.gitignore
>  delete mode 100644 tools/lib/traceevent/Build
>  delete mode 100644 tools/lib/traceevent/Documentation/Makefile
>  delete mode 100644 tools/lib/traceevent/Documentation/asciidoc.conf
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-commands.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_get.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_list.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_find.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_print.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_read.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-fields.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_find.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-handle.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_page.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-long_size.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent.txt
>  delete mode 100644 tools/lib/traceevent/Documentation/manpage-1.72.xsl
>  delete mode 100644 tools/lib/traceevent/Documentation/manpage-base.xsl
>  delete mode 100644 tools/lib/traceevent/Documentation/manpage-bold-literal.xsl
>  delete mode 100644 tools/lib/traceevent/Documentation/manpage-normal.xsl
>  delete mode 100644 tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl
>  delete mode 100644 tools/lib/traceevent/Makefile
>  delete mode 100644 tools/lib/traceevent/event-parse-api.c
>  delete mode 100644 tools/lib/traceevent/event-parse-local.h
>  delete mode 100644 tools/lib/traceevent/event-parse.c
>  delete mode 100644 tools/lib/traceevent/event-parse.h
>  delete mode 100644 tools/lib/traceevent/event-plugin.c
>  delete mode 100644 tools/lib/traceevent/event-utils.h
>  delete mode 100644 tools/lib/traceevent/kbuffer-parse.c
>  delete mode 100644 tools/lib/traceevent/kbuffer.h
>  delete mode 100644 tools/lib/traceevent/libtraceevent.pc.template
>  delete mode 100644 tools/lib/traceevent/parse-filter.c
>  delete mode 100644 tools/lib/traceevent/parse-utils.c
>  delete mode 100644 tools/lib/traceevent/plugins/Build
>  delete mode 100644 tools/lib/traceevent/plugins/Makefile
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_cfg80211.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_function.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_futex.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_hrtimer.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_jbd2.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_kmem.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_kvm.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_mac80211.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_sched_switch.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_scsi.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_tlb.c
>  delete mode 100644 tools/lib/traceevent/plugins/plugin_xen.c
>  delete mode 100644 tools/lib/traceevent/tep_strerror.c
>  delete mode 100644 tools/lib/traceevent/trace-seq.c
>  delete mode 100644 tools/lib/traceevent/trace-seq.h


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] perf build: Require libtraceevent from the system
  2022-11-17 22:49 ` [PATCH v1 1/2] perf build: Require libtraceevent from the system Ian Rogers
@ 2022-11-18  9:30   ` Peter Zijlstra
  2022-11-18 15:02     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2022-11-18  9:30 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Ingo Molnar, Arnaldo Carvalho de Melo, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Steven Rostedt,
	Masami Hiramatsu, linux-kernel, linux-perf-users, Steven Rostedt,
	Adrian Hunter, Linux Trace Devel, Stephane Eranian

On Thu, Nov 17, 2022 at 02:49:51PM -0800, Ian Rogers wrote:
> Unconditionally require libtraceevent to come from the system. Force
> the determination of the libtracefs version if it is present.

-ENOMOTIVATION

also:

Makefile.config:1196: *** Error: libtraceevent is missing, please install libtraceevent-dev.  Stop.

Why do I need this?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] perf build: Require libtraceevent from the system
  2022-11-18  9:30   ` Peter Zijlstra
@ 2022-11-18 15:02     ` Arnaldo Carvalho de Melo
  2022-11-18 15:33       ` Steven Rostedt
  0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-11-18 15:02 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ian Rogers, Ingo Molnar, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, Steven Rostedt, Masami Hiramatsu,
	linux-kernel, linux-perf-users, Steven Rostedt, Adrian Hunter,
	Linux Trace Devel, Stephane Eranian

Em Fri, Nov 18, 2022 at 10:30:45AM +0100, Peter Zijlstra escreveu:
> On Thu, Nov 17, 2022 at 02:49:51PM -0800, Ian Rogers wrote:
> > Unconditionally require libtraceevent to come from the system. Force
> > the determination of the libtracefs version if it is present.
> 
> -ENOMOTIVATION

Yeah, I was going to ask for that as well :-\

And the motivation was spelled out in the discussion that led to this
patch:

https://lore.kernel.org/lkml/CAP-5=fWxAjEia-Qbm0RVzKOxyiod8rUOBieqaGK=DtQboDe3Qw@mail.gmail.com
 
> also:
> 
> Makefile.config:1196: *** Error: libtraceevent is missing, please install libtraceevent-dev.  Stop.

yeah, this probably should work like with other libraries, don't stop
the build, just don't build features that depend on libtraceevent,
warning the user that features foo, bar and baz won't be available.

For people working with just hardware, software, cache events, no
problem.

- Arnaldo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] perf build: Require libtraceevent from the system
  2022-11-18 15:02     ` Arnaldo Carvalho de Melo
@ 2022-11-18 15:33       ` Steven Rostedt
  2022-11-18 16:34         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Steven Rostedt @ 2022-11-18 15:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ian Rogers, Ingo Molnar, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Masami Hiramatsu,
	linux-kernel, linux-perf-users, Steven Rostedt, Adrian Hunter,
	Linux Trace Devel, Stephane Eranian

On Fri, 18 Nov 2022 12:02:38 -0300
Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> yeah, this probably should work like with other libraries, don't stop
> the build, just don't build features that depend on libtraceevent,
> warning the user that features foo, bar and baz won't be available.
> 
> For people working with just hardware, software, cache events, no
> problem.

How are software events parsed?

-- Steve

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] perf build: Require libtraceevent from the system
  2022-11-18 15:33       ` Steven Rostedt
@ 2022-11-18 16:34         ` Arnaldo Carvalho de Melo
  2022-11-19  0:37           ` Namhyung Kim
  0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-11-18 16:34 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Peter Zijlstra, Ian Rogers, Ingo Molnar, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Masami Hiramatsu,
	linux-kernel, linux-perf-users, Steven Rostedt, Adrian Hunter,
	Linux Trace Devel, Stephane Eranian

Em Fri, Nov 18, 2022 at 10:33:02AM -0500, Steven Rostedt escreveu:
> On Fri, 18 Nov 2022 12:02:38 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
 
> > yeah, this probably should work like with other libraries, don't stop
> > the build, just don't build features that depend on libtraceevent,
> > warning the user that features foo, bar and baz won't be available.

> > For people working with just hardware, software, cache events, no
> > problem.
 
> How are software events parsed?

Not parsed, fixed:

root@roc-rk3399-pc:~# perf list sw

List of pre-defined events (to be used in -e or -M):

  alignment-faults                                   [Software event]
  bpf-output                                         [Software event]
  cgroup-switches                                    [Software event]
  context-switches OR cs                             [Software event]
  cpu-clock                                          [Software event]
  cpu-migrations OR migrations                       [Software event]
  dummy                                              [Software event]
  emulation-faults                                   [Software event]
  major-faults                                       [Software event]
  minor-faults                                       [Software event]
  page-faults OR faults                              [Software event]
  task-clock                                         [Software event]

  duration_time                                      [Tool event]
  user_time                                          [Tool event]
  system_time                                        [Tool event]

root@roc-rk3399-pc:~#


In addition to:

root@roc-rk3399-pc:~# perf list hw

List of pre-defined events (to be used in -e or -M):

  branch-instructions OR branches                    [Hardware event]
  branch-misses                                      [Hardware event]
  bus-cycles                                         [Hardware event]
  cache-misses                                       [Hardware event]
  cache-references                                   [Hardware event]
  cpu-cycles OR cycles                               [Hardware event]
  instructions                                       [Hardware event]

root@roc-rk3399-pc:~#

And:

root@roc-rk3399-pc:~# perf list cache

List of pre-defined events (to be used in -e or -M):

  L1-dcache-load-misses                              [Hardware cache event]
  L1-dcache-loads                                    [Hardware cache event]
  L1-dcache-prefetch-misses                          [Hardware cache event]
  L1-dcache-store-misses                             [Hardware cache event]
  L1-dcache-stores                                   [Hardware cache event]
  L1-icache-load-misses                              [Hardware cache event]
  L1-icache-loads                                    [Hardware cache event]
  branch-load-misses                                 [Hardware cache event]
  branch-loads                                       [Hardware cache event]
  dTLB-load-misses                                   [Hardware cache event]
  dTLB-store-misses                                  [Hardware cache event]
  iTLB-load-misses                                   [Hardware cache event]
  node-loads                                         [Hardware cache event]
  node-stores                                        [Hardware cache event]

root@roc-rk3399-pc:~#

Without something like libtraceevent 'perf probe', 'perf trace' wouldn't
work as of now, as it currently use libtraceevent to parse whats in
tracefs.

So for some people, just interested in profiling the above hw, sw and
cache events, libtraceevent isn't strictly required and may even be
desirable to reduce the number of library dependencies.

So its a valid feature to allow perf to be built without libtraceevent,
i.e. not something needed for the above scenarios.

With libbpf and BTF tracefs isn't also strictly needed, as we already
have to link with it and things like 'perf trace' want to use libbpf's
btf pretty printing stuff, we can use BTF to enumerate events, iterate
thru its fields, offsets, types, etc:

root@roc-rk3399-pc:~# pahole --sizes | grep trace_event_raw_sched
trace_event_raw_sched_kthread_stop	28	0
trace_event_raw_sched_kthread_stop_ret	12	0
trace_event_raw_sched_kthread_work_queue_work	32	0
trace_event_raw_sched_kthread_work_execute_start	24	0
trace_event_raw_sched_kthread_work_execute_end	24	0
trace_event_raw_sched_wakeup_template	36	0
trace_event_raw_sched_switch	64	0
trace_event_raw_sched_migrate_task	40	0
trace_event_raw_sched_process_template	32	0
trace_event_raw_sched_process_wait	32	0
trace_event_raw_sched_process_fork	48	0
trace_event_raw_sched_process_exec	20	0
trace_event_raw_sched_stat_runtime	48	1
trace_event_raw_sched_pi_setprio	36	0
trace_event_raw_sched_move_numa	36	0
trace_event_raw_sched_numa_pair_template	48	0
trace_event_raw_sched_wake_idle_without_ipi	12	0
root@roc-rk3399-pc:~#

root@roc-rk3399-pc:~# pahole trace_event_raw_sched_switch
struct trace_event_raw_sched_switch {
	struct trace_entry         ent;                  /*     0     8 */
	char                       prev_comm[16];        /*     8    16 */
	pid_t                      prev_pid;             /*    24     4 */
	int                        prev_prio;            /*    28     4 */
	long int                   prev_state;           /*    32     8 */
	char                       next_comm[16];        /*    40    16 */
	pid_t                      next_pid;             /*    56     4 */
	int                        next_prio;            /*    60     4 */
	/* --- cacheline 1 boundary (64 bytes) --- */
	char                       __data[];             /*    64     0 */

	/* size: 64, cachelines: 1, members: 9 */
};
root@roc-rk3399-pc:~#

- Arnaldo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 1/2] perf build: Require libtraceevent from the system
  2022-11-18 16:34         ` Arnaldo Carvalho de Melo
@ 2022-11-19  0:37           ` Namhyung Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Namhyung Kim @ 2022-11-19  0:37 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Steven Rostedt, Peter Zijlstra, Ian Rogers, Ingo Molnar,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Masami Hiramatsu,
	linux-kernel, linux-perf-users, Steven Rostedt, Adrian Hunter,
	Linux Trace Devel, Stephane Eranian

Hi,

On Fri, Nov 18, 2022 at 8:34 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Em Fri, Nov 18, 2022 at 10:33:02AM -0500, Steven Rostedt escreveu:
> > On Fri, 18 Nov 2022 12:02:38 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> > > yeah, this probably should work like with other libraries, don't stop
> > > the build, just don't build features that depend on libtraceevent,
> > > warning the user that features foo, bar and baz won't be available.
>
> > > For people working with just hardware, software, cache events, no
> > > problem.
>
> > How are software events parsed?
>
> Not parsed, fixed:

I believe Steve meant tracepoints :)

>
> root@roc-rk3399-pc:~# perf list sw
>
> List of pre-defined events (to be used in -e or -M):
>
>   alignment-faults                                   [Software event]
>   bpf-output                                         [Software event]
>   cgroup-switches                                    [Software event]
>   context-switches OR cs                             [Software event]
>   cpu-clock                                          [Software event]
>   cpu-migrations OR migrations                       [Software event]
>   dummy                                              [Software event]
>   emulation-faults                                   [Software event]
>   major-faults                                       [Software event]
>   minor-faults                                       [Software event]
>   page-faults OR faults                              [Software event]
>   task-clock                                         [Software event]
>
>   duration_time                                      [Tool event]
>   user_time                                          [Tool event]
>   system_time                                        [Tool event]
>
> root@roc-rk3399-pc:~#
>
>
> In addition to:
>
> root@roc-rk3399-pc:~# perf list hw
>
> List of pre-defined events (to be used in -e or -M):
>
>   branch-instructions OR branches                    [Hardware event]
>   branch-misses                                      [Hardware event]
>   bus-cycles                                         [Hardware event]
>   cache-misses                                       [Hardware event]
>   cache-references                                   [Hardware event]
>   cpu-cycles OR cycles                               [Hardware event]
>   instructions                                       [Hardware event]
>
> root@roc-rk3399-pc:~#
>
> And:
>
> root@roc-rk3399-pc:~# perf list cache
>
> List of pre-defined events (to be used in -e or -M):
>
>   L1-dcache-load-misses                              [Hardware cache event]
>   L1-dcache-loads                                    [Hardware cache event]
>   L1-dcache-prefetch-misses                          [Hardware cache event]
>   L1-dcache-store-misses                             [Hardware cache event]
>   L1-dcache-stores                                   [Hardware cache event]
>   L1-icache-load-misses                              [Hardware cache event]
>   L1-icache-loads                                    [Hardware cache event]
>   branch-load-misses                                 [Hardware cache event]
>   branch-loads                                       [Hardware cache event]
>   dTLB-load-misses                                   [Hardware cache event]
>   dTLB-store-misses                                  [Hardware cache event]
>   iTLB-load-misses                                   [Hardware cache event]
>   node-loads                                         [Hardware cache event]
>   node-stores                                        [Hardware cache event]
>
> root@roc-rk3399-pc:~#
>
> Without something like libtraceevent 'perf probe', 'perf trace' wouldn't
> work as of now, as it currently use libtraceevent to parse whats in
> tracefs.

Right, many other tools would be impacted like 'perf lock', 'perf sched', ...

>
> So for some people, just interested in profiling the above hw, sw and
> cache events, libtraceevent isn't strictly required and may even be
> desirable to reduce the number of library dependencies.
>
> So its a valid feature to allow perf to be built without libtraceevent,
> i.e. not something needed for the above scenarios.

Right, we could remove unsupported commands from the build or
refuse to run them with a warning.

Thanks,
Namhyung

>
> With libbpf and BTF tracefs isn't also strictly needed, as we already
> have to link with it and things like 'perf trace' want to use libbpf's
> btf pretty printing stuff, we can use BTF to enumerate events, iterate
> thru its fields, offsets, types, etc:
>
> root@roc-rk3399-pc:~# pahole --sizes | grep trace_event_raw_sched
> trace_event_raw_sched_kthread_stop      28      0
> trace_event_raw_sched_kthread_stop_ret  12      0
> trace_event_raw_sched_kthread_work_queue_work   32      0
> trace_event_raw_sched_kthread_work_execute_start        24      0
> trace_event_raw_sched_kthread_work_execute_end  24      0
> trace_event_raw_sched_wakeup_template   36      0
> trace_event_raw_sched_switch    64      0
> trace_event_raw_sched_migrate_task      40      0
> trace_event_raw_sched_process_template  32      0
> trace_event_raw_sched_process_wait      32      0
> trace_event_raw_sched_process_fork      48      0
> trace_event_raw_sched_process_exec      20      0
> trace_event_raw_sched_stat_runtime      48      1
> trace_event_raw_sched_pi_setprio        36      0
> trace_event_raw_sched_move_numa 36      0
> trace_event_raw_sched_numa_pair_template        48      0
> trace_event_raw_sched_wake_idle_without_ipi     12      0
> root@roc-rk3399-pc:~#
>
> root@roc-rk3399-pc:~# pahole trace_event_raw_sched_switch
> struct trace_event_raw_sched_switch {
>         struct trace_entry         ent;                  /*     0     8 */
>         char                       prev_comm[16];        /*     8    16 */
>         pid_t                      prev_pid;             /*    24     4 */
>         int                        prev_prio;            /*    28     4 */
>         long int                   prev_state;           /*    32     8 */
>         char                       next_comm[16];        /*    40    16 */
>         pid_t                      next_pid;             /*    56     4 */
>         int                        next_prio;            /*    60     4 */
>         /* --- cacheline 1 boundary (64 bytes) --- */
>         char                       __data[];             /*    64     0 */
>
>         /* size: 64, cachelines: 1, members: 9 */
> };
> root@roc-rk3399-pc:~#
>
> - Arnaldo

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-19  1:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-17 22:49 [PATCH v1 0/2] perf always use system libtraceevent Ian Rogers
2022-11-17 22:49 ` [PATCH v1 1/2] perf build: Require libtraceevent from the system Ian Rogers
2022-11-18  9:30   ` Peter Zijlstra
2022-11-18 15:02     ` Arnaldo Carvalho de Melo
2022-11-18 15:33       ` Steven Rostedt
2022-11-18 16:34         ` Arnaldo Carvalho de Melo
2022-11-19  0:37           ` Namhyung Kim
     [not found] ` <20221117224952.358639-3-irogers@google.com>
2022-11-17 23:16   ` [PATCH v1 2/2] tools lib traceevent: Remove libtraceevent Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).