RTEMS User Level Tracing?

Isaac Gutekunst isaac.gutekunst at vecna.com
Mon Dec 21 15:38:15 UTC 2015



On 12/20/2015 08:02 PM, Chris Johns wrote:
> On 19/12/2015 6:36 AM, isaac.gutekunst wrote:
>>
>> We're interested in trace some application data in our RTEMS project.
>> Here's a bunch of background and thoughts:
>>
>> I've read the following pages:
>>      * https://devel.rtems.org/wiki/Developer/Tracing
>>      * https://devel.rtems.org/wiki/Developer/Tracing/Trace_Linker
>>
>> I think I have an understanding of the current system as documented.
>> Tracing user defined data types seems to be missing. I'm looking for
>> something more like barectf. Is there any such support available, or any
>> plans to support it? I don't want to reinvent the wheel.
>
> User defined data is not directly support but can be added if you add a
> custom generator. There is not a great deal of documentation about how
> to do this. An example generator is:
>
>   https://git.rtems.org/rtems-tools/tree/linkers/rtld-trace-buffer.ini
>
Cool. I'll take a closer look at this.
> You could add anything specific you want. It is not a great solution but
> tracing into data being passed by pointers is difficult.
>
Definitely. You quickly come to the great serialization problem, and are bound to reinvent the 
wheel a few times.
> You would need to use the various options to get a copy of the trace
> wrapper file and then get the generator to see the headers and various
> data you want.
>
>> If there isn't support already, maybe some parts of the trace
>> infrastructure can be reused, notably the backed for storing the data,
>> and/or sending it out over the network. Are there plans to make the
>> Trace Linker natively output CTF data?
>
> We would like to support CTF output. Getting this done would need
> developer funding.

We would like tracing for at least user defined data, and will be developing that 
functionality. If we could do so in a way that helps the existing RTEMS trace, we'd love to.

>
>> Perhaps barectf could be used for this purpose.
>
> I do not know what this. Do you have a reference?
>
https://github.com/efficios/barectf

It takes in a YAML file, and generates a C file with functions that allow tracing user defined 
structs. It will output those to a custom "backend" in serialized form. The documentation is 
pretty good. I've used in briefly in a bare metal PIC32 project with success.

A potential plan of action:
1) Make a barectf backend for RTEMS. (This could re-use existing features). Probably 
package/make it available via RSB.
2) Update the trace linker to use it (I don't really know what this means just yet).
3) Make a mechanism/ document a standard way to integrate trace with a user application. I'd 
imagine this could involve a RSB package, although it's rather simple (yaml file becomes a C 
and H file that needs to be linked against a 'backend').

4) For the ARM architecture, using the ITM to output data could be very useful. This could fit 
somewhere into this picture.

I would be doing most or all of the work here, unless of course anyone wants to help.

I'm looking for ideas and suggestions. If there is some functionality of direction you'd like 
us to pursue, let me know.

Thanks,

Isaac

> Chris
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>


More information about the devel mailing list