Skip to content

Commit bbdbeb0

Browse files
committed
Merge tag 'perf-tools-for-v5.16-2021-11-07-without-bpftool-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tools updates from Arnaldo Carvalho de Melo: "perf annotate: - Add riscv64 support. - Add fusion logic for AMD microarchs. perf record: - Add an option to control the synthesizing behavior: --synth <no|all|task|mmap|cgroup> core: - Allow controlling synthesizing PERF_RECORD_ metadata events during record. - perf.data reader prep work for multithreaded processing. - Fix missing exclude_{host,guest} setting in PMUs that don't support it and that were causing the feature detection code to disable it for all events, even the ones in PMUs that support it. - Fix the default use of precise events on AMD, that were always falling back to non-precise because perf_event_attr.exclude_guest=1 was set and IBS does not have filtering capability, refusing precise + exclude_guest. - Add bitfield_swap() to handle branch_stack endian issue. perf script: - Show binary offsets for userspace addresses in callchains. - Support instruction latency via new "ins_lat" selectable field. - Add dlfilter-show-cycles perf inject: - Add vmlinux and ignore-vmlinux arguments, similar to other tools. perf list: - Display PMU prefix for partially supported hybrid cache events. - Display hybrid PMU events with cpu type. perf stat: - Improve metrics documentation of data structures. - Fix memory leaks in the metric code. - Use NAN for missing event IDs. - Don't compute unused events. - Fix memory leak on error path. - Encode and use metric-id as a metric qualifier. - Allow metrics with no events. - Avoid events for an 'if' constant result. - Only add a referenced metric once. - Simplify metric_refs calculation. - Allow modifiers on metrics. perf test: - Add workload test of metric and metric groups. - Workload test of all PMUs. - vmlinux-kallsyms: Ignore hidden symbols. - Add pmu-event test for event described as "config=". - Verify more event members in pmu-events test. - Add endian test for struct branch_flags on the sample-parsing test. - Improve temp file cleanup in several tests. perf daemon: - Address MSAN warnings on send_cmd(). perf kmem: - Improve man page for record options perf srcline: - Use long-running addr2line per DSO, greatly speeding up the 'srcline' sort order. perf symbols: - Ignore $a/$d symbols for ARM modules. - Fix /proc/kcore access on 32 bit systems. Kernel UAPI copies: - Update copy of linux/socket.h with the kernel sources, no change in tooling output. libbpf: - Pull in bpf_program__get_prog_info_linear() from libbpf, too much specific to perf. - Deprecate bpf_map__resize() in favor of bpf_map_set_max_entries() - Install libbpf headers locally when building. - Bump minimum LLVM C++ std to GNU++14. libperf: - Use binary search in perf_cpu_map__idx() as array are sorted. libtracefs: - Enable libtracefs dynamic linking. libtraceevent: - Increase logging when verbose. Arch specific: * PowerPC: - Add support to expose instruction and data address registers as part of extended regs. Vendor events: * JSON parser: - Support ConfigCode to set the config= in PMUs - Make the JSON parser more conformant when in strict mode. * All JSON files: - Fix all remaining invalid JSON files. * ARM: - Syntax corrections in Neoverse N1 json. - Categorise the Neoverse V1 counters. - Add new armv8 PMU events. - Revise hip08 uncore events. Hardware tracing: * auxtrace: - Add missing Z option to ITRACE_HELP. - Add itrace A option to approximate IPC. - Add itrace d+o option to direct debug log to stdout. * Intel PT: - Add support for PERF_RECORD_AUX_OUTPUT_HW_ID - Support itrace A option to approximate IPC - Support itrace d+o option to direct debug log to stdout" * tag 'perf-tools-for-v5.16-2021-11-07-without-bpftool-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (120 commits) perf build: Install libbpf headers locally when building perf MANIFEST: Add bpftool files to allow building with BUILD_BPF_SKEL=1 perf metric: Fix memory leaks perf parse-event: Add init and exit to parse_event_error perf parse-events: Rename parse_events_error functions perf stat: Fix memory leak on error path perf tools: Use __BYTE_ORDER__ perf inject: Add vmlinux and ignore-vmlinux arguments perf tools: Check vmlinux/kallsyms arguments in all tools perf tools: Refactor out kernel symbol argument sanity checking perf symbols: Ignore $a/$d symbols for ARM modules perf evsel: Don't set exclude_guest by default perf evsel: Fix missing exclude_{host,guest} setting perf bpf: Add missing free to bpf_event__print_bpf_prog_info() perf beauty: Update copy of linux/socket.h with the kernel sources perf clang: Fixes for more recent LLVM/clang tools: Bump minimum LLVM C++ std to GNU++14 perf bpf: Pull in bpf_program__get_prog_info_linear() Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t" perf test sample-parsing: Add endian test for struct branch_flags ...
2 parents 1e9ed93 + 6b491a8 commit bbdbeb0

File tree

184 files changed

+5083
-1705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+5083
-1705
lines changed

tools/arch/powerpc/include/uapi/asm/perf_regs.h

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,35 @@ enum perf_event_powerpc_regs {
6161
PERF_REG_POWERPC_PMC4,
6262
PERF_REG_POWERPC_PMC5,
6363
PERF_REG_POWERPC_PMC6,
64-
/* Max regs without the extended regs */
64+
PERF_REG_POWERPC_SDAR,
65+
PERF_REG_POWERPC_SIAR,
66+
/* Max mask value for interrupt regs w/o extended regs */
6567
PERF_REG_POWERPC_MAX = PERF_REG_POWERPC_MMCRA + 1,
68+
/* Max mask value for interrupt regs including extended regs */
69+
PERF_REG_EXTENDED_MAX = PERF_REG_POWERPC_SIAR + 1,
6670
};
6771

6872
#define PERF_REG_PMU_MASK ((1ULL << PERF_REG_POWERPC_MAX) - 1)
6973

70-
/* Exclude MMCR3, SIER2, SIER3 for CPU_FTR_ARCH_300 */
71-
#define PERF_EXCLUDE_REG_EXT_300 (7ULL << PERF_REG_POWERPC_MMCR3)
72-
7374
/*
7475
* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_300
75-
* includes 9 SPRS from MMCR0 to PMC6 excluding the
76-
* unsupported SPRS in PERF_EXCLUDE_REG_EXT_300.
76+
* includes 11 SPRS from MMCR0 to SIAR excluding the
77+
* unsupported SPRS MMCR3, SIER2 and SIER3.
7778
*/
78-
#define PERF_REG_PMU_MASK_300 ((0xfffULL << PERF_REG_POWERPC_MMCR0) - PERF_EXCLUDE_REG_EXT_300)
79+
#define PERF_REG_PMU_MASK_300 \
80+
((1ULL << PERF_REG_POWERPC_MMCR0) | (1ULL << PERF_REG_POWERPC_MMCR1) | \
81+
(1ULL << PERF_REG_POWERPC_MMCR2) | (1ULL << PERF_REG_POWERPC_PMC1) | \
82+
(1ULL << PERF_REG_POWERPC_PMC2) | (1ULL << PERF_REG_POWERPC_PMC3) | \
83+
(1ULL << PERF_REG_POWERPC_PMC4) | (1ULL << PERF_REG_POWERPC_PMC5) | \
84+
(1ULL << PERF_REG_POWERPC_PMC6) | (1ULL << PERF_REG_POWERPC_SDAR) | \
85+
(1ULL << PERF_REG_POWERPC_SIAR))
7986

8087
/*
8188
* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_31
82-
* includes 12 SPRs from MMCR0 to PMC6.
89+
* includes 14 SPRs from MMCR0 to SIAR.
8390
*/
84-
#define PERF_REG_PMU_MASK_31 (0xfffULL << PERF_REG_POWERPC_MMCR0)
91+
#define PERF_REG_PMU_MASK_31 \
92+
(PERF_REG_PMU_MASK_300 | (1ULL << PERF_REG_POWERPC_MMCR3) | \
93+
(1ULL << PERF_REG_POWERPC_SIER2) | (1ULL << PERF_REG_POWERPC_SIER3))
8594

86-
#define PERF_REG_EXTENDED_MAX (PERF_REG_POWERPC_PMC6 + 1)
8795
#endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */

tools/build/Makefile.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ FEATURE_TESTS_BASIC := \
5252
libslang \
5353
libslang-include-subdir \
5454
libtraceevent \
55+
libtracefs \
5556
libcrypto \
5657
libunwind \
5758
pthread-attr-setaffinity-np \

tools/build/feature/Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ FILES= \
3636
test-libslang.bin \
3737
test-libslang-include-subdir.bin \
3838
test-libtraceevent.bin \
39+
test-libtracefs.bin \
3940
test-libcrypto.bin \
4041
test-libunwind.bin \
4142
test-libunwind-debug-frame.bin \
@@ -90,7 +91,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(
9091
###############################
9192

9293
$(OUTPUT)test-all.bin:
93-
$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -I/usr/include/slang -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd -lcap
94+
$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd -lcap
9495

9596
$(OUTPUT)test-hello.bin:
9697
$(BUILD)
@@ -199,6 +200,9 @@ $(OUTPUT)test-libslang-include-subdir.bin:
199200
$(OUTPUT)test-libtraceevent.bin:
200201
$(BUILD) -ltraceevent
201202

203+
$(OUTPUT)test-libtracefs.bin:
204+
$(BUILD) -ltracefs
205+
202206
$(OUTPUT)test-libcrypto.bin:
203207
$(BUILD) -lcrypto
204208

@@ -296,20 +300,20 @@ $(OUTPUT)test-jvmti-cmlr.bin:
296300
$(BUILD)
297301

298302
$(OUTPUT)test-llvm.bin:
299-
$(BUILDXX) -std=gnu++11 \
303+
$(BUILDXX) -std=gnu++14 \
300304
-I$(shell $(LLVM_CONFIG) --includedir) \
301305
-L$(shell $(LLVM_CONFIG) --libdir) \
302306
$(shell $(LLVM_CONFIG) --libs Core BPF) \
303307
$(shell $(LLVM_CONFIG) --system-libs) \
304308
> $(@:.bin=.make.output) 2>&1
305309

306310
$(OUTPUT)test-llvm-version.bin:
307-
$(BUILDXX) -std=gnu++11 \
311+
$(BUILDXX) -std=gnu++14 \
308312
-I$(shell $(LLVM_CONFIG) --includedir) \
309313
> $(@:.bin=.make.output) 2>&1
310314

311315
$(OUTPUT)test-clang.bin:
312-
$(BUILDXX) -std=gnu++11 \
316+
$(BUILDXX) -std=gnu++14 \
313317
-I$(shell $(LLVM_CONFIG) --includedir) \
314318
-L$(shell $(LLVM_CONFIG) --libdir) \
315319
-Wl,--start-group -lclangBasic -lclangDriver \

tools/build/feature/test-libtracefs.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <tracefs/tracefs.h>
3+
4+
int main(void)
5+
{
6+
struct tracefs_instance *inst = tracefs_instance_create("dummy");
7+
8+
tracefs_instance_destroy(inst);
9+
return 0;
10+
}

tools/include/linux/list_sort.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _LINUX_LIST_SORT_H
3+
#define _LINUX_LIST_SORT_H
4+
5+
#include <linux/types.h>
6+
7+
struct list_head;
8+
9+
typedef int __attribute__((nonnull(2,3))) (*list_cmp_func_t)(void *,
10+
const struct list_head *, const struct list_head *);
11+
12+
__attribute__((nonnull(2,3)))
13+
void list_sort(void *priv, struct list_head *head, list_cmp_func_t cmp);
14+
#endif

tools/include/uapi/linux/perf_event.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,21 @@ enum perf_event_type {
11411141
*/
11421142
PERF_RECORD_TEXT_POKE = 20,
11431143

1144+
/*
1145+
* Data written to the AUX area by hardware due to aux_output, may need
1146+
* to be matched to the event by an architecture-specific hardware ID.
1147+
* This records the hardware ID, but requires sample_id to provide the
1148+
* event ID. e.g. Intel PT uses this record to disambiguate PEBS-via-PT
1149+
* records from multiple events.
1150+
*
1151+
* struct {
1152+
* struct perf_event_header header;
1153+
* u64 hw_id;
1154+
* struct sample_id sample_id;
1155+
* };
1156+
*/
1157+
PERF_RECORD_AUX_OUTPUT_HW_ID = 21,
1158+
11441159
PERF_RECORD_MAX, /* non-ABI */
11451160
};
11461161

0 commit comments

Comments
 (0)