Skip to content

Commit a443997

Browse files
Alexey BudankovIngo Molnar
authored andcommitted
perf/x86: Install platform specific ->swap_task_ctx() adapter
Bridge perf core and x86 swap_task_ctx() method calls. Signed-off-by: Alexey Budankov <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Song Liu <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vince Weaver <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent fc1adfe commit a443997

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/x86/events/core.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,6 +2243,13 @@ static void x86_pmu_sched_task(struct perf_event_context *ctx, bool sched_in)
22432243
x86_pmu.sched_task(ctx, sched_in);
22442244
}
22452245

2246+
static void x86_pmu_swap_task_ctx(struct perf_event_context *prev,
2247+
struct perf_event_context *next)
2248+
{
2249+
if (x86_pmu.swap_task_ctx)
2250+
x86_pmu.swap_task_ctx(prev, next);
2251+
}
2252+
22462253
void perf_check_microcode(void)
22472254
{
22482255
if (x86_pmu.check_microcode)
@@ -2297,6 +2304,7 @@ static struct pmu pmu = {
22972304
.event_idx = x86_pmu_event_idx,
22982305
.sched_task = x86_pmu_sched_task,
22992306
.task_ctx_size = sizeof(struct x86_perf_task_context),
2307+
.swap_task_ctx = x86_pmu_swap_task_ctx,
23002308
.check_period = x86_pmu_check_period,
23012309

23022310
.aux_output_match = x86_pmu_aux_output_match,

0 commit comments

Comments
 (0)