We can read pmu cycle and number of instructions executed with read trigger as follows.
$ gcc -pg -o t-abc tests/s-abc.c
$ uftrace -T main@read=pmu-cycle t-abc
# DURATION TID FUNCTION
1.516 us [ 50294] | __monstartup();
0.778 us [ 50294] | __cxa_atexit();
[ 50294] | main() {
[ 50294] | /* read:pmu-cycle (cycles=521 instructions=31) */
[ 50294] | a() {
[ 50294] | b() {
[ 50294] | c() {
1.515 us [ 50294] | getpid();
2.740 us [ 50294] | } /* c */
3.162 us [ 50294] | } /* b */
3.537 us [ 50294] | } /* a */
[ 50294] | /* diff:pmu-cycle (cycles=+5389 instructions=+5504 IPC=1.02) */
62.849 us [ 50294] | } /* main */
However, there is no way to show these data in report and graph so it would be useful to add new fields for Cycles and Instrs to report and graph commands. They can be displayed only when data is available.
We can read pmu cycle and number of instructions executed with read trigger as follows.
However, there is no way to show these data in report and graph so it would be useful to add new fields for
Cycles
andInstrs
to report and graph commands. They can be displayed only when data is available.