mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 07:29:42 -05:00
perf/core: Verify we have a single perf_hw_context PMU
There should (and can) only be a single PMU for perf_hw_context events. This is because of how we schedule events: once a hardware event fails to schedule (the PMU is 'full') we stop trying to add more. The trivial 'fix' would break the Round-Robin scheduling we do. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vince Weaver <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
07dc900e17
commit
2665784850
1 changed files with 9 additions and 0 deletions
|
|
@ -7693,6 +7693,15 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type)
|
|||
}
|
||||
|
||||
skip_type:
|
||||
if (pmu->task_ctx_nr == perf_hw_context) {
|
||||
static int hw_context_taken = 0;
|
||||
|
||||
if (WARN_ON_ONCE(hw_context_taken))
|
||||
pmu->task_ctx_nr = perf_invalid_context;
|
||||
|
||||
hw_context_taken = 1;
|
||||
}
|
||||
|
||||
pmu->pmu_cpu_context = find_pmu_context(pmu->task_ctx_nr);
|
||||
if (pmu->pmu_cpu_context)
|
||||
goto got_cpu_context;
|
||||
|
|
|
|||
Loading…
Reference in a new issue