Skip to content

Commit 09f73a1

Browse files
committed
Merge tag 'perf-tools-for-v5.19-2022-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull more perf tools updates from Arnaldo Carvalho de Melo: - Add BPF based off-CPU profiling - Improvements for system wide recording, specially for Intel PT - Improve DWARF unwinding on arm64 - Support Arm CoreSight trace data disassembly in 'perf script' python - Fix build with new libbpf version, related to supporting older versions of distro released libbpf packages - Fix event syntax error caused by ExtSel in the JSON events infra - Use stdio interface if slang is not supported in 'perf c2c' - Add 'perf test' checking for perf stat CSV output - Sync the msr-index.h copy with the kernel sources * tag 'perf-tools-for-v5.19-2022-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (38 commits) tools arch x86: Sync the msr-index.h copy with the kernel sources perf scripts python: Support Arm CoreSight trace data disassembly perf scripting python: Expose dso and map information perf jevents: Fix event syntax error caused by ExtSel perf tools arm64: Add support for VG register perf unwind arm64: Decouple Libunwind register names from Perf perf unwind: Use dynamic register set for DWARF unwind perf tools arm64: Copy perf_regs.h from the kernel perf unwind arm64: Use perf's copy of kernel headers perf c2c: Use stdio interface if slang is not supported perf test: Add a basic offcpu profiling test perf record: Add cgroup support for off-cpu profiling perf record: Handle argument change in sched_switch perf record: Implement basic filtering for off-cpu perf record: Enable off-cpu analysis with BPF perf report: Do not extend sample type of bpf-output event perf test: Add checking for perf stat CSV output. perf tools: Allow system-wide events to keep their own threads perf tools: Allow system-wide events to keep their own CPUs libperf evsel: Add comments for booleans ...
2 parents 664a393 + 9dde6ca commit 09f73a1

44 files changed

Lines changed: 1594 additions & 197 deletions

Some content is hidden

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

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ enum perf_event_arm_regs {
3636
PERF_REG_ARM64_LR,
3737
PERF_REG_ARM64_SP,
3838
PERF_REG_ARM64_PC,
39-
PERF_REG_ARM64_MAX,
39+
40+
/* Extended/pseudo registers */
41+
PERF_REG_ARM64_VG = 46, // SVE Vector Granule
42+
43+
PERF_REG_ARM64_MAX = PERF_REG_ARM64_PC + 1,
44+
PERF_REG_ARM64_EXTENDED_MAX = PERF_REG_ARM64_VG + 1
4045
};
4146
#endif /* _ASM_ARM64_PERF_REGS_H */

tools/arch/x86/include/asm/msr-index.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676

7777
/* Abbreviated from Intel SDM name IA32_CORE_CAPABILITIES */
7878
#define MSR_IA32_CORE_CAPS 0x000000cf
79+
#define MSR_IA32_CORE_CAPS_INTEGRITY_CAPS_BIT 2
80+
#define MSR_IA32_CORE_CAPS_INTEGRITY_CAPS BIT(MSR_IA32_CORE_CAPS_INTEGRITY_CAPS_BIT)
7981
#define MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT_BIT 5
8082
#define MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT BIT(MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT_BIT)
8183

@@ -154,6 +156,11 @@
154156
#define MSR_IA32_POWER_CTL 0x000001fc
155157
#define MSR_IA32_POWER_CTL_BIT_EE 19
156158

159+
/* Abbreviated from Intel SDM name IA32_INTEGRITY_CAPABILITIES */
160+
#define MSR_INTEGRITY_CAPS 0x000002d9
161+
#define MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT 4
162+
#define MSR_INTEGRITY_CAPS_PERIODIC_BIST BIT(MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT)
163+
157164
#define MSR_LBR_NHM_FROM 0x00000680
158165
#define MSR_LBR_NHM_TO 0x000006c0
159166
#define MSR_LBR_CORE_FROM 0x00000040
@@ -312,6 +319,7 @@
312319

313320
/* Run Time Average Power Limiting (RAPL) Interface */
314321

322+
#define MSR_VR_CURRENT_CONFIG 0x00000601
315323
#define MSR_RAPL_POWER_UNIT 0x00000606
316324

317325
#define MSR_PKG_POWER_LIMIT 0x00000610
@@ -502,8 +510,10 @@
502510
#define MSR_AMD64_SEV 0xc0010131
503511
#define MSR_AMD64_SEV_ENABLED_BIT 0
504512
#define MSR_AMD64_SEV_ES_ENABLED_BIT 1
513+
#define MSR_AMD64_SEV_SNP_ENABLED_BIT 2
505514
#define MSR_AMD64_SEV_ENABLED BIT_ULL(MSR_AMD64_SEV_ENABLED_BIT)
506515
#define MSR_AMD64_SEV_ES_ENABLED BIT_ULL(MSR_AMD64_SEV_ES_ENABLED_BIT)
516+
#define MSR_AMD64_SEV_SNP_ENABLED BIT_ULL(MSR_AMD64_SEV_SNP_ENABLED_BIT)
507517

508518
#define MSR_AMD64_VIRT_SPEC_CTRL 0xc001011f
509519

@@ -524,6 +534,11 @@
524534
#define AMD_CPPC_DES_PERF(x) (((x) & 0xff) << 16)
525535
#define AMD_CPPC_ENERGY_PERF_PREF(x) (((x) & 0xff) << 24)
526536

537+
/* AMD Performance Counter Global Status and Control MSRs */
538+
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300
539+
#define MSR_AMD64_PERF_CNTR_GLOBAL_CTL 0xc0000301
540+
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR 0xc0000302
541+
527542
/* Fam 17h MSRs */
528543
#define MSR_F17H_IRPERF 0xc00000e9
529544

@@ -688,6 +703,10 @@
688703
#define MSR_IA32_PERF_CTL 0x00000199
689704
#define INTEL_PERF_CTL_MASK 0xffff
690705

706+
/* AMD Branch Sampling configuration */
707+
#define MSR_AMD_DBG_EXTN_CFG 0xc000010f
708+
#define MSR_AMD_SAMP_BR_FROM 0xc0010300
709+
691710
#define MSR_IA32_MPERF 0x000000e7
692711
#define MSR_IA32_APERF 0x000000e8
693712

tools/build/Makefile.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ FEATURE_TESTS_EXTRA := \
9999
clang \
100100
libbpf \
101101
libbpf-btf__load_from_kernel_by_id \
102+
libbpf-bpf_prog_load \
103+
libbpf-bpf_object__next_program \
104+
libbpf-bpf_object__next_map \
105+
libbpf-bpf_create_map \
102106
libpfm4 \
103107
libdebuginfod \
104108
clang-bpf-co-re

tools/build/feature/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ FILES= \
5858
test-bpf.bin \
5959
test-libbpf.bin \
6060
test-libbpf-btf__load_from_kernel_by_id.bin \
61+
test-libbpf-bpf_prog_load.bin \
62+
test-libbpf-bpf_map_create.bin \
63+
test-libbpf-bpf_object__next_program.bin \
64+
test-libbpf-bpf_object__next_map.bin \
65+
test-libbpf-btf__raw_data.bin \
6166
test-get_cpuid.bin \
6267
test-sdt.bin \
6368
test-cxx.bin \
@@ -291,6 +296,21 @@ $(OUTPUT)test-libbpf.bin:
291296
$(OUTPUT)test-libbpf-btf__load_from_kernel_by_id.bin:
292297
$(BUILD) -lbpf
293298

299+
$(OUTPUT)test-libbpf-bpf_prog_load.bin:
300+
$(BUILD) -lbpf
301+
302+
$(OUTPUT)test-libbpf-bpf_map_create.bin:
303+
$(BUILD) -lbpf
304+
305+
$(OUTPUT)test-libbpf-bpf_object__next_program.bin:
306+
$(BUILD) -lbpf
307+
308+
$(OUTPUT)test-libbpf-bpf_object__next_map.bin:
309+
$(BUILD) -lbpf
310+
311+
$(OUTPUT)test-libbpf-btf__raw_data.bin:
312+
$(BUILD) -lbpf
313+
294314
$(OUTPUT)test-sdt.bin:
295315
$(BUILD)
296316

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <bpf/bpf.h>
3+
4+
int main(void)
5+
{
6+
return bpf_map_create(0 /* map_type */, NULL /* map_name */, 0, /* key_size */,
7+
0 /* value_size */, 0 /* max_entries */, NULL /* opts */);
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <bpf/libbpf.h>
3+
4+
int main(void)
5+
{
6+
bpf_object__next_map(NULL /* obj */, NULL /* prev */);
7+
return 0;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <bpf/libbpf.h>
3+
4+
int main(void)
5+
{
6+
bpf_object__next_program(NULL /* obj */, NULL /* prev */);
7+
return 0;
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <bpf/bpf.h>
3+
4+
int main(void)
5+
{
6+
return bpf_prog_load(0 /* prog_type */, NULL /* prog_name */,
7+
NULL /* license */, NULL /* insns */,
8+
0 /* insn_cnt */, NULL /* opts */);
9+
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// SPDX-License-Identifier: GPL-2.0
2-
#include <bpf/libbpf.h>
2+
#include <bpf/btf.h>
33

44
int main(void)
55
{
6-
return btf__load_from_kernel_by_id(20151128, NULL);
6+
btf__load_from_kernel_by_id(20151128);
7+
return 0;
78
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <bpf/btf.h>
3+
4+
int main(void)
5+
{
6+
btf__raw_data(NULL /* btf_ro */, NULL /* size */);
7+
return 0;
8+
}

0 commit comments

Comments
 (0)