Hi Maryem,
On 31 August 2017 at 13:07, Maryem Ayadi maryem.ayady@gmail.com wrote:
Hi Mike,
I just build a Linux Image and I want to know if it is necessary to integrate the Coresight Access Library in the Kernel Space and what are the necessary steps to follow ? Or is there any other solutions ?
There are instructions in the readme_demos.md file regarding requirements for using the CSAL with linux. Essentially you do not need to integrate with the kernel, but do need to enable mmap() access to the kernel memory by building your kernel with the configuration set as CONFIG_DEVMEM=y
You can use the example programs to look at the coresight ROM table (using csls) or dump trace using tracedemo. Again please read the documentation as you will have to write a CoreSight configuration routine for your system to use tracedemo.
Please also ensure that on your system the Coresight components are powered up, otherwise the demo programs will hang.
And how can we use this library in a bare-metal environment to identify and configure all Coresight components ?
For bare metal you will need to link the library to the software you are running on your baremetal system an write routines to program and operate the Coresight components as you require. You will need to know the base address of the CoreSight ROM table and use the cs_register_romtable() call to read the ROM table and register your components with the library. See csls.c for an example of this.
Regards
Mike
Best regards, Maryem
2017-08-11 14:11 GMT+01:00 Mike Leach mike.leach@linaro.org:
Hi Maryem,
CSTMC_TRACE_FIFI.bin is a buffer of coresight trace data - not a program binary that will work with objdump.
The snapshots directories are the results of trace capture runs - some using the CSAL test programs. The format of the .ini files is described in the decoder/docs/specs/ARM Trace and Debug Snapshot file format 0v2.pdf document
Regards
Mike
On 11 August 2017 at 10:18, Maryem Ayadi maryem.ayady@gmail.com wrote:
Hi Mike,
I got the difference between the libraries, thank you. So I'll be working with both soon. One more thing! I tried to output a disassembled sequence with objdump from the binary files within the directory snapshots ( i.e: snapshots/a57_single_step/CSTMC_TRACE_FIFO.bin) and it didn't work. The file format is not recognized. Any solution for that?
Best regards, Maryem Ayadi
2017-08-10 15:13 GMT+01:00 Mike Leach mike.leach@linaro.org:
Hi Maryem,
CSAL is a library can be used to program up CoreSight trace components and subsequently extract the trace data through the register interface. This library principally manipulates the register sets of Coresight components. This can be used in bare metal systems or on Linux by mmaping the hardware memory locations of the components. The library provides a few worked example programs illustrating the programming and extraction of trace data.
OpenCSD is a library that will process captured trace data into a generic output format - this is usually a list of instruction address ranges representing executed code. OpenCSD does not have the capability to program trace hardware for capture, nor convert the processed trace data into assembly language. This must be done using client programs. The DS-5 dumps you refer to were created using ARM's DS-5 debugger tool.
The key point here is that both CSAL and OpenCSD are libraries that are to be used as part of a larger program.
For example in the perf-opencsd-master Linux kernel tree we provide extensions to perf (which does not use CSAL, but uses the linux CoreSight drivers directly) that will capture trace data, and subsequently use the OpenCSD library to process that data. Using the 'perf script' command, and an appropriate python script (also supplied in the perf-opencsd-master), it is possible to process the trace data captured by perf, through the OpenCSD library to generate traced instruction ranges and then passthe traced instruction ranges to objdump to output a disassembled sequence.
Best Regards
Mike
On 10 August 2017 at 14:49, Maryem Ayadi maryem.ayady@gmail.com wrote:
Hi Mark,
I am working with the Opencsd library under linux in order to collect and decode the trace. I just discovered The CoreSight Access Library (CSAL) and I want to know what's the difference between both libraries. Besides, is it possible to work only with the opencsd library to collect and decode traces on-target?
I am also trying to generate trace data coded in assembly language like the contents of the files existing within decoder/tests/snapshots/juno_r1_1/ds-5-dumps in the Opencsd library. It would be helpful to send me any steps I should follow.
Best regards, Maryem Ayadi
-- Mike Leach Principal Engineer, ARM Ltd. Blackburn Design Centre. UK
-- Mike Leach Principal Engineer, ARM Ltd. Blackburn Design Centre. UK