Hi Mike,
On Mon, Mar 19, 2018 at 11:08:17AM +0200, Mike Bazov wrote:
Greetings, i was referred to this mailing list by Mathleu Poirler.
I'm recording Coresight using my Dragonboard 410c board, after compiling the perf-opencsd-master kernel.
I am using acme branch: https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
Recording seems to work on a simple program i did which does nothing but print a string to the screen.
Now, i use perf to hopefully decode the trace, but perf segfaults. I'll let you know that decoding using the sample trace given here: https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md
Does work.
I dived into the cs-trace-disasm.py script to see why exactly it doesn't work and i noticed this command causes the segfault: $ ~/linux/tools/perf/perf script --show-mmap-events
/lib/aarch64-linux-gnu/ld-2.26.so with build id 6516ef8fa13fcb739834af9e87fb5fe9df612096 not found, con> Segmentation fault (core dumped)
This command also segfaults:
$ ~/linux/tools/perf/perf report --stdio
/lib/aarch64-linux-gnu/ld-2.26.so with build id 6516ef8fa13fcb739834af9e87fb5fe9df612096 not found, con> (END)Segmentation fault (core dumped)
I have not seen segmentation fault issue, but it's good to share some my finding:
- I remembered if use kallsyms for kernel symbols, you need enable kernel configs:
CONFIG_PROC_KCORE=y CONFIG_PROC_VMCORE=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y
Also please note that the userspace has permission to export the complete kernel address info; IIRC, you need set '0' or '1' to below entry: echo 0 > /proc/sys/kernel/kptr_restrict
- If you want to specify kernel for importing kernel symbol table, like this command './perf report -k ./vmlinux --stdio', you might need notice this patch: https://www.spinics.net/lists/linux-perf-users/msg05576.html
If upper two methods work, I still think it might need root cause the segmentation fault issue and fix with extra patches.
Thanks, Leo Yan
But this command works:
$ ~/linux/tools/perf/perf report --stdio --dump
And i can see Coresight packets information when browsing the output.
My .debug directory looks like this:
~/.debug/ |-- [kernel.kallsyms] | `-- 1dc43d23817467d7717b19af07463af0d9a9bd83 | `-- kallsyms |-- [vdso] | `-- 18863444e4f3e2600f53e406421b2a0edd940888 | `-- vdso |-- bin | `-- check | `-- 31694f29996e06da12f63d6088ec6eb23b3079c4 | `-- elf `-- lib `-- aarch64-linux-gnu |-- ld-2.26.so | `-- 6516ef8fa13fcb739834af9e87fb5fe9df612096 | `-- elf `-- libc.so.6 `-- 06e99d8d6acabab0643e0f525ac561cf73db6498 `-- elf
Now, another need i wanted to ask is where can i find the code that uses OpenCSD to decode the trace and output instructions? eventually, i don't want to use perf, but rather use OpenCSD directly in my code to decode traces.
Not sure what to do here and how to proceed, i'll appreciate some help. Thank you all!
CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight