Skip to content

Commit c7decec

Browse files
committed
Merge tag 'perf-tools-for-v7.0-1-2026-02-21' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
Pull perf tools updates from Arnaldo Carvalho de Melo: - Introduce 'perf sched stats' tool with record/report/diff workflows using schedstat counters - Add a faster libdw based addr2line implementation and allow selecting it or its alternatives via 'perf config addr2line.style=' - Data-type profiling fixes and improvements including the ability to select fields using 'perf report''s -F/-fields, e.g.: 'perf report --fields overhead,type' - Add 'perf test' regression tests for Data-type profiling with C and Rust workloads - Fix srcline printing with inlines in callchains, make sure this has coverage in 'perf test' - Fix printing of leaf IP in LBR callchains - Fix display of metrics without sufficient permission in 'perf stat' - Print all machines in 'perf kvm report -vvv', not just the host - Switch from SHA-1 to BLAKE2s for build ID generation, remove SHA-1 code - Fix 'perf report's histogram entry collapsing with '-F' option - Use system's cacheline size instead of a hardcoded value in 'perf report' - Allow filtering conversion by time range in 'perf data' - Cover conversion to CTF using 'perf data' in 'perf test' - Address newer glibc const-correctness (-Werror=discarded-qualifiers) issues - Fixes and improvements for ARM's CoreSight support, simplify ARM SPE event config in 'perf mem', update docs for 'perf c2c' including the ARM events it can be used with - Build support for generating metrics from arch specific python script, add extra AMD, Intel, ARM64 metrics using it - Add AMD Zen 6 events and metrics - Add JSON file with OpenHW Risc-V CVA6 hardware counters - Add 'perf kvm' stats live testing - Add more 'perf stat' tests to 'perf test' - Fix segfault in `perf lock contention -b/--use-bpf` - Fix various 'perf test' cases for s390 - Build system cleanups, bump minimum shellcheck version to 0.7.2 - Support building the capstone based annotation routines as a plugin - Allow passing extra Clang flags via EXTRA_BPF_FLAGS * tag 'perf-tools-for-v7.0-1-2026-02-21' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: (255 commits) perf test script: Add python script testing support perf test script: Add perl script testing support perf script: Allow the generated script to be a path perf test: perf data --to-ctf testing perf test: Test pipe mode with data conversion --to-json perf json: Pipe mode --to-ctf support perf json: Pipe mode --to-json support perf check: Add libbabeltrace to the listed features perf build: Allow passing extra Clang flags via EXTRA_BPF_FLAGS perf test data_type_profiling.sh: Skip just the Rust tests if code_with_type workload is missing tools build: Fix feature test for rust compiler perf libunwind: Fix calls to thread__e_machine() perf stat: Add no-affinity flag perf evlist: Reduce affinity use and move into iterator, fix no affinity perf evlist: Missing TPEBS close in evlist__close() perf evlist: Special map propagation for tool events that read on 1 CPU perf stat-shadow: In prepare_metric fix guard on reading NULL perf_stat_evsel Revert "perf tool_pmu: More accurately set the cpus for tool events" tools build: Emit dependencies file for test-rust.bin tools build: Make test-rust.bin be removed by the 'clean' target ...
2 parents 3544d5c + dbf0108 commit c7decec

324 files changed

Lines changed: 15622 additions & 4400 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
11
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2-
#include <asm/unistd_64.h>
2+
/*
3+
* Copyright (C) 2012 ARM Ltd.
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License version 2 as
7+
* published by the Free Software Foundation.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#define __ARCH_WANT_RENAMEAT
19+
#define __ARCH_WANT_NEW_STAT
20+
#define __ARCH_WANT_SET_GET_RLIMIT
21+
#define __ARCH_WANT_TIME32_SYSCALLS
22+
#define __ARCH_WANT_MEMFD_SECRET
23+
24+
#include <asm-generic/unistd.h>

tools/build/Makefile.build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ quiet_cmd_host_ld_multi = HOSTLD $@
7676
cmd_host_ld_multi = $(if $(strip $(obj-y)),\
7777
$(HOSTLD) -r -o $@ $(filter $(obj-y),$^),rm -f $@; $(HOSTAR) rcs $@)
7878

79+
rust_common_cmd = \
80+
$(RUSTC) $(rust_flags) \
81+
--crate-type staticlib -L $(objtree)/rust/ \
82+
--emit=dep-info=$(depfile),link
83+
84+
quiet_cmd_rustc_a_rs = $(RUSTC) $(quiet_modtag) $@
85+
cmd_rustc_a_rs = $(rust_common_cmd) -o $@ -g $< $(cmd_objtool)
86+
7987
ifneq ($(filter $(obj),$(hostprogs)),)
8088
host = host_
8189
endif
@@ -105,6 +113,12 @@ $(OUTPUT)%.s: %.c FORCE
105113
$(call rule_mkdir)
106114
$(call if_changed_dep,cc_s_c)
107115

116+
# it's recommended to build a static rust library, when a foreight (to rust)
117+
# linker is used.
118+
$(OUTPUT)%.a: %.rs FORCE
119+
$(call rule_mkdir)
120+
$(call if_changed_dep,rustc_a_rs)
121+
108122
# bison and flex files are generated in the OUTPUT directory
109123
# so it needs a separate rule to depend on them properly
110124
$(OUTPUT)%-bison.o: $(OUTPUT)%-bison.c FORCE

tools/build/Makefile.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ FEATURE_TESTS_BASIC := \
7171
gettid \
7272
glibc \
7373
libbfd \
74-
libbfd-buildid \
74+
libbfd-threadsafe \
7575
libelf \
7676
libelf-getphdrnum \
7777
libelf-gelf_getnote \
@@ -149,7 +149,8 @@ FEATURE_DISPLAY ?= \
149149
bpf \
150150
libaio \
151151
libzstd \
152-
libopenssl
152+
libopenssl \
153+
rust
153154

154155
#
155156
# Declare group members of a feature to display the logical OR of the detection

tools/build/feature/Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ FILES= \
1313
test-gtk2-infobar.bin \
1414
test-hello.bin \
1515
test-libbfd.bin \
16-
test-libbfd-buildid.bin \
16+
test-libbfd-threadsafe.bin \
1717
test-disassembler-four-args.bin \
1818
test-disassembler-init-styled.bin \
1919
test-reallocarray.bin \
@@ -73,6 +73,7 @@ FILES= \
7373
test-clang-bpf-co-re.bin \
7474
test-file-handle.bin \
7575
test-libpfm4.bin \
76+
test-rust.bin \
7677
test-libopenssl.bin
7778

7879
FILES := $(addprefix $(OUTPUT),$(FILES))
@@ -268,7 +269,7 @@ $(OUTPUT)test-libpython.bin:
268269
$(OUTPUT)test-libbfd.bin:
269270
$(BUILD_BFD)
270271

271-
$(OUTPUT)test-libbfd-buildid.bin:
272+
$(OUTPUT)test-libbfd-threadsafe.bin:
272273
$(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz
273274

274275
$(OUTPUT)test-disassembler-four-args.bin:
@@ -388,6 +389,15 @@ $(OUTPUT)test-libopenssl.bin:
388389
$(OUTPUT)test-bpftool-skeletons.bin:
389390
$(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
390391
> $(@:.bin=.make.output) 2>&1
392+
393+
# Testing Rust is special: we don't compile anything, it's enough to check the
394+
# compiler presence. Compiling a test code for this purposes is problematic,
395+
# because Rust will emit a dependency file without any external references,
396+
# meaning that if rustc will be removed the build process will still think it's
397+
# there.
398+
$(OUTPUT)test-rust.bin:
399+
$(RUSTC) --version > /dev/null 2>&1
400+
391401
###############################
392402

393403
clean:

tools/build/feature/test-libbfd-buildid.c

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <bfd.h>
3+
4+
static bool lock(void *unused)
5+
{
6+
return true;
7+
}
8+
9+
static bool unlock(void *unused)
10+
{
11+
return true;
12+
}
13+
14+
int main(void)
15+
{
16+
/* Check for presence of new thread safety API (version 2.42) */
17+
return !bfd_thread_init(lock, unlock, NULL);
18+
}

tools/include/linux/bitfield.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define _LINUX_BITFIELD_H
99

1010
#include <linux/build_bug.h>
11+
#include <linux/kernel.h>
1112
#include <asm/byteorder.h>
1213

1314
/*

tools/include/linux/list.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,16 @@ static inline void list_move_tail(struct list_head *list,
169169
list_add_tail(list, head);
170170
}
171171

172+
/**
173+
* list_is_first -- tests whether @list is the first entry in list @head
174+
* @list: the entry to test
175+
* @head: the head of the list
176+
*/
177+
static inline int list_is_first(const struct list_head *list, const struct list_head *head)
178+
{
179+
return list->prev == head;
180+
}
181+
172182
/**
173183
* list_is_last - tests whether @list is the last entry in list @head
174184
* @list: the entry to test

tools/lib/perf/Documentation/libperf.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ SYNOPSIS
211211
struct perf_record_header_feature;
212212
struct perf_record_compressed;
213213
struct perf_record_compressed2;
214+
struct perf_record_schedstat_cpu;
215+
struct perf_record_schedstat_domain;
214216
--
215217

216218
DESCRIPTION

tools/lib/perf/Makefile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
4242
TEST_ARGS := $(if $(V),-v)
4343

4444
INCLUDES = \
45-
-I$(OUTPUT)arch/$(SRCARCH)/include/generated/uapi \
4645
-I$(srctree)/tools/lib/perf/include \
4746
-I$(srctree)/tools/lib/ \
4847
-I$(srctree)/tools/include \
@@ -51,9 +50,9 @@ INCLUDES = \
5150
-I$(srctree)/tools/include/uapi
5251

5352
# Append required CFLAGS
53+
override CFLAGS := $(INCLUDES) $(CFLAGS)
5454
override CFLAGS += -g -Werror -Wall
5555
override CFLAGS += -fPIC
56-
override CFLAGS += $(INCLUDES)
5756
override CFLAGS += -fvisibility=hidden
5857
override CFLAGS += $(EXTRA_WARNINGS)
5958
override CFLAGS += $(EXTRA_CFLAGS)
@@ -100,16 +99,7 @@ $(LIBAPI)-clean:
10099
$(call QUIET_CLEAN, libapi)
101100
$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
102101

103-
uapi-asm := $(OUTPUT)arch/$(SRCARCH)/include/generated/uapi/asm
104-
ifeq ($(SRCARCH),arm64)
105-
syscall-y := $(uapi-asm)/unistd_64.h
106-
endif
107-
uapi-asm-generic:
108-
$(if $(syscall-y),\
109-
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-headers obj=$(uapi-asm) \
110-
generic=include/uapi/asm-generic $(syscall-y),)
111-
112-
$(LIBPERF_IN): uapi-asm-generic FORCE
102+
$(LIBPERF_IN): FORCE
113103
$(Q)$(MAKE) $(build)=libperf
114104

115105
$(LIBPERF_A): $(LIBPERF_IN)
@@ -130,7 +120,7 @@ all: fixdep
130120
clean: $(LIBAPI)-clean
131121
$(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \
132122
*.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBPERF_VERSION) .*.d .*.cmd tests/*.o LIBPERF-CFLAGS $(LIBPERF_PC) \
133-
$(TESTS_STATIC) $(TESTS_SHARED) $(syscall-y)
123+
$(TESTS_STATIC) $(TESTS_SHARED)
134124

135125
TESTS_IN = tests-in.o
136126

@@ -179,6 +169,7 @@ install_lib: libs
179169
cp -fpR $(LIBPERF_ALL) $(DESTDIR)$(libdir_SQ)
180170

181171
HDRS := bpf_perf.h core.h cpumap.h threadmap.h evlist.h evsel.h event.h mmap.h
172+
HDRS += schedstat-v15.h schedstat-v16.h schedstat-v17.h
182173
INTERNAL_HDRS := cpumap.h evlist.h evsel.h lib.h mmap.h rc_check.h threadmap.h xyarray.h
183174

184175
INSTALL_HDRS_PFX := $(DESTDIR)$(prefix)/include/perf

0 commit comments

Comments
 (0)