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.

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)

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!