RFC perf/core: Invoke pmu::sched_task callback for cpu events
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | perf/core: Enable sched_task callbacks if PMU has itkernel/ | +4 | 5 replies | |
| 2/2 | perf/core: Invoke pmu::sched_task callback for per-cpu eventsinclude/ kernel/ | +37 | 5 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC 0/2] perf/core: Invoke pmu::sched_task callback for cpu events
Hello,
It was reported that system-wide events with precise_ip set have a lot of unknown symbols on Intel machines. Depending on the system load I can see more than 30% of total symbols are not resolved (actually don't have DSO mappings).
I found that it's only large PEBS is enabled - using call-graph or the frequency mode will disable it and have valid results. I've verified it by checking intel_pmu_pebs_sched_task() is called like below:
# perf probe -a intel_pmu_pebs_sched_task
# perf stat -a -e probe:intel_pmu_pebs_sched_task \
Quoted 1 line
perf record -a -e cycles:ppp -c 100001 sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 2.625 MB perf.data (10345 samples) ]
Performance counter stats for 'system wide':
0 probe:intel_pmu_pebs_sched_task
2.157533991 seconds time elapsedLooking at the code, I found out that the pmu::sched_task callback was changed recently that it's called only for task events. So cpu events with large PEBS didn't flush the buffer and they are attributed to unrelated tasks later resulted in unresolved symbols.
This patch reverts it and keeps the optimization for task events. While at it, I also found the context switch callback was not enabled for cpu events from the beginning. So I've added it too. With this applied, I can see the above callbacks are hit as expected and perf report has valid symbols.
Thanks
Namhyung
Namhyung Kim (2):
perf/core: Enable sched_task callbacks if PMU has it perf/core: Invoke pmu::sched_task callback for per-cpu events
include/linux/perf_event.h | 1 + kernel/events/core.c | 42 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-)
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog