Hi Mathieu & Christophe,
On Mon, Aug 27, 2018 at 11:35:16AM -0600, Mathieu Poirier wrote:
Good day Leo,
Please meet my new friend Christophe. He is from ST-Micro and is currently working on integrating the CS framework in their next platform. I would be grateful if you could share with him the instructions you have used to get STM doing on the dragon board and how you got the snapshot decoder to decode the traces.
Sure, my pleasure.
Below is detailed steps for using STM on DB410c board:
- Need apply one offline patch for DT binding for STM component (Thanks a lot for Chunyan for sharing this!).
Please see enclosed patch for this.
- In the kernel command line, please add 'nohlt' to ensure CPUs are not powered off;
- Enable STM path with SysFS nodes:
# echo 1 > /sys/bus/coresight/devices/825000.etf/enable_sink # echo 1 > /sys/bus/coresight/devices/802000.stm/enable_source
- Connect STM driver to Ftrace function tracer, so all Ftrace function trace data will be routed into STM:
# echo 802000.stm > /sys/class/stm_source/ftrace/stm_source_link # echo function > /sys/kernel/debug/tracing/current_tracer # echo schedule > /sys/kernel/debug/tracing/set_ftrace_filter
- Then the CoreSight STM will produce trace data, so we can get out the trace data with command:
# cp /dev/825000.etf ./cstrace.data
- Build OpenCSD repository on host PC side; if you want you also can do this on the target board with Debian rootFS.
$ git clone https://github.com/Linaro/OpenCSD -o my_opencsd $ cd my_opencsd/decoder/build/linux $ make LINUX64=1 DEBUG=1
- Copy the trace data to host PC side to the OpenCSD folder:
$ cd my_opencsd/decoder/tests/snapshots/stm_only $ cp cstrace.data ./cstraceitm.bin # replace the db410c data
- Change to 'STMTCSR(0x3A0)=0x00810007' in the file device_0.ini so this can match well with TCSR register value on DB410c.
- Decoding the trace data with snapshot mode in OpenCSD:
$ ../../bin/builddir/trc_pkt_lister
Christophe is also looking to get a trace snapshot that is known to be working properly to test in his environment.
Yeah, if have further question, please let me know.
Many thanks, Mathieu