-1

I try to use the perf topdown tool to analyze the CPU utilization of my program and find out the bottleneck.Here is the command:

perf stat -a --topdown ./benchmark

But perf shows that:

System does not support topdown

My perf tool version is:

perf version 5.4.224

And this is my kernel version and CPU arch:

Linux version 5.4.0-139-generic (buildd@lcy02-amd64-036) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #156~18.04.1-Ubuntu SMP Wed Jan 25 15:56:22 UTC 2023

My CPU is:

16 12th Gen Intel(R) Core(TM) i5-12500H

Should I update my linux kernel version or open some compile options?

Thanks for comment : I have done cmd as root:

 echo 0 > /proc/sys/kernel/nmi_watchdog

And I tried to do this cmd as root:

DRL-DZ000894# perf stat -a --topdown ls

But this did not work, and the error noice is same.

komonzhang
  • 67
  • 5

1 Answers1

1

Your CPU is an Alderlake and supports top down events, however, as there are big (performance) and little (atom) cores there are 2 performance monitoring units. There is work to make these work properly with the patches targeting Linux 6.5 (Linux 6.3 was just released). There is buggy support prior to this. As the events aren't listed then this looks like a permissions issue.

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
Ian Rogers
  • 29
  • 2
  • If the question I deleted somehow was meant as an essential part of the answer, then please phrase it as an explained conditional answer, in order to avoid the impression of asking a clarification question instead of answering (for which a comment should be used instead of an answer, compare https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead ). For example like "If your problem is ... then the solution is to .... because .... ." – Yunnosch May 19 '23 at 06:23