perf stat: Doubt about stall cycle support
I am running perf stat to count hardware counters but am confused about stall cycle support.
On running the command perf stat ./progname, I am told that stalled-cycles- frontend and stalled-cycles-backend are not counted, but when on running perf stat -v ./progname, I am told that stall cycles are not supported by the kernel. So which is it?
I am running kernel 3.0.0-17 on a Core 2 Duo T9600.
Output of perf stat -v ./progname below.
-------------------------------------------------------------------------
stalled-cycles-frontend event is not supported by the kernel. stalled-cycles-backend event is not supported by the kernel.
task-clock: 10721725 10721725 10721725
context-switches: 21 10721725 10721725
CPU-migrations: 7 10721725 10721725
page-faults: 307 10721725 10721725
cycles: 8448552 10786438 10786438
stalled-cycles-frontend: 0 0 0
stalled-cycles-backend: 0 0 0
instructions: 9441906 10786438 10786438
branches: 2248426 10786438 10786438
branch-misses: 78571 10786438 10786438
Performance counter stats for './dd-exp1-papiex 10':
10.721725 task-clock # 0.232 CPUs utilized
21 context-switches # 0.002 M/sec
7 CPU-migrations # 0.001 M/sec
307 page-faults # 0.029 M/sec
8,448,552 cycles # 0.788 GHz <not counted> stalled-cycles-frontend
<not counted> stalled-cycles-backend
9,441,906 instructions # 1.12 insns per cycle
2,248,426 branches # 209.707 M/sec
78,571 branch-misses # 3.49% of all branches
0.046307919 seconds time elapsed
Thanks and Regards,
Yipeng
Quoted 7 lines · Yipeng Huang
I am running perf stat to count hardware counters but am confused about stall cycle support.
On running the command perf stat ./progname, I am told that stalled-cycles- frontend and stalled-cycles-backend are not counted, but when on running perf stat -v ./progname, I am told that stall cycles are not supported by the kernel. So which is it?
What does perf --version show?
Should be fixed by 2cee77c4505fc581f41b44e18ffc0953b67a414c.
David
Quoted 10 lines · yipeng
What does perf --version show?
Should be fixed by 2cee77c4505fc581f41b44e18ffc09__53b67a414c.
David
I'm not sure what version that hash is. I'm using perf version 3.0.22. Is my version that too old?
That's a commit id for perf-stat to discriminate unsupported events from not counted events.
It was committed around 3.0 timeframe. Try compiling a newer version of perf and see if it addresses your concern.
David
Quoted 13 lines · David Ahern <dsahern <at> gmail.com> writes:
Quoted 10 lines · yipeng
What does perf --version show?
Should be fixed by 2cee77c4505fc581f41b44e18ffc09__53b67a414c.
David
I'm not sure what version that hash is. I'm using perf version 3.0.22. Is my version that too old?
Quoted 8 lines
That's a commit id for perf-stat to discriminate unsupported events from not counted events.
It was committed around 3.0 timeframe. Try compiling a newer version of perf and see if it addresses your concern.
David
David, you are right, it consistently shows "not supported by the kernel" on 3.2. However, I am still unable to read stall cycles.
Since I am on a much newer kernel, could it be the case that reading stall cycles is not supported by my hardware rather than by the kernel?
Thanks,
Yipeng
Quoted 3 lines · Yipeng Huang
Since I am on a much newer kernel, could it be the case that reading stall cycles is not supported by my hardware rather than by the kernel?
What kind of stalls are you looking to measure?
The core2 supports many kind of stall events. Check out Intel Vol3b documentation, or the libpfm4 showevtinfo utility for a list of them all.
perf only directly supports a small subset of "generalized" events, and only then if a kernel developer bothers to hook up the proper events in the kernel sources.
If you do find a likely event you want to use, you can make perf use it as a "raw" event.
Vince
Quoted 2 lines · Yipeng Huang
Since I am on a much newer kernel, could it be the case that reading stall cycles is not supported by my hardware rather than by the kernel?
Sandy Bridge and Westmere support should be in 3.0. Are you sure your processor supports it?
David
Quoted 6 lines · Vince Weaver
What kind of stalls are you looking to measure?
The core2 supports many kind of stall events. Check out Intel Vol3b documentation, or the libpfm4 showevtinfo utility for a list of them all.
Quoted 6 lines
perf only directly supports a small subset of "generalized" events, and only then if a kernel developer bothers to hook up the proper events in the kernel sources.
If you do find a likely event you want to use, you can make perf use it as a "raw" event.
Vince, resource stalls is close to what I was looking for.
libpfim4 and raw events set me on the right direction, thanks!
Yipeng