Skip to contentSkip to conversation

build/libtraceevent resends

PATCH Applied Ian Rogers 2 participants 9 messages Dec 13, 2022 – Dec 14, 2022

Subsystems (2)
lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

cover build/libtraceevent resends

All patches on the acme perf/core branch.

Resend incremental build fix python plugin:
https://lore.kernel.org/lkml/[email protected]/

Break apart and resend libtraceevent debug logging support:
https://lore.kernel.org/linux-perf-users/[email protected]/

Switch "#if HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE" to "#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION", ensuring trace-event.h is included as discussed on the mailing list.

Resend removal of --group option:
https://lore.kernel.org/lkml/[email protected]/

Ian Rogers (5):
perf build: Fix python/perf.so library's name perf trace-event: Add libtraceevent version tools to header
libtraceevent: Increase libtraceevent logging when verbose perf trace-event: Use version check to avoid 1 define perf evlist: Remove group option.

 tools/perf/Documentation/perf-record.txt      |  4 ----
 tools/perf/Documentation/perf-top.txt         |  7 ++----
 tools/perf/Makefile.config                    |  8 +++----
 tools/perf/Makefile.perf                      |  2 +-
 tools/perf/builtin-record.c                   |  2 --
 tools/perf/builtin-stat.c                     |  6 -----
 tools/perf/builtin-top.c                      |  2 --
 tools/perf/builtin-trace.c                    |  2 +-
 tools/perf/tests/attr/README                  |  2 --
 tools/perf/tests/attr/test-record-group       | 22 -------------------
 tools/perf/tests/attr/test-stat-group         | 17 --------------
 tools/perf/util/data-convert-bt.c             |  3 ++-
 tools/perf/util/debug.c                       | 10 +++++++++
 tools/perf/util/evlist.c                      |  2 +-
 tools/perf/util/evlist.h                      |  2 --
 tools/perf/util/evsel.c                       |  2 +-
 tools/perf/util/python.c                      | 10 +--------
 tools/perf/util/record.c                      |  7 ------
 tools/perf/util/record.h                      |  1 -
 .../util/scripting-engines/trace-event-perl.c |  2 +-
 .../scripting-engines/trace-event-python.c    |  2 +-
 tools/perf/util/sort.c                        |  3 ++-
 tools/perf/util/trace-event.h                 | 13 +++++++++++
 23 files changed, 39 insertions(+), 92 deletions(-)
 delete mode 100644 tools/perf/tests/attr/test-record-group
 delete mode 100644 tools/perf/tests/attr/test-stat-group
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
author reviewer
#1 lore raw

PATCH 1/5 perf build: Fix python/perf.so library's name

Since Python 3.3 extensions have a suffix encoding platform and version information. For example, the perf extension was previously perf.so but now maybe perf.cpython-310-x86_64-linux-gnu.so. Compute the extension using Python and then use this in the target name. Doing this avoids the "perf.so" target always being rebuilt.

---
 tools/perf/Makefile.config | 4 +++-
 tools/perf/Makefile.perf   | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
tools/perf/Makefile.config +3 -1
index 52a4dc029111..83ed969b95b4 100644
@@ -871,6 +871,7 @@ define disable-python_code
   NO_LIBPYTHON := 1
 endef
 
+PYTHON_EXTENSION_SUFFIX := '.so'
 ifdef NO_LIBPYTHON
   $(call disable-python,Python support disabled by user)
 else
@@ -889,7 +890,8 @@ else
       else
          LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
          EXTLIBS += $(PYTHON_EMBED_LIBADD)
-         LANG_BINDINGS += $(obj-perf)python/perf.so
+         PYTHON_EXTENSION_SUFFIX := $(shell $(PYTHON) -c 'from importlib import machinery; print(machinery.EXTENSION_SUFFIXES[0])')
+         LANG_BINDINGS += $(obj-perf)python/perf$(PYTHON_EXTENSION_SUFFIX)
          CFLAGS += -DHAVE_LIBPYTHON_SUPPORT
          $(call detected,CONFIG_LIBPYTHON)
       endif
tools/perf/Makefile.perf +1 -1
index 98f629bbd1aa..9b7886ce0674 100644
@@ -647,7 +647,7 @@ 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) $(LIBPERF)
+$(OUTPUT)python/perf$(PYTHON_EXTENSION_SUFFIX): $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBPERF)
 	$(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \
         CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' \
 	  $(PYTHON_WORD) util/setup.py \
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
author reviewer
#2 lore raw

PATCH 2/5 perf trace-event: Add libtraceevent version tools to header

In reply to Ian Rogers

Allow comparisons like:
\#if MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) <= LIBTRACEEVENT_VERSION

Based on previously reverted:
https://lore.kernel.org/linux-perf-users/[email protected]/

---
 tools/perf/util/trace-event.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
tools/perf/util/trace-event.h +13 -0
index add6c5d9531c..1fbf4c3f8809 100644
@@ -6,6 +6,19 @@
 #include <stdio.h>
 #include <linux/types.h>
 
+#ifdef HAVE_LIBTRACEEVENT
+#include <traceevent/event-parse.h>
+#endif
+
+#define MAKE_LIBTRACEEVENT_VERSION(a, b, c) ((a)*255*255+(b)*255+(c))
+#ifndef LIBTRACEEVENT_VERSION
+/*
+ * If LIBTRACEEVENT_VERSION wasn't computed then set to version 1.1.0 that
+ * previously shipped with the Linux kernel tools.
+ */
+#define LIBTRACEEVENT_VERSION MAKE_LIBTRACEEVENT_VERSION(1, 1, 0)
+#endif
+
 struct evlist;
 struct machine;
 struct perf_sample;
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
author reviewer
#3 lore raw

PATCH 3/5 libtraceevent: Increase libtraceevent logging when verbose

In reply to Ian Rogers

libtraceevent has added more levels of debug printout and with changes like:
https://lore.kernel.org/linux-trace-devel/[email protected]
previously generated output like "registering plugin" is no longer displayed. This change makes it so that if perf's verbose debug output is enabled then the debug and info libtraceevent messages can be displayed.
The code is conditionally enabled based on the libtraceevent version as discussed in the RFC:
https://lore.kernel.org/lkml/[email protected]/

Based on previously reverted change:
https://lore.kernel.org/linux-perf-users/[email protected]/
that was reverted due to -Itools/lib being in CFLAGS meaning the traceevent headers couldn't be properly used from the system.

---
 tools/perf/util/debug.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/perf/util/debug.c +10 -0
index 65e6c22f38e4..cd575460818f 100644
@@ -22,6 +22,7 @@
 #include "ui/helpline.h"
 #include "ui/ui.h"
 #include "util/parse-sublevel-options.h"
+#include "util/trace-event.h"
 
 #include <linux/ctype.h>
 
@@ -228,6 +229,15 @@ int perf_debug_option(const char *str)
 	/* Allow only verbose value in range (0, 10), otherwise set 0. */
 	verbose = (verbose < 0) || (verbose > 10) ? 0 : verbose;
 
+#if MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) <= LIBTRACEEVENT_VERSION
+	if (verbose == 1)
+		tep_set_loglevel(TEP_LOG_INFO);
+	else if (verbose == 2)
+		tep_set_loglevel(TEP_LOG_DEBUG);
+	else if (verbose >= 3)
+		tep_set_loglevel(TEP_LOG_ALL);
+#endif
+
 	return 0;
 }
 
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
author reviewer
#4 lore raw

PATCH 4/5 perf trace-event: Use version check to avoid 1 define

In reply to Ian Rogers

Remove HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE by using a version check against 1.5.0.

---
 tools/perf/Makefile.config                             | 4 ----
 tools/perf/builtin-trace.c                             | 2 +-
 tools/perf/util/data-convert-bt.c                      | 3 ++-
 tools/perf/util/evsel.c                                | 2 +-
 tools/perf/util/python.c                               | 2 +-
 tools/perf/util/scripting-engines/trace-event-perl.c   | 2 +-
 tools/perf/util/scripting-engines/trace-event-python.c | 2 +-
 tools/perf/util/sort.c                                 | 3 ++-
 8 files changed, 9 insertions(+), 11 deletions(-)
tools/perf/Makefile.config +0 -4
index 83ed969b95b4..9a71d8659efc 100644
@@ -1199,10 +1199,6 @@ ifneq ($(NO_LIBTRACEEVENT),1)
     LIBTRACEEVENT_VERSION_CPP := $(shell expr $(LIBTRACEEVENT_VERSION_1) \* 255 \* 255 + $(LIBTRACEEVENT_VERSION_2) \* 255 + $(LIBTRACEEVENT_VERSION_3))
     CFLAGS += -DLIBTRACEEVENT_VERSION=$(LIBTRACEEVENT_VERSION_CPP)
     $(call detected,CONFIG_LIBTRACEEVENT)
-    LIBTRACEEVENT_VERSION_WITH_TEP_FIELD_IS_RELATIVE := $(shell expr 1 \* 255 \* 255 + 5 \* 255 + 0) # 1.5.0
-    ifeq ($(shell test $(LIBTRACEEVENT_VERSION_CPP) -gt $(LIBTRACEEVENT_VERSION_WITH_TEP_FIELD_IS_RELATIVE); echo $$?),0)
-      CFLAGS += -DHAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
-    endif
   else
     dummy := $(warning Warning: libtraceevent is missing limiting functionality, please install libtraceevent-dev/libtraceevent-devel)
   endif
tools/perf/builtin-trace.c +1 -1
index c9802ab549d7..2c8a213e0bc3 100644
@@ -2729,7 +2729,7 @@ static size_t trace__fprintf_tp_fields(struct trace *trace, struct evsel *evsel,
 				offset = format_field__intval(field, sample, evsel->needs_swap);
 				syscall_arg.len = offset >> 16;
 				offset &= 0xffff;
-#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
+#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION
 				if (field->flags & TEP_FIELD_IS_RELATIVE)
 					offset += field->offset + field->size;
 #endif
tools/perf/util/data-convert-bt.c +2 -1
index b842273458b8..7ec0d13fb470 100644
@@ -36,6 +36,7 @@
 #include "util/sample.h"
 
 #ifdef HAVE_LIBTRACEEVENT
+#include "util/trace-event.h"
 #include <traceevent/event-parse.h>
 #endif
 
@@ -322,7 +323,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,
 		offset = tmp_val;
 		len = offset >> 16;
 		offset &= 0xffff;
-#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
+#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION
 		if (flags & TEP_FIELD_IS_RELATIVE)
 			offset += fmtf->offset + fmtf->size;
 #endif
tools/perf/util/evsel.c +1 -1
index 77b2cf5a214e..6e623d5541e9 100644
@@ -2784,7 +2784,7 @@ void *evsel__rawptr(struct evsel *evsel, struct perf_sample *sample, const char
 	if (field->flags & TEP_FIELD_IS_DYNAMIC) {
 		offset = *(int *)(sample->raw_data + field->offset);
 		offset &= 0xffff;
-#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
+#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION
 		if (field->flags & TEP_FIELD_IS_RELATIVE)
 			offset += field->offset + field->size;
 #endif
tools/perf/util/python.c +1 -1
index 7320f7f777fe..1d0cf72506a6 100644
@@ -442,7 +442,7 @@ tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field)
 			offset  = val;
 			len     = offset >> 16;
 			offset &= 0xffff;
-#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
+#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION
 			if (field->flags & TEP_FIELD_IS_RELATIVE)
 				offset += field->offset + field->size;
 #endif
tools/perf/util/scripting-engines/trace-event-perl.c +1 -1
index c097b7934fd4..1062629d13c2 100644
@@ -393,7 +393,7 @@ static void perl_process_tracepoint(struct perf_sample *sample,
 			if (field->flags & TEP_FIELD_IS_DYNAMIC) {
 				offset = *(int *)(data + field->offset);
 				offset &= 0xffff;
-#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
+#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION
 				if (field->flags & TEP_FIELD_IS_RELATIVE)
 					offset += field->offset + field->size;
 #endif
tools/perf/util/scripting-engines/trace-event-python.c +1 -1
index e930f5f1f36d..e294a13c399d 100644
@@ -994,7 +994,7 @@ static void python_process_tracepoint(struct perf_sample *sample,
 				offset  = val;
 				len     = offset >> 16;
 				offset &= 0xffff;
-#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
+#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION
 				if (field->flags & TEP_FIELD_IS_RELATIVE)
 					offset += field->offset + field->size;
 #endif
tools/perf/util/sort.c +2 -1
index 0ecc2cb13792..b929cc5eb8cf 100644
@@ -32,6 +32,7 @@
 #include <linux/string.h>
 
 #ifdef HAVE_LIBTRACEEVENT
+#include "trace-event.h"
 #include <traceevent/event-parse.h>
 #endif
 
@@ -2568,7 +2569,7 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt,
 		tep_read_number_field(field, a->raw_data, &dyn);
 		offset = dyn & 0xffff;
 		size = (dyn >> 16) & 0xffff;
-#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
+#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION
 		if (field->flags & TEP_FIELD_IS_RELATIVE)
 			offset += field->offset + field->size;
 #endif
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
author reviewer
#5 lore raw

PATCH 5/5 perf evlist: Remove group option.

In reply to Ian Rogers

The group option predates grouping events using curly braces added in commit 89efb029502d ("perf tools: Add support to parse event group syntax") The --group option was retained for legacy support (in August 2012) but keeping it adds complexity.

---
 tools/perf/Documentation/perf-record.txt |  4 ----
 tools/perf/Documentation/perf-top.txt    |  7 ++-----
 tools/perf/builtin-record.c              |  2 --
 tools/perf/builtin-stat.c                |  6 ------
 tools/perf/builtin-top.c                 |  2 --
 tools/perf/tests/attr/README             |  2 --
 tools/perf/tests/attr/test-record-group  | 22 ----------------------
 tools/perf/tests/attr/test-stat-group    | 17 -----------------
 tools/perf/util/evlist.c                 |  2 +-
 tools/perf/util/evlist.h                 |  2 --
 tools/perf/util/python.c                 |  8 --------
 tools/perf/util/record.c                 |  7 -------
 tools/perf/util/record.h                 |  1 -
 13 files changed, 3 insertions(+), 79 deletions(-)
 delete mode 100644 tools/perf/tests/attr/test-record-group
 delete mode 100644 tools/perf/tests/attr/test-stat-group
tools/perf/Documentation/perf-record.txt +0 -4
index 5f9fa07b3dde..ff815c2f67e8 100644
@@ -238,10 +238,6 @@ OPTIONS
 	Also, by adding a comma, the number of mmap pages for AUX
 	area tracing can be specified.
 
---group::
-	Put all events in a single event group.  This precedes the --event
-	option and remains only for backward compatibility.  See --event.
-
 -g::
 	Enables call-graph (stack chain/backtrace) recording for both
 	kernel space and user space.
tools/perf/Documentation/perf-top.txt +2 -5
index c1fdba26bf53..e534d709cc5a 100644
@@ -51,9 +51,6 @@ Default is to monitor all CPUS.
 --count-filter=<count>::
 	Only display functions with more events than this.
 
---group::
-        Put the counters into a counter group.
-
 --group-sort-idx::
 	Sort the output by the event at the index n in group. If n is invalid,
 	sort by the first event. It can support multiple groups with different
@@ -313,10 +310,10 @@ use '-e e1 -e e2 -G foo,foo' or just use '-e e1 -e e2 -G foo'.
 
 		perf top -e cycles,probe:icmp_rcv --switch-on=probe:icmp_rcv
 
-	   Alternatively one can ask for --group and then two overhead columns
+	   Alternatively one can ask for a group and then two overhead columns
            will appear, the first for cycles and the second for the switch-on event.
 
-		perf top --group -e cycles,probe:icmp_rcv --switch-on=probe:icmp_rcv
+		perf top -e '{cycles,probe:icmp_rcv}' --switch-on=probe:icmp_rcv
 
 	This may be interesting to measure a workload only after some initialization
 	phase is over, i.e. insert a perf probe at that point and use the above
tools/perf/builtin-record.c +0 -2
index 7e17374f6c1a..8ecffa696ce3 100644
@@ -3380,8 +3380,6 @@ static struct option __record_options[] = {
 	OPT_CALLBACK(0, "mmap-flush", &record.opts, "number",
 		     "Minimal number of bytes that is extracted from mmap data pages (default: 1)",
 		     record__mmap_flush_parse),
-	OPT_BOOLEAN(0, "group", &record.opts.group,
-		    "put the counters into a counter group"),
 	OPT_CALLBACK_NOOPT('g', NULL, &callchain_param,
 			   NULL, "enables call-graph recording" ,
 			   &record_callchain_opt),
tools/perf/builtin-stat.c +0 -6
index d040fbcdcc5a..2808f2aa9a82 100644
@@ -181,7 +181,6 @@ static bool			topdown_run			= false;
 static bool			smi_cost			= false;
 static bool			smi_reset			= false;
 static int			big_num_opt			=  -1;
-static bool			group				= false;
 static const char		*pre_cmd			= NULL;
 static const char		*post_cmd			= NULL;
 static bool			sync_run			= false;
@@ -781,9 +780,6 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
 		child_pid = evsel_list->workload.pid;
 	}
 
-	if (group)
-		evlist__set_leader(evsel_list);
-
 	if (!cpu_map__is_dummy(evsel_list->core.user_requested_cpus)) {
 		if (affinity__setup(&saved_affinity) < 0)
 			return -1;
@@ -1192,8 +1188,6 @@ static struct option stat_options[] = {
 #endif
 	OPT_BOOLEAN('a', "all-cpus", &target.system_wide,
 		    "system-wide collection from all CPUs"),
-	OPT_BOOLEAN('g', "group", &group,
-		    "put the counters into a counter group"),
 	OPT_BOOLEAN(0, "scale", &stat_config.scale,
 		    "Use --no-scale to disable counter scaling for multiplexing"),
 	OPT_INCR('v', "verbose", &verbose,
tools/perf/builtin-top.c +0 -2
index bb5bd241246b..d4b5b02bab73 100644
@@ -1471,8 +1471,6 @@ int cmd_top(int argc, const char **argv)
 			    "dump the symbol table used for profiling"),
 	OPT_INTEGER('f', "count-filter", &top.count_filter,
 		    "only display functions with more events than this"),
-	OPT_BOOLEAN(0, "group", &opts->group,
-			    "put the counters into a counter group"),
 	OPT_BOOLEAN('i', "no-inherit", &opts->no_inherit,
 		    "child tasks do not inherit counters"),
 	OPT_STRING(0, "sym-annotate", &top.sym_filter, "symbol name",
tools/perf/tests/attr/README +0 -2
index eb3f7d4bb324..4066fec7180a 100644
@@ -49,7 +49,6 @@ Following tests are defined (with perf commands):
   perf record --call-graph dwarf kill		(test-record-graph-dwarf)
   perf record --call-graph fp kill              (test-record-graph-fp)
   perf record --call-graph fp kill              (test-record-graph-fp-aarch64)
-  perf record --group -e cycles,instructions kill (test-record-group)
   perf record -e '{cycles,instructions}' kill   (test-record-group1)
   perf record -e '{cycles/period=1/,instructions/period=2/}:S' kill (test-record-group2)
   perf record -D kill                           (test-record-no-delay)
@@ -66,6 +65,5 @@ Following tests are defined (with perf commands):
   perf stat -d kill                             (test-stat-detailed-1)
   perf stat -dd kill                            (test-stat-detailed-2)
   perf stat -ddd kill                           (test-stat-detailed-3)
-  perf stat --group -e cycles,instructions kill (test-stat-group)
   perf stat -e '{cycles,instructions}' kill     (test-stat-group1)
   perf stat -i -e cycles kill                   (test-stat-no-inherit)
tools/perf/tests/attr/test-record-group deleted +0 -22
deleted file mode 100644
index 6c1cff8aae8b..000000000000
@@ -1,22 +0,0 @@
-[config]
-command = record
-args    = --no-bpf-event --group -e cycles,instructions kill >/dev/null 2>&1
-ret     = 1
-
-[event-1:base-record]
-fd=1
-group_fd=-1
-sample_type=327
-read_format=4|20
-
-[event-2:base-record]
-fd=2
-group_fd=1
-config=1
-sample_type=327
-read_format=4|20
-mmap=0
-comm=0
-task=0
-enable_on_exec=0
-disabled=0
tools/perf/tests/attr/test-stat-group deleted +0 -17
deleted file mode 100644
index e15d6946e9b3..000000000000
@@ -1,17 +0,0 @@
-[config]
-command = stat
-args    = --group -e cycles,instructions kill >/dev/null 2>&1
-ret     = 1
-
-[event-1:base-stat]
-fd=1
-group_fd=-1
-read_format=3|15
-
-[event-2:base-stat]
-fd=2
-group_fd=1
-config=1
-disabled=0
-enable_on_exec=0
-read_format=3|15
tools/perf/util/evlist.c +1 -1
index 590d4e77effc..817df2504a1e 100644
@@ -230,7 +230,7 @@ int __evlist__set_tracepoints_handlers(struct evlist *evlist,
 	return err;
 }
 
-void evlist__set_leader(struct evlist *evlist)
+static void evlist__set_leader(struct evlist *evlist)
 {
 	perf_evlist__set_leader(&evlist->core);
 }
tools/perf/util/evlist.h +0 -2
index e5b84ead566c..01fa9d592c5a 100644
@@ -221,8 +221,6 @@ void evlist__set_selected(struct evlist *evlist, struct evsel *evsel);
 int evlist__create_maps(struct evlist *evlist, struct target *target);
 int evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel);
 
-void evlist__set_leader(struct evlist *evlist);
-
 u64 __evlist__combined_sample_type(struct evlist *evlist);
 u64 evlist__combined_sample_type(struct evlist *evlist);
 u64 evlist__combined_branch_type(struct evlist *evlist);
tools/perf/util/python.c +0 -8
index 1d0cf72506a6..a19d3983e69a 100644
@@ -1142,14 +1142,6 @@ static PyObject *pyrf_evlist__open(struct pyrf_evlist *pevlist,
 				   PyObject *args, PyObject *kwargs)
 {
 	struct evlist *evlist = &pevlist->evlist;
-	int group = 0;
-	static char *kwlist[] = { "group", NULL };
-
-	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOii", kwlist, &group))
-		return NULL;
-
-	if (group)
-		evlist__set_leader(evlist);
 
 	if (evlist__open(evlist) < 0) {
 		PyErr_SetFromErrno(PyExc_OSError);
tools/perf/util/record.c +0 -7
index 7b58f6c7c69d..9eb5c6a08999 100644
@@ -99,13 +99,6 @@ void evlist__config(struct evlist *evlist, struct record_opts *opts, struct call
 	bool use_comm_exec;
 	bool sample_id = opts->sample_id;
 
-	/*
-	 * Set the evsel leader links before we configure attributes,
-	 * since some might depend on this info.
-	 */
-	if (opts->group)
-		evlist__set_leader(evlist);
-
 	if (perf_cpu_map__cpu(evlist->core.user_requested_cpus, 0).cpu < 0)
 		opts->no_inherit = true;
 
tools/perf/util/record.h +0 -1
index 4269e916f450..46212bf020cf 100644
@@ -13,7 +13,6 @@ struct option;
 
 struct record_opts {
 	struct target target;
-	bool	      group;
 	bool	      inherit_stat;
 	bool	      no_buffering;
 	bool	      no_inherit;
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
maintainer Applied
#6 lore raw
In reply to Ian Rogers

Em Tue, Dec 13, 2022 at 03:26:46PM -0800, Ian Rogers escreveu:

Quoted 8 lines

All patches on the acme perf/core branch.

Resend incremental build fix python plugin:
https://lore.kernel.org/lkml/[email protected]/

Break apart and resend libtraceevent debug logging support:
https://lore.kernel.org/linux-perf-users/[email protected]/

Quoted 6 lines

Switch "#if HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE" to "#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION", ensuring trace-event.h is included as discussed on the mailing list.

Resend removal of --group option:
https://lore.kernel.org/lkml/[email protected]/

Thanks, applied.

- Arnaldo

Quoted 36 lines

Ian Rogers (5):
perf build: Fix python/perf.so library's name perf trace-event: Add libtraceevent version tools to header
libtraceevent: Increase libtraceevent logging when verbose perf trace-event: Use version check to avoid 1 define perf evlist: Remove group option.

 tools/perf/Documentation/perf-record.txt      |  4 ----
 tools/perf/Documentation/perf-top.txt         |  7 ++----
 tools/perf/Makefile.config                    |  8 +++----
 tools/perf/Makefile.perf                      |  2 +-
 tools/perf/builtin-record.c                   |  2 --
 tools/perf/builtin-stat.c                     |  6 -----
 tools/perf/builtin-top.c                      |  2 --
 tools/perf/builtin-trace.c                    |  2 +-
 tools/perf/tests/attr/README                  |  2 --
 tools/perf/tests/attr/test-record-group       | 22 -------------------
 tools/perf/tests/attr/test-stat-group         | 17 --------------
 tools/perf/util/data-convert-bt.c             |  3 ++-
 tools/perf/util/debug.c                       | 10 +++++++++
 tools/perf/util/evlist.c                      |  2 +-
 tools/perf/util/evlist.h                      |  2 --
 tools/perf/util/evsel.c                       |  2 +-
 tools/perf/util/python.c                      | 10 +--------
 tools/perf/util/record.c                      |  7 ------
 tools/perf/util/record.h                      |  1 -
 .../util/scripting-engines/trace-event-perl.c |  2 +-
 .../scripting-engines/trace-event-python.c    |  2 +-
 tools/perf/util/sort.c                        |  3 ++-
 tools/perf/util/trace-event.h                 | 13 +++++++++++
 23 files changed, 39 insertions(+), 92 deletions(-)
 delete mode 100644 tools/perf/tests/attr/test-record-group
 delete mode 100644 tools/perf/tests/attr/test-stat-group
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
Signature · 1 line
- Arnaldo
#7 lore raw

Em Wed, Dec 14, 2022 at 11:22:45AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 9 lines

Em Tue, Dec 13, 2022 at 03:26:46PM -0800, Ian Rogers escreveu:

Quoted 8 lines

All patches on the acme perf/core branch.

Resend incremental build fix python plugin:
https://lore.kernel.org/lkml/[email protected]/

Break apart and resend libtraceevent debug logging support:
https://lore.kernel.org/linux-perf-users/[email protected]/

Quoted 8 lines
Quoted 6 lines

Switch "#if HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE" to "#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION", ensuring trace-event.h is included as discussed on the mailing list.

Resend removal of --group option:
https://lore.kernel.org/lkml/[email protected]/

Thanks, applied.

Building on arm64:

/home/acme/git/perf/tools/perf/util/evsel.c: In function ‘evsel__rawptr’:
/home/acme/git/perf/tools/perf/util/evsel.c:2787:65: error: operator '<=' has no right operand
2787 | #if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION
| ^
error: command '/usr/bin/gcc' failed with exit code 1
cp: cannot stat '/tmp/build/perf/python_ext_build/lib/perf*.so': No such file or directory

make[2]: *** [Makefile.perf:651: /tmp/build/perf/python/perf.cpython-310-aarch64-linux-gnu.so] Error 1 make[2]: *** Waiting for unfinished jobs....
LD /tmp/build/perf/libbpf/staticobjs/libbpf-in.o

Trying to fix...

Quoted 43 lines

- Arnaldo

Quoted 36 lines

Ian Rogers (5):
perf build: Fix python/perf.so library's name perf trace-event: Add libtraceevent version tools to header
libtraceevent: Increase libtraceevent logging when verbose perf trace-event: Use version check to avoid 1 define perf evlist: Remove group option.

 tools/perf/Documentation/perf-record.txt      |  4 ----
 tools/perf/Documentation/perf-top.txt         |  7 ++----
 tools/perf/Makefile.config                    |  8 +++----
 tools/perf/Makefile.perf                      |  2 +-
 tools/perf/builtin-record.c                   |  2 --
 tools/perf/builtin-stat.c                     |  6 -----
 tools/perf/builtin-top.c                      |  2 --
 tools/perf/builtin-trace.c                    |  2 +-
 tools/perf/tests/attr/README                  |  2 --
 tools/perf/tests/attr/test-record-group       | 22 -------------------
 tools/perf/tests/attr/test-stat-group         | 17 --------------
 tools/perf/util/data-convert-bt.c             |  3 ++-
 tools/perf/util/debug.c                       | 10 +++++++++
 tools/perf/util/evlist.c                      |  2 +-
 tools/perf/util/evlist.h                      |  2 --
 tools/perf/util/evsel.c                       |  2 +-
 tools/perf/util/python.c                      | 10 +--------
 tools/perf/util/record.c                      |  7 ------
 tools/perf/util/record.h                      |  1 -
 .../util/scripting-engines/trace-event-perl.c |  2 +-
 .../scripting-engines/trace-event-python.c    |  2 +-
 tools/perf/util/sort.c                        |  3 ++-
 tools/perf/util/trace-event.h                 | 13 +++++++++++
 23 files changed, 39 insertions(+), 92 deletions(-)
 delete mode 100644 tools/perf/tests/attr/test-record-group
 delete mode 100644 tools/perf/tests/attr/test-stat-group
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
Signature · 1 line
- Arnaldo
Signature · 1 line
- Arnaldo
author reviewer
#8 lore raw
Quoted 29 lines · Arnaldo Carvalho de Melo

Em Wed, Dec 14, 2022 at 11:22:45AM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 9 lines

Em Tue, Dec 13, 2022 at 03:26:46PM -0800, Ian Rogers escreveu:

Quoted 8 lines

All patches on the acme perf/core branch.

Resend incremental build fix python plugin:
https://lore.kernel.org/lkml/[email protected]/

Break apart and resend libtraceevent debug logging support:
https://lore.kernel.org/linux-perf-users/[email protected]/

Quoted 8 lines
Quoted 6 lines

Switch "#if HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE" to "#if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION", ensuring trace-event.h is included as discussed on the mailing list.

Resend removal of --group option:
https://lore.kernel.org/lkml/[email protected]/

Thanks, applied.

Building on arm64:

/home/acme/git/perf/tools/perf/util/evsel.c: In function ‘evsel__rawptr’:
/home/acme/git/perf/tools/perf/util/evsel.c:2787:65: error: operator '<=' has no right operand
2787 | #if MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) <= LIBTRACEEVENT_VERSION
| ^
error: command '/usr/bin/gcc' failed with exit code 1
cp: cannot stat '/tmp/build/perf/python_ext_build/lib/perf*.so': No such file or directory

Quoted 5 lines

make[2]: *** [Makefile.perf:651: /tmp/build/perf/python/perf.cpython-310-aarch64-linux-gnu.so] Error 1 make[2]: *** Waiting for unfinished jobs....
LD /tmp/build/perf/libbpf/staticobjs/libbpf-in.o

Trying to fix...

Thanks, I suspect the CFLAGS aren't passed through maybe, given this is the python code. Perhaps an include of util/trace-event.h is also necessary, but I thought that was already present:
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/util/evsel.c?h=perf/core#n43

Thanks for digging into it,
Ian

Quoted 47 lines
Quoted 37 lines

- Arnaldo

Quoted 34 lines

Ian Rogers (5):
perf build: Fix python/perf.so library's name perf trace-event: Add libtraceevent version tools to header
libtraceevent: Increase libtraceevent logging when verbose perf trace-event: Use version check to avoid 1 define perf evlist: Remove group option.

 tools/perf/Documentation/perf-record.txt      |  4 ----
 tools/perf/Documentation/perf-top.txt         |  7 ++----
 tools/perf/Makefile.config                    |  8 +++----
 tools/perf/Makefile.perf                      |  2 +-
 tools/perf/builtin-record.c                   |  2 --
 tools/perf/builtin-stat.c                     |  6 -----
 tools/perf/builtin-top.c                      |  2 --
 tools/perf/builtin-trace.c                    |  2 +-
 tools/perf/tests/attr/README                  |  2 --
 tools/perf/tests/attr/test-record-group       | 22 -------------------
 tools/perf/tests/attr/test-stat-group         | 17 --------------
 tools/perf/util/data-convert-bt.c             |  3 ++-
 tools/perf/util/debug.c                       | 10 +++++++++
 tools/perf/util/evlist.c                      |  2 +-
 tools/perf/util/evlist.h                      |  2 --
 tools/perf/util/evsel.c                       |  2 +-
 tools/perf/util/python.c                      | 10 +--------
 tools/perf/util/record.c                      |  7 ------
 tools/perf/util/record.h                      |  1 -
 .../util/scripting-engines/trace-event-perl.c |  2 +-
 .../scripting-engines/trace-event-python.c    |  2 +-
 tools/perf/util/sort.c                        |  3 ++-
 tools/perf/util/trace-event.h                 | 13 +++++++++++
 23 files changed, 39 insertions(+), 92 deletions(-)
 delete mode 100644 tools/perf/tests/attr/test-record-group
 delete mode 100644 tools/perf/tests/attr/test-stat-group
Quoted 6 lines
Quoted 2 lines

--
2.39.0.314.g84b9a713c41-goog

--

- Arnaldo

--

- Arnaldo