GSoC Project | Basic Support for Trace Compass

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Jun 18 07:19:01 UTC 2019


On 18/06/2019 08:55, Ravindra Kumar Meena wrote:
>      > About a week ago I raised a query on decoder(source plugin) examples
>      > shared by them.
>      >
>      > They suggested that if we plan to use Babeltrace 2 plugin system,
>     the
>      > metadata file
>      > will be generated based on the trace representation given by the
>     source
>      > plugin.
>      >
>      > https://lists.lttng.org/pipermail/lttng-dev/2019-June/029057.html
>      >
>      > Please have a look
> 
>     Yes, this is why I asked about a TSDL description last week:
> 
>     https://lists.rtems.org/pipermail/devel/2019-June/026101.html
> 
>     Creating the metadata is one of the first actions a plugin must do
> 
> Okay.
> 
> I sent you one metadata file which had 1160 events. So should I add the 
> rtems 512 events in metadata?

At the moment a detailed description of individual events is not 
necessary. We have to get the basics in place first. So for now an 10 
bit event number is enough.

> 
> The problem I am facing here is how to relate the metadata file with 
> rtems event record item?

This depends on what you want to do. It seems the babeltrace plugin is a 
bit too complex to write at the moment. Maybe we should start with 
something simpler.

The record client in your rtems-tools repository does the following:

target --> TCP stream with struct rtems_record_items -> client -> 
conversion -> human readable text

We should turn this into:

target --> TCP stream with struct rtems_record_items -> client -> 
conversion -> CTF (metadata + event stream) -> files -> babeltrace -> 
human readable text

So the first thing we have to figure out is how babeltrace reads an 
arbitrary CTF session (metadata + event stream).

The next thing is to look at and modify print_item() in 
misc/record/record-main.c. In this function you get one client_item 
after another.

typedef struct client_item {
   union {
     SLIST_ENTRY( client_item ) free_node;
     RB_ENTRY( client_item )    active_node;
   };
   uint64_t                     ns;
   uint32_t                     cpu;
   rtems_record_event           event;
   uint64_t                     data;
   uint64_t                     counter;
} client_item;

We are only interested in ns, cpu, event and data. So just convert this to

typedef struct {
   uint64_t                     ns;
   uint32_t                     cpu;
   rtems_record_event           event;
   uint64_t                     data;
} ctf_event;

and append this item into a file (the event stream file). For this 
ctf_event you need a TSDL metadata. Save this metadata file.

Import the metadata and event stream in babeltrace and let it print a 
human readable form.

Does this look like something you can do?

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list