hardware platform :* Pandaboard ES Rev B1.* Processor: *Omap4460*. software Version :* linaro-12.10*
kernel config: android_omap4_defconfig. I changed a few options in order to use perf.
*CONFIG_HAVE_PERF_EVENTS=y CONFIG_PERF_EVENTS=y CONFIG_PERF_COUNTERS=y CONFIG_HW_PERF_EVENTS=y*
The command `Perf stat echo "linaro"` gives such results. root@android:/ # perf stat echo "linaro" linaro
Performance counter stats for 'echo linaro':
269.561767 task-clock # 0.148 CPUs utilized 10 context-switches # 0.000 M/sec 1 CPU-migrations # 0.000 M/sec 105 page-faults # 0.000 M/sec 29678044 cycles # 0.110 GHz 0 stalled-cycles-frontend # 0.00% frontend cycles idle 0 stalled-cycles-backend # 0.00% backend cycles idle 0 instructions # 0.00 insns per cycle 0 branches # 0.000 M/sec 0 branch-misses # 0.00% of all branches
1.823486284 seconds time elapsed
I use the option `-v`, and I can see that the first number of branches, instructions branch-misses and so on is zero.why?
root@android:/ # perf stat -v echo "linaro" linaro task-clock: 93902590 93902590 93902590 context-switches: 9 93902590 93902590 CPU-migrations: 0 93902590 93902590 page-faults: 104 93902590 93902590 cycles: 4284725 76202392 76202392 stalled-cycles-frontend: 0 76202392 76202392 stalled-cycles-backend: 0 76202392 76202392 instructions: 0 76202392 76202392 branches: 0 76202392 76202392 branch-misses: 0 76202392 76202392
Performance counter stats for 'echo linaro':
93.902590 task-clock # 0.282 CPUs utilized 9 context-switches # 0.000 M/sec 0 CPU-migrations # 0.000 M/sec 104 page-faults # 0.001 M/sec 4284725 cycles # 0.046 GHz * 0 stalled-cycles-frontend # 0.00% frontend cycles idle 0 stalled-cycles-backend # 0.00% backend cycles idle 0 instructions # 0.00 insns per cycle 0 branches # 0.000 M/sec 0 branch-misses # 0.00% of all branches *
0.332550049 seconds time elapsed
Can anybody give me suggestions?How can I use perf to get the value of hardware performance counter
+ Dave Long
On Tue, Dec 4, 2012 at 3:37 AM, Peng Fan xfan87@gmail.com wrote:
hardware platform :* Pandaboard ES Rev B1.* Processor: *Omap4460*. software Version :* linaro-12.10*
kernel config: android_omap4_defconfig. I changed a few options in order to use perf.
*CONFIG_HAVE_PERF_EVENTS=y CONFIG_PERF_EVENTS=y CONFIG_PERF_COUNTERS=y CONFIG_HW_PERF_EVENTS=y*
The command `Perf stat echo "linaro"` gives such results. root@android:/ # perf stat echo "linaro" linaro
Performance counter stats for 'echo linaro':
269.561767 task-clock # 0.148 CPUs
utilized 10 context-switches # 0.000 M/sec 1 CPU-migrations # 0.000 M/sec 105 page-faults # 0.000 M/sec 29678044 cycles # 0.110 GHz 0 stalled-cycles-frontend # 0.00% frontend cycles idle 0 stalled-cycles-backend # 0.00% backend cycles idle 0 instructions # 0.00 insns per cycle 0 branches # 0.000 M/sec 0 branch-misses # 0.00% of all branches
1.823486284 seconds time elapsed
I use the option `-v`, and I can see that the first number of branches, instructions branch-misses and so on is zero.why?
root@android:/ # perf stat -v echo "linaro" linaro task-clock: 93902590 93902590 93902590 context-switches: 9 93902590 93902590 CPU-migrations: 0 93902590 93902590 page-faults: 104 93902590 93902590 cycles: 4284725 76202392 76202392 stalled-cycles-frontend: 0 76202392 76202392 stalled-cycles-backend: 0 76202392 76202392 instructions: 0 76202392 76202392 branches: 0 76202392 76202392 branch-misses: 0 76202392 76202392
Performance counter stats for 'echo linaro':
93.902590 task-clock # 0.282 CPUs
utilized 9 context-switches # 0.000 M/sec 0 CPU-migrations # 0.000 M/sec 104 page-faults # 0.001 M/sec 4284725 cycles # 0.046 GHz
0 stalled-cycles-frontend # 0.00% frontend cycles
idle 0 stalled-cycles-backend # 0.00% backend cycles idle 0 instructions # 0.00 insns per cycle 0 branches # 0.000 M/sec 0 branch-misses # 0.00% of all branches
0.332550049 seconds time elapsed
Can anybody give me suggestions?How can I use perf to get the value of hardware performance counter
linaro-kernel mailing list linaro-kernel@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-kernel
On 12/04/12 13:46, Scott Bambrough wrote:
- Dave Long
On Tue, Dec 4, 2012 at 3:37 AM, Peng Fan <xfan87@gmail.com mailto:xfan87@gmail.com> wrote:
I use the option `-v`, and I can see that the first number of branches, instructions branch-misses and so on is zero.why? root@android:/ # perf stat -v echo "linaro" linaro task-clock: 93902590 93902590 93902590 context-switches: 9 93902590 93902590 CPU-migrations: 0 93902590 93902590 page-faults: 104 93902590 93902590 cycles: 4284725 76202392 76202392 stalled-cycles-frontend: 0 76202392 76202392 stalled-cycles-backend: 0 76202392 76202392 instructions: 0 76202392 76202392 branches: 0 76202392 76202392 branch-misses: 0 76202392 76202392 Performance counter stats for 'echo linaro': 93.902590 task-clock # 0.282 CPUs utilized 9 context-switches # 0.000 M/sec 0 CPU-migrations # 0.000 M/sec 104 page-faults # 0.001 M/sec 4284725 cycles # 0.046 GHz * 0 stalled-cycles-frontend # 0.00% frontend cycles idle 0 stalled-cycles-backend # 0.00% backend cycles idle 0 instructions # 0.00 insns per cycle 0 branches # 0.000 M/sec 0 branch-misses # 0.00% of all branches * 0.332550049 seconds time elapsed Can anybody give me suggestions?How can I use perf to get the value of hardware performance counter
Using a recent 3.4.19 kernel I am unable to reproduce your results:
context-switches: 0 8941650 8941650 CPU-migrations: 0 8941650 8941650 page-faults: 147 8941650 8941650 cycles: 2665204 8941650 8941650 stalled-cycles-frontend: 365973 8941650 8941650 stalled-cycles-backend: 1748465 8941650 8941650 instructions: 1368842 8941650 8941650 branches: 152838 8941650 8941650 branch-misses: 53924 8941650 8941650
Performance counter stats for 'echo linaro':
8.941650 task-clock # 0.740 CPUs utilized 0 context-switches # 0.000 K/sec 0 CPU-migrations # 0.000 K/sec 147 page-faults # 0.016 M/sec 2665204 cycles # 0.298 GHz 365973 stalled-cycles-frontend # 13.73% frontend cycles idle 1748465 stalled-cycles-backend # 65.60% backend cycles idle 1368842 instructions # 0.51 insns per cycle # 1.28 stalled cycles per insn 152838 branches # 17.093 M/sec 53924 branch-misses # 35.28% of all branches
0.012084973 seconds time elapsed
Significant changes were made the the counter/event kernel code about the time of the release. I do not believe they made it in in time. Please try simply using a slightly more recent kernel.
-- David Long Kernel Engineer, TI Landing Team Linaro
Thanks for your reply ,David Long. Can you give me url of the kernel version 3.4.19?Thanks.
2012/12/5 David Long dave.long@linaro.org
On 12/04/12 13:46, Scott Bambrough wrote:
- Dave Long
On Tue, Dec 4, 2012 at 3:37 AM, Peng Fan <xfan87@gmail.com mailto: xfan87@gmail.com> wrote:
I use the option `-v`, and I can see that the first number of branches, instructions branch-misses and so on is zero.why? root@android:/ # perf stat -v echo "linaro" linaro task-clock: 93902590 93902590 93902590 context-switches: 9 93902590 93902590 CPU-migrations: 0 93902590 93902590 page-faults: 104 93902590 93902590 cycles: 4284725 76202392 76202392 stalled-cycles-frontend: 0 76202392 76202392 stalled-cycles-backend: 0 76202392 76202392 instructions: 0 76202392 76202392 branches: 0 76202392 76202392 branch-misses: 0 76202392 76202392 Performance counter stats for 'echo linaro': 93.902590 task-clock # 0.282 CPUs utilized 9 context-switches # 0.000 M/sec 0 CPU-migrations # 0.000 M/sec 104 page-faults # 0.001 M/sec 4284725 cycles # 0.046 GHz * 0 stalled-cycles-frontend # 0.00% frontend cycles idle 0 stalled-cycles-backend # 0.00% backend
cycles idle 0 instructions # 0.00 insns per cycle 0 branches # 0.000 M/sec 0 branch-misses # 0.00% of all branches *
0.332550049 seconds time elapsed Can anybody give me suggestions?How can I use perf to get the value of hardware performance counter
Using a recent 3.4.19 kernel I am unable to reproduce your results:
context-switches: 0 8941650 8941650 CPU-migrations: 0 8941650 8941650 page-faults: 147 8941650 8941650 cycles: 2665204 8941650 8941650 stalled-cycles-frontend: 365973 8941650 8941650 stalled-cycles-backend: 1748465 8941650 8941650 instructions: 1368842 8941650 8941650 branches: 152838 8941650 8941650 branch-misses: 53924 8941650 8941650
Performance counter stats for 'echo linaro':
8.941650 task-clock # 0.740 CPUs utilized 0 context-switches # 0.000 K/sec 0 CPU-migrations # 0.000 K/sec 147 page-faults # 0.016 M/sec 2665204 cycles # 0.298 GHz 365973 stalled-cycles-frontend # 13.73% frontend cycles
idle 1748465 stalled-cycles-backend # 65.60% backend cycles idle 1368842 instructions # 0.51 insns per cycle # 1.28 stalled cycles per insn 152838 branches # 17.093 M/sec 53924 branch-misses # 35.28% of all branches
0.012084973 seconds time elapsed
Significant changes were made the the counter/event kernel code about the time of the release. I do not believe they made it in in time. Please try simply using a slightly more recent kernel.
-- David Long Kernel Engineer, TI Landing Team Linaro
On 12/05/12 00:32, Peng Fan wrote:
Thanks for your reply ,David Long. Can you give me url of the kernel version 3.4.19?Thanks.
I suggest checking out the "tilt-3.4" branch of git://git.linaro.org/landing-teams/working/ti/kernel.git
That is based on 3.4.20.
git clone git://git.linaro.org/landing-teams/working/ti/kernel.git cd kernel git checkout --track tilt-3.4
Looks like omap4plus_defconfig already has what you need for hardware perf counters.
-- David Long Kernel Engineer, TI Landing Team Linaro
Thanks. I use this command git checkout --track remotes/origin/tilt-3.4
Perf does give me the value of performance counter.But when execute the command perf stat -v echo "linaro" , context-switches is 0. Following is the full result. root@(none):/# ./perf stat -v echo "linaro" linaro task-clock: 1464844 1464844 1464844 context-switches: 0 1464844 1464844 CPU-migrations: 0 1464844 1464844 page-faults: 121 1464844 1464844 cycles: 1738255 1464844 1464844 stalled-cycles-frontend: 349665 1464844 1464844 stalled-cycles-backend: 1308413 1464844 1464844 instructions: 637447 1464844 1464844 branches: 62121 1464844 1464844 branch-misses: 31739 1464844 1464844
Performance counter stats for 'echo linaro':
1.464844 task-clock # 0.787 CPUs utilized * 0 context-switches # 0.000 M/sec 0 CPU-migrations # 0.000 M/sec * 121 page-faults # 0.083 M/sec 1738255 cycles # 1.187 GHz 349665 stalled-cycles-frontend # 20.12% frontend cycles idle 1308413 stalled-cycles-backend # 75.27% backend cycles idle 637447 instructions # 0.37 insns per cycle # 2.05 stalled cycles per insn 62121 branches # 42.408 M/sec 31739 branch-misses # 51.09% of all branches
0.001861593 seconds time elapsed
Is there any kernel version supports both complete performance counters and android?Because I want to use perf when running android program.Thanks.
2012/12/5 David Long dave.long@linaro.org
On 12/05/12 00:32, Peng Fan wrote:
Thanks for your reply ,David Long. Can you give me url of the kernel version 3.4.19?Thanks.
I suggest checking out the "tilt-3.4" branch of git://
git.linaro.org/landing-**teams/working/ti/kernel.githttp://git.linaro.org/landing-teams/working/ti/kernel.git
That is based on 3.4.20.
git clone git://git.linaro.org/landing-**teams/working/ti/kernel.githttp://git.linaro.org/landing-teams/working/ti/kernel.git cd kernel git checkout --track tilt-3.4
Looks like omap4plus_defconfig already has what you need for hardware perf counters.
-- David Long Kernel Engineer, TI Landing Team Linaro
linaro-kernel@lists.linaro.org