Re: Having trouble profiling multiple events for an existing process in ARM CortexA53
William Cohen <[email protected]> Tue, 30 Apr 2019 21:22:04 -0400
| Newsgroups | gmane.linux.oprofile |
|---|---|
| Message-ID | <[email protected]> |
On 4/29/19 2:37 PM, Jerry Duan via oprofile-list wrote:
> Hi,
> I am trying to use Oprofile (1.3.0) to get some cache miss rate for our application in our platform (ARMv8 CortexA53, kernel 4.9.0, Yocto). It is kind of working now. But, when using operf to profile multiple events for an existing process, it always failed to start profiling by saying the target program is already ended.
>
> $operf --vmlinux /boot/vmlinux-4.9.0 --events L2D_CACHE:5000:0:1:1,L2D_CACHE_REFILL:5000:0:1:1 -p 3253
> events L2D_CACHE:5000:0:1:1,L2D_CACHE_REFILL:5000:0:1:1 -p 3253x /boot/vmlinux-4.9.0 --
> !!!! No samples collected !!!
> The target program/command ended before profiling was started.
> operf record init failed
> usage: operf [ options ] [ --system-wide | --pid <pid> | [ command [ args ] ] ]
> $
>
> Am I doing something wrong? Could someone shed a light for me?
>
> But I don't have any issue if I profile only one event (i.e, L2D_CACHE,L2D_CACHE_WB or L2D_CACHE_REFILL) for the same existing process,at least the operf started profiling and opreport gave me some result.
>
> $operf --vmlinux /boot/vmlinux-4.9.0 --events L2D_CACHE:5000:0:1:1 -p 3253
> operf: Press Ctl-c or 'kill -SIGINT 4800' to stop profiling
> operf: Profiler started
> ^C
> Profiling done.
> $ opreport
> Using /mnt/localdisk/oprofile_data/samples/ for samples directory.
> CPU: ARM Cortex-A53, speed 1200 MHz (estimated)
> Counted L2D_CACHE events (Level 2 data cache access) with a unit mask of 0x00 (No unit mask) count 5000
> L2D_CACHE:5000|
> samples| %|
> ------------------
> 39594 100.000 wl4app
> L2D_CACHE:5000|
> samples| %|
> ------------------
> 15632 39.4807 myapp
> 15191 38.3669 vmlinux-4.9.0
> 3578 9.0367 libc-2.24.so
> 2732 6.9000 libzmq.so.5.0.1
> 1624 4.1016 libpthread-2.24.so
> 327 0.8259 libczmq.so.4.0.2
> 287 0.7249 [vdso] (tgid:3253 range:0x7fa4845000-0x7fa4845fff)
> 180 0.4546 libmemTrace.so.0.0.0
> 31 0.0783 librt-2.24.so
> 6 0.0152 ld-2.24.so
> 3 0.0076 libcrypto.so.1.0.2
> 2 0.0051 mylib
> 1 0.0025 libsystemd.so.0.15.0
> $
> $operf --vmlinux /boot/vmlinux-4.9.0 --events L2D_CACHE_REFILL:5000:0:1:1 -p 3253
> operf: Press Ctl-c or 'kill -SIGINT 4831' to stop profiling
> operf: Profiler started
> ^C
> Profiling done.
> $
>
> $ operf --version
> operf: oprofile 1.3.0 compiled on Apr 25 2019 12:06:54
> $
>
> Regards,
> Jerry
Hi,
What particular armv8 SoC are you using? In theory all the cortex a53 processors should have the same pmu hardware with 6 programmable counters, but I wonder if this processor might be limited to one programmable counter or whether some other driver in the system is reserving the counters such as "perf -a -e ...". Is there anything else on the machine that might be reserving counters such a watchdog? You might take a look through the dmesg output for a something that looks like the following stating the number of performance counters that are available:
[ 1.571915] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
Also if you are using a device tree file make sure that it properly describes the performance monitoring hardware. In the past incorrect descriptions have prevented
I tried something similar on a dragonboad 410c, a 96board with 4 cortext a53 processors. It is much newer 5.0.9 kernel. Maybe there is something going on in the kernel that is preventing both events from being set at the same time. Below is the output.
$ rpm -q oprofile
oprofile-1.3.0-1.fc29.aarch64
$ sudo operf --vmlinux /usr/lib/debug/lib/modules/5.0.9-200.fc29.aarch64/vmlinux --events L2D_CACHE:5000:0:1:1,L2D_CACHE_REFILL:5000:0:1:1 -p 1896 --
operf: Press Ctl-c or 'kill -SIGINT 11648' to stop profiling
operf: Profiler started
^C^Cwaitpid for operf-record process failed: Interrupted system call
^Cwaitpid for operf-read process failed: Interrupted system call
Error running profiler
[wcohen@localhost ~]$ opreport
Using /home/wcohen/oprofile_data/samples/ for samples directory.
CPU: ARM Cortex-A53, speed 57 MHz (estimated)
Counted L2D_CACHE events (Level 2 data cache access) with a unit mask of 0x00 (No unit mask) count 5000
Counted L2D_CACHE_REFILL events (Level 2 data cache refill) with a unit mask of 0x00 (No unit mask) count 5000
L2D_CACHE:5000|L2D_CACHE_REFI...|
samples| %| samples| %|
------------------------------------
10529 99.4991 661 97.7811 du
L2D_CACHE:5000|L2D_CACHE_REFI...|
samples| %| samples| %|
------------------------------------
8808 83.6547 568 85.9304 vmlinux
876 8.3199 49 7.4130 libc-2.28.so
844 8.0160 43 6.5053 du
1 0.0095 1 0.1513 ld-2.28.so
30 0.2835 7 1.0355 rpm
L2D_CACHE:5000|L2D_CACHE_REFI...|
samples| %| samples| %|
------------------------------------
27 90.0000 6 85.7143 vmlinux
3 10.0000 1 14.2857 ld-2.28.so
23 0.2174 8 1.1834 bash
L2D_CACHE:5000|L2D_CACHE_REFI...|
samples| %| samples| %|
------------------------------------
20 86.9565 5 62.5000 vmlinux
2 8.6957 1 12.5000 bash
1 4.3478 2 25.0000 libc-2.28.so
-Will Cohen
_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list