Skip to main content
added 2573 characters in body
Source Link
slm
  • 379.7k
  • 127
  • 793
  • 897

Example run

I took the sample perf command from that article and modified it slightly so that it just ran the command ls.

$ sudo perf stat -C 0 -e \
r100f2,r4001a,r100f8,r4001c,r2001a,r200f4,r2004a,r4004a,r4004e,r4004c,\
r20016,r40018,r20012,r40016,r40012,r20018,r4000a,r2001c,r1001c,r20014,\
r40014,r30004 taskset -c 0 ls
Pharrell Williams - Happy (Official Music Video)-y6Sxv-sUYtM.mp3

 Performance counter stats for 'taskset -c 0 ls':

                 0 r100f2                                                       [16.55%]
                 0 r4001a                                                       [19.54%]
                 0 r100f8                                                       [22.86%]
                 0 r4001c                                                       [25.97%]
                 0 r2001a                                                       [25.92%]
                 0 r200f4                                                       [26.00%]
                 0 r2004a                                                       [25.77%]
                 0 r4004a                                                       [25.83%]
                 0 r4004e                                                       [25.56%]
                 0 r4004c                                                       [22.45%]
                 0 r20016                                                       [19.25%]
                 0 r40018                                                       [16.15%]
                 0 r20012                                                       [12.97%]
                 0 r40016                                                       [12.98%]
                 0 r40012                                                       [12.97%]
                 0 r20018                                                       [13.02%]
                 0 r4000a                                                       [13.03%]
                 0 r2001c                                                       [12.96%]
                 0 r1001c                                                       [13.10%]
                 0 r20014                                                       [13.00%]
                 0 r40014                                                       [13.07%]
                 0 r30004                                                       [13.08%]

       0.030559857 seconds time elapsed

Example run

I took the sample perf command from that article and modified it slightly so that it just ran the command ls.

$ sudo perf stat -C 0 -e \
r100f2,r4001a,r100f8,r4001c,r2001a,r200f4,r2004a,r4004a,r4004e,r4004c,\
r20016,r40018,r20012,r40016,r40012,r20018,r4000a,r2001c,r1001c,r20014,\
r40014,r30004 taskset -c 0 ls
Pharrell Williams - Happy (Official Music Video)-y6Sxv-sUYtM.mp3

 Performance counter stats for 'taskset -c 0 ls':

                 0 r100f2                                                       [16.55%]
                 0 r4001a                                                       [19.54%]
                 0 r100f8                                                       [22.86%]
                 0 r4001c                                                       [25.97%]
                 0 r2001a                                                       [25.92%]
                 0 r200f4                                                       [26.00%]
                 0 r2004a                                                       [25.77%]
                 0 r4004a                                                       [25.83%]
                 0 r4004e                                                       [25.56%]
                 0 r4004c                                                       [22.45%]
                 0 r20016                                                       [19.25%]
                 0 r40018                                                       [16.15%]
                 0 r20012                                                       [12.97%]
                 0 r40016                                                       [12.98%]
                 0 r40012                                                       [12.97%]
                 0 r20018                                                       [13.02%]
                 0 r4000a                                                       [13.03%]
                 0 r2001c                                                       [12.96%]
                 0 r1001c                                                       [13.10%]
                 0 r20014                                                       [13.00%]
                 0 r40014                                                       [13.07%]
                 0 r30004                                                       [13.08%]

       0.030559857 seconds time elapsed
Source Link
slm
  • 379.7k
  • 127
  • 793
  • 897

I believe this is part of your answer here in the IBM articled titled: Evaluate performance for Linux on POWER.

One drawback is that, although it allows gathering of hardware performance counters directly, perf does not recognize the counter name denoted by the POWER7 CBM; it needs to use raw hexadecimal numbers instead. Table 1 is a mapping of OProfile events to hexadecimal numbers which you can use with perf (using the record raw events options) to utilize the CBM for POWER7.

I cannot tell however if this is a limitation of POWER or of perf.