GSoC Project | Basic Support for Trace Compass

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 18 09:46:34 UTC 2019


On 18/07/2019 11:28, Ravindra Kumar Meena wrote:
>     I would use two structures for this in C, one for the compact header
>     and
>     one for the large header. I would not use bit fields in C.
> 
> Without bit fields how I would assign it exact 27-bit timestamp?

You open the C book that you already organized and have a look into the 
chapter that introduces integers and operators.

> 
> It is mentioned on https://diamon.org/ctf/#ex-variants that we can use 
> union in C for variant data-type.

Yes, but the union will not help you much at the producer side. Either 
the event has a compact header or a long header. The event id determines 
which header variant is used. At least this is how I understood this. I 
may be wrong.

> 
> In metadata enum in header_compact is defined like this:
> enum : uint5_t { compact = 0 ... 30, extended = 31 } id;
> It has two members. The compact members has range from 0 to 31 but we 
> can't define range in enum members in C

Don't use an enum. Just build up the 32-bit integer from the two parts, 
the 5-bit id and the 27-bit timestampl.

> 
> 
>     You have to figure out how the 27-bit timestamp works. It must relative
>     to some reference point.
> 
> I looked into the Trace Compass example. The content in the binary file 
> is formatted as follow:
> 
> <magic><uuid><stream_id><stream_instance_id><packet_context>
> This much we have already achieved.
>   Now
> 
> < 8-bit data. It is always in 31( 1F )> 

This is probably the event id 32 part.

<32-bit event_id> <64-bit
> timestamp> <event_fields>

This looks like the large header.

> 
> Now after this
> 
> <32-bit data> <event_fields> again <32-bit data> <event_fields> agina < 
> 32-bit data> <event_fields> ....
> 
> I am not able to understand what this <32-bit data> is between every 
> <event_fields>

I guess this is the event-specific payload.

> 
> 
>     How is the id used? We are interested in the sched_switch events.
> 
> Okay
> 
> 
> -- 
> *Ravindra Kumar Meena*,
> B. Tech. Computer Science and Engineering,
> Indian Institute of Technology (Indian School of Mines) 
> <https://www.iitism.ac.in/>, Dhanbad

-- 
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