Hi,
Can you confirm that the event is listed if you run 'perf list' e.g. on my Juno board running the perf list command results as follows:-
mleach@linaro-developer:~/perf-tools$ ./perf list
List of pre-defined events (to be used in -e):
branch-instructions OR branches [Hardware event] branch-misses [Hardware event]
----- snip -----
armv8_cortex_a57/sw_incr/ [Kernel PMU event] armv8_cortex_a57/ttbr_write_retired/ [Kernel PMU event] cs_etm// [Kernel PMU event]
rNNN [Raw hardware event descriptor] cpu/t1=v1[,t2=v2,t3 ...]/modifier [Raw hardware event descriptor] (see 'man perf-list' on how to encode it)
mem:<addr>[/len][:access] [Hardware breakpoint]
As you can see, running a x-compiled aarch64 perf on an aarch64 target results in the cs_etm// event being listed as available.
Similarly on my aarch64 target I can run ldd perf and see the libraries required include libcstrace:-
mleach@linaro-developer:~/perf-tools$ ldd ./perf linux-vdso.so.1 (0x0000ffff88974000) libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff8893a000) librt.so.1 => /lib/aarch64-linux-gnu/librt.so.1 (0x0000ffff88923000) libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffff88882000) libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffff8886f000) libcstraced_c_api.so => ./libs-rel/libcstraced_c_api.so (0x0000ffff8884e000) libcstraced.so => ./libs-rel/libcstraced.so (0x0000ffff887bc000) libstdc++.so.6 => ./libs-rel/libstdc++.so.6 (0x0000ffff88633000) libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff884e6000) /lib/ld-linux-aarch64.so.1 (0x0000aaaaca60d000) libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffff884c3000)
I would also advise double checking the command path to ensure that you are running the version of perf that you think you are.
Regards
Mike
On 4 August 2017 at 14:38, yoma sophian sophian.yoma@gmail.com wrote:
hi Mathieu:
My first guess would be that variable CSTRACE_PATH wasn't defined when compiling the perf tools, and as such the functionality is not enabled. The HOWTO.md on gitHub explains how to do all that.
I did export CSTRACE_PATH while cross-compiling perf. But still get unsupported event message: "# ./perf record -e cs_etm/@f0106000.etf/ --per-thread uname invalid or unsupported event: 'cs_etm/@f0106000.etf/"
When finish cross-compiling perf, I purposely use arm-linux-gnueabihf-readelf and get dynamic section information as below: (Could we conclude that below "***" shows "CSTRACE_PATH" is set properly?)
====================================================== Dynamic section at offset 0x16c4c8 contains 33 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libpthread.so.0] 0x00000001 (NEEDED) Shared library: [librt.so.1] 0x00000001 (NEEDED) Shared library: [libm.so.6] 0x00000001 (NEEDED) Shared library: [libdl.so.2] 0x00000001 (NEEDED) Shared library: [libcstraced_c_api.so] --> *** 0x00000001 (NEEDED) Shared library: [libcstraced.so] --> *** 0x00000001 (NEEDED) Shared library: [libstdc++.so.6] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x00000001 (NEEDED) Shared library: [ld-linux-armhf.so.3] 0x0000000c (INIT) 0x138e0 0x0000000d (FINI) 0x12d5ec 0x00000019 (INIT_ARRAY) 0x18c348 0x0000001b (INIT_ARRAYSZ) 8 (bytes) 0x0000001a (FINI_ARRAY) 0x18c350 =========================================================
I use below git commit version of perf and opencsd: a. perf-master: commit 27ecd6f2b547 ("coresight: etr: Add barrier packet for synchronisation") b. opencsd : commit 4f068b1c94db ("opencsd: Trace return stack debug messages off by default.")
And cross-compile command like below:
cd /media/sdb1/software/opencsd/my-opencsd/decoder/build/linux; make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean; make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- DEBUG=1 -j4; make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4; cd ../../../; cd /media/sdb1/software/opencsd/perf-opencsd-master; export CSTRACE_PATH=/media/sdb1/software/opencsd/my-opencsd/decoder make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C tools/perf/ clean -j4; make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C tools/perf/ DEBUG=1 V=1 -j4; =============================================================
Appreciate your kind help, _______________________________________________ CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight