Skip to content

Commit f41dac3

Browse files
committed
Merge tag 'perf-core-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull performance events updates from Ingo Molnar: "Uprobes: - Add BPF session support (Jiri Olsa) - Switch to RCU Tasks Trace flavor for better performance (Andrii Nakryiko) - Massively increase uretprobe SMP scalability by SRCU-protecting the uretprobe lifetime (Andrii Nakryiko) - Kill xol_area->slot_count (Oleg Nesterov) Core facilities: - Implement targeted high-frequency profiling by adding the ability for an event to "pause" or "resume" AUX area tracing (Adrian Hunter) VM profiling/sampling: - Correct perf sampling with guest VMs (Colton Lewis) New hardware support: - x86/intel: Add PMU support for Intel ArrowLake-H CPUs (Dapeng Mi) Misc fixes and enhancements: - x86/intel/pt: Fix buffer full but size is 0 case (Adrian Hunter) - x86/amd: Warn only on new bits set (Breno Leitao) - x86/amd/uncore: Avoid a false positive warning about snprintf truncation in amd_uncore_umc_ctx_init (Jean Delvare) - uprobes: Re-order struct uprobe_task to save some space (Christophe JAILLET) - x86/rapl: Move the pmu allocation out of CPU hotplug (Kan Liang) - x86/rapl: Clean up cpumask and hotplug (Kan Liang) - uprobes: Deuglify xol_get_insn_slot/xol_free_insn_slot paths (Oleg Nesterov)" * tag 'perf-core-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (32 commits) perf/core: Correct perf sampling with guest VMs perf/x86: Refactor misc flag assignments perf/powerpc: Use perf_arch_instruction_pointer() perf/core: Hoist perf_instruction_pointer() and perf_misc_flags() perf/arm: Drop unused functions uprobes: Re-order struct uprobe_task to save some space perf/x86/amd/uncore: Avoid a false positive warning about snprintf truncation in amd_uncore_umc_ctx_init perf/x86/intel: Do not enable large PEBS for events with aux actions or aux sampling perf/x86/intel/pt: Add support for pause / resume perf/core: Add aux_pause, aux_resume, aux_start_paused perf/x86/intel/pt: Fix buffer full but size is 0 case uprobes: SRCU-protect uretprobe lifetime (with timeout) uprobes: allow put_uprobe() from non-sleepable softirq context perf/x86/rapl: Clean up cpumask and hotplug perf/x86/rapl: Move the pmu allocation out of CPU hotplug uprobe: Add support for session consumer uprobe: Add data pointer to consumer handlers perf/x86/amd: Warn only on new bits set uprobes: fold xol_take_insn_slot() into xol_get_insn_slot() uprobes: kill xol_area->slot_count ...
2 parents 9d7d4ad + 2c47e7a commit f41dac3

File tree

34 files changed

+1069
-418
lines changed

34 files changed

+1069
-418
lines changed

arch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ config KPROBES_ON_FTRACE
135135
config UPROBES
136136
def_bool n
137137
depends on ARCH_SUPPORTS_UPROBES
138+
select TASKS_TRACE_RCU
138139
help
139140
Uprobes is the user-space counterpart to kprobes: they
140141
enable instrumentation applications (such as 'perf probe')

arch/arm/include/asm/perf_event.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
#ifndef __ARM_PERF_EVENT_H__
99
#define __ARM_PERF_EVENT_H__
1010

11-
#ifdef CONFIG_PERF_EVENTS
12-
struct pt_regs;
13-
extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
14-
extern unsigned long perf_misc_flags(struct pt_regs *regs);
15-
#define perf_misc_flags(regs) perf_misc_flags(regs)
16-
#endif
17-
1811
#define perf_arch_fetch_caller_regs(regs, __ip) { \
1912
(regs)->ARM_pc = (__ip); \
2013
frame_pointer((regs)) = (unsigned long) __builtin_frame_address(0); \

arch/arm/kernel/perf_callchain.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,3 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re
9696
arm_get_current_stackframe(regs, &fr);
9797
walk_stackframe(&fr, callchain_trace, entry);
9898
}
99-
100-
unsigned long perf_instruction_pointer(struct pt_regs *regs)
101-
{
102-
return instruction_pointer(regs);
103-
}
104-
105-
unsigned long perf_misc_flags(struct pt_regs *regs)
106-
{
107-
int misc = 0;
108-
109-
if (user_mode(regs))
110-
misc |= PERF_RECORD_MISC_USER;
111-
else
112-
misc |= PERF_RECORD_MISC_KERNEL;
113-
114-
return misc;
115-
}

arch/arm64/include/asm/perf_event.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
#include <asm/ptrace.h>
1111

1212
#ifdef CONFIG_PERF_EVENTS
13-
struct pt_regs;
14-
extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
15-
extern unsigned long perf_misc_flags(struct pt_regs *regs);
16-
#define perf_misc_flags(regs) perf_misc_flags(regs)
1713
#define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs
1814
#endif
1915

arch/arm64/kernel/perf_callchain.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,3 @@ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
3838

3939
arch_stack_walk(callchain_trace, entry, current, regs);
4040
}
41-
42-
unsigned long perf_instruction_pointer(struct pt_regs *regs)
43-
{
44-
if (perf_guest_state())
45-
return perf_guest_get_ip();
46-
47-
return instruction_pointer(regs);
48-
}
49-
50-
unsigned long perf_misc_flags(struct pt_regs *regs)
51-
{
52-
unsigned int guest_state = perf_guest_state();
53-
int misc = 0;
54-
55-
if (guest_state) {
56-
if (guest_state & PERF_GUEST_USER)
57-
misc |= PERF_RECORD_MISC_GUEST_USER;
58-
else
59-
misc |= PERF_RECORD_MISC_GUEST_KERNEL;
60-
} else {
61-
if (user_mode(regs))
62-
misc |= PERF_RECORD_MISC_USER;
63-
else
64-
misc |= PERF_RECORD_MISC_KERNEL;
65-
}
66-
67-
return misc;
68-
}

arch/powerpc/include/asm/perf_event_server.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,16 @@ struct power_pmu {
102102
int __init register_power_pmu(struct power_pmu *pmu);
103103

104104
struct pt_regs;
105-
extern unsigned long perf_misc_flags(struct pt_regs *regs);
106-
extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
105+
extern unsigned long perf_arch_misc_flags(struct pt_regs *regs);
106+
extern unsigned long perf_arch_instruction_pointer(struct pt_regs *regs);
107107
extern unsigned long int read_bhrb(int n);
108108

109109
/*
110110
* Only override the default definitions in include/linux/perf_event.h
111111
* if we have hardware PMU support.
112112
*/
113113
#ifdef CONFIG_PPC_PERF_CTRS
114-
#define perf_misc_flags(regs) perf_misc_flags(regs)
114+
#define perf_arch_misc_flags(regs) perf_arch_misc_flags(regs)
115115
#endif
116116

117117
/*

arch/powerpc/perf/callchain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re
5151

5252
lr = regs->link;
5353
sp = regs->gpr[1];
54-
perf_callchain_store(entry, perf_instruction_pointer(regs));
54+
perf_callchain_store(entry, perf_arch_instruction_pointer(regs));
5555

5656
if (!validate_sp(sp, current))
5757
return;

arch/powerpc/perf/callchain_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void perf_callchain_user_32(struct perf_callchain_entry_ctx *entry,
139139
long level = 0;
140140
unsigned int __user *fp, *uregs;
141141

142-
next_ip = perf_instruction_pointer(regs);
142+
next_ip = perf_arch_instruction_pointer(regs);
143143
lr = regs->link;
144144
sp = regs->gpr[1];
145145
perf_callchain_store(entry, next_ip);

arch/powerpc/perf/callchain_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void perf_callchain_user_64(struct perf_callchain_entry_ctx *entry,
7474
struct signal_frame_64 __user *sigframe;
7575
unsigned long __user *fp, *uregs;
7676

77-
next_ip = perf_instruction_pointer(regs);
77+
next_ip = perf_arch_instruction_pointer(regs);
7878
lr = regs->link;
7979
sp = regs->gpr[1];
8080
perf_callchain_store(entry, next_ip);

arch/powerpc/perf/core-book3s.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
23322332
* Called from generic code to get the misc flags (i.e. processor mode)
23332333
* for an event_id.
23342334
*/
2335-
unsigned long perf_misc_flags(struct pt_regs *regs)
2335+
unsigned long perf_arch_misc_flags(struct pt_regs *regs)
23362336
{
23372337
u32 flags = perf_get_misc_flags(regs);
23382338

@@ -2346,7 +2346,7 @@ unsigned long perf_misc_flags(struct pt_regs *regs)
23462346
* Called from generic code to get the instruction pointer
23472347
* for an event_id.
23482348
*/
2349-
unsigned long perf_instruction_pointer(struct pt_regs *regs)
2349+
unsigned long perf_arch_instruction_pointer(struct pt_regs *regs)
23502350
{
23512351
unsigned long siar = mfspr(SPRN_SIAR);
23522352

0 commit comments

Comments
 (0)