Skip to content

Commit afead42

Browse files
committed
Merge tag 'perf-tools-fixes-for-v6.4-2-2023-05-30' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix BPF CO-RE naming convention for checking the availability of fields on 'union perf_mem_data_src' on the running kernel - Remove the use of llvm-strip on BPF skel object files, not needed, fixes a build breakage when the llvm package, that contains it in most distros, isn't installed - Fix tools that use both evsel->{bpf_counter_list,bpf_filters}, removing them from a union - Remove extra "--" from the 'perf ftrace latency' --use-nsec option, previously it was working only when using the '-n' alternative - Don't stop building when both binutils-devel and a C++ compiler isn't available to compile the alternative C++ demangle support code, disable that feature instead - Sync the linux/in.h and coresight-pmu.h header copies with the kernel sources - Fix relative include path to cs-etm.h * tag 'perf-tools-fixes-for-v6.4-2-2023-05-30' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf evsel: Separate bpf_counter_list and bpf_filters, can be used at the same time tools headers UAPI: Sync the linux/in.h with the kernel sources perf cs-etm: Copy kernel coresight-pmu.h header perf bpf: Do not use llvm-strip on BPF binary perf build: Don't compile demangle-cxx.cpp if not necessary perf arm: Fix include path to cs-etm.h perf bpf filter: Fix a broken perf sample data naming for BPF CO-RE perf ftrace latency: Remove unnecessary "--" from --use-nsec option
2 parents 1683c32 + c041d33 commit afead42

File tree

12 files changed

+51
-24
lines changed

12 files changed

+51
-24
lines changed

tools/include/linux/coresight-pmu.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@
2121
*/
2222
#define CORESIGHT_LEGACY_CPU_TRACE_ID(cpu) (0x10 + (cpu * 2))
2323

24-
/* CoreSight trace ID is currently the bottom 7 bits of the value */
25-
#define CORESIGHT_TRACE_ID_VAL_MASK GENMASK(6, 0)
26-
27-
/*
28-
* perf record will set the legacy meta data values as unused initially.
29-
* This allows perf report to manage the decoders created when dynamic
30-
* allocation in operation.
31-
*/
32-
#define CORESIGHT_TRACE_ID_UNUSED_FLAG BIT(31)
33-
34-
/* Value to set for unused trace ID values */
35-
#define CORESIGHT_TRACE_ID_UNUSED_VAL 0x7F
36-
3724
/*
3825
* Below are the definition of bit offsets for perf option, and works as
3926
* arbitrary values for all ETM versions.

tools/include/uapi/linux/in.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ struct in_addr {
163163
#define IP_MULTICAST_ALL 49
164164
#define IP_UNICAST_IF 50
165165
#define IP_LOCAL_PORT_RANGE 51
166+
#define IP_PROTOCOL 52
166167

167168
#define MCAST_EXCLUDE 0
168169
#define MCAST_INCLUDE 1

tools/perf/Makefile.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ ifndef NO_DEMANGLE
927927
EXTLIBS += -lstdc++
928928
CFLAGS += -DHAVE_CXA_DEMANGLE_SUPPORT
929929
CXXFLAGS += -DHAVE_CXA_DEMANGLE_SUPPORT
930+
$(call detected,CONFIG_CXX_DEMANGLE)
930931
endif
931932
ifdef BUILD_NONDISTRO
932933
ifeq ($(filter -liberty,$(EXTLIBS)),)

tools/perf/Makefile.perf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ HOSTCC ?= gcc
181181
HOSTLD ?= ld
182182
HOSTAR ?= ar
183183
CLANG ?= clang
184-
LLVM_STRIP ?= llvm-strip
185184

186185
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
187186

@@ -1083,7 +1082,7 @@ $(BPFTOOL): | $(SKEL_TMP_OUT)
10831082

10841083
$(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(LIBBPF) | $(SKEL_TMP_OUT)
10851084
$(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -Wall -Werror $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \
1086-
-c $(filter util/bpf_skel/%.bpf.c,$^) -o $@ && $(LLVM_STRIP) -g $@
1085+
-c $(filter util/bpf_skel/%.bpf.c,$^) -o $@
10871086

10881087
$(SKEL_OUT)/%.skel.h: $(SKEL_TMP_OUT)/%.bpf.o | $(BPFTOOL)
10891088
$(QUIET_GENSKEL)$(BPFTOOL) gen skeleton $< > $@

tools/perf/arch/arm/util/pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "arm-spe.h"
1313
#include "hisi-ptt.h"
1414
#include "../../../util/pmu.h"
15-
#include "../cs-etm.h"
15+
#include "../../../util/cs-etm.h"
1616

1717
struct perf_event_attr
1818
*perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)

tools/perf/builtin-ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ int cmd_ftrace(int argc, const char **argv)
11751175
OPT_BOOLEAN('b', "use-bpf", &ftrace.target.use_bpf,
11761176
"Use BPF to measure function latency"),
11771177
#endif
1178-
OPT_BOOLEAN('n', "--use-nsec", &ftrace.use_nsec,
1178+
OPT_BOOLEAN('n', "use-nsec", &ftrace.use_nsec,
11791179
"Use nano-second histogram"),
11801180
OPT_PARENT(common_options),
11811181
};

tools/perf/util/Build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ perf-$(CONFIG_ZSTD) += zstd.o
214214

215215
perf-$(CONFIG_LIBCAP) += cap.o
216216

217-
perf-y += demangle-cxx.o
217+
perf-$(CONFIG_CXX_DEMANGLE) += demangle-cxx.o
218218
perf-y += demangle-ocaml.o
219219
perf-y += demangle-java.o
220220
perf-y += demangle-rust.o

tools/perf/util/bpf_skel/sample_filter.bpf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct perf_sample_data___new {
2525
} __attribute__((preserve_access_index));
2626

2727
/* new kernel perf_mem_data_src definition */
28-
union perf_mem_data_src__new {
28+
union perf_mem_data_src___new {
2929
__u64 val;
3030
struct {
3131
__u64 mem_op:5, /* type of opcode */
@@ -108,7 +108,7 @@ static inline __u64 perf_get_sample(struct bpf_perf_event_data_kern *kctx,
108108
if (entry->part == 7)
109109
return kctx->data->data_src.mem_blk;
110110
if (entry->part == 8) {
111-
union perf_mem_data_src__new *data = (void *)&kctx->data->data_src;
111+
union perf_mem_data_src___new *data = (void *)&kctx->data->data_src;
112112

113113
if (bpf_core_field_exists(data->mem_hops))
114114
return data->mem_hops;

tools/perf/util/cs-etm.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,19 @@ struct cs_etm_packet_queue {
227227
#define INFO_HEADER_SIZE (sizeof(((struct perf_record_auxtrace_info *)0)->type) + \
228228
sizeof(((struct perf_record_auxtrace_info *)0)->reserved__))
229229

230+
/* CoreSight trace ID is currently the bottom 7 bits of the value */
231+
#define CORESIGHT_TRACE_ID_VAL_MASK GENMASK(6, 0)
232+
233+
/*
234+
* perf record will set the legacy meta data values as unused initially.
235+
* This allows perf report to manage the decoders created when dynamic
236+
* allocation in operation.
237+
*/
238+
#define CORESIGHT_TRACE_ID_UNUSED_FLAG BIT(31)
239+
240+
/* Value to set for unused trace ID values */
241+
#define CORESIGHT_TRACE_ID_UNUSED_VAL 0x7F
242+
230243
int cs_etm__process_auxtrace_info(union perf_event *event,
231244
struct perf_session *session);
232245
struct perf_event_attr *cs_etm_get_default_config(struct perf_pmu *pmu);

tools/perf/util/evsel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ void evsel__init(struct evsel *evsel,
282282
evsel->bpf_fd = -1;
283283
INIT_LIST_HEAD(&evsel->config_terms);
284284
INIT_LIST_HEAD(&evsel->bpf_counter_list);
285+
INIT_LIST_HEAD(&evsel->bpf_filters);
285286
perf_evsel__object.init(evsel);
286287
evsel->sample_size = __evsel__sample_size(attr->sample_type);
287288
evsel__calc_id_pos(evsel);

0 commit comments

Comments
 (0)