[PATCH] libmisc/shell: Add the rtrace command for buffered tracing support.

Chris Johns chrisj at rtems.org
Mon Mar 30 03:01:19 UTC 2015


On 30/03/2015 2:34 am, Gedare Bloom wrote:
> Quick comments:

Thanks for the review.

> Avoid abbreviations but feel free to use acronyms in "rtems" APIs .

RTEMS is also an abbreviation ;)

These should really become rtems_trace_buffering_*. I will change.

I do not want to change the internal generator labels etc. While they
have a public scope they are not an API.

> Make sure acronyms are documented, what is TBG?

Trace Buffering Generator ..
https://devel.rtems.org/wiki/Developer/Tracing/Trace_Buffering. I will
add update the header file area.

> 
> If divide by 32 is on hot path might want to reconsider it if possible
> 

Are you referring to __rtld_tbg_is_enabled and __rtld_tbg_has_triggered
in the generator code ?

If so this code is a little tricky in what is happening. The generator
uses @FUNC_INDEX@ which is expanded for each wrapped trace function to a
const number, eg 0, 1 etc, and so `index` become a constant which means
the compiler does the maths and if it is any good should know the exact
address of the bit in the static array as well as the mask at compile
time. I checked the asm code on ARM and did not follow it but I know
from testing the trigger is specific. Have a look at the wiki page above
and the report at the end. The first record of the report is the trigger
function entry.

> A macro for the bit masks would improve readability
> 

I will add these once I get the code merged. The masks are also in here:

https://git.rtems.org/rtems-tools/tree/linkers/rtld-trace-buffer.ini

Once the vars header is in the repo and can reference it from the generator.

> I've seen this print timestamp functionality before in shell I think,
> might be worth sharing code

It is in the capture engine. I have one here to keep the functionality
independent.

Chris



More information about the devel mailing list