[ltt-dev] Marker and trace point API with compound data types

Venkatesh Babu Chitlur Srinivasa (vchitlur) vchitlur at cisco.com
Tue Mar 22 16:25:42 EDT 2011


I was thinking, since the LTTng uses custom format string in markers, it
could be extended to support compound data types by introducing new
format specifiers. As this requires compiler extensions to format string
processing to verify the type of arguments at compile time, it may not
be well acceptable for general users.

I see that wrapping the structure declaration with a macro is better
than registering the compound data type that require user to define
marshalling of the fields. But this requires C structure parser logic to
process the fields and generate CTF metadata entries, which is only
called once from the constructor. This hides the complexity from the
end-user at the expense of complex parser in the core.

 Regards,
   VBabu 

-----Original Message-----
From: pdumas9 at sympatico.ca [mailto:pdumas9 at sympatico.ca] On Behalf Of
Mathieu Desnoyers
Sent: Monday, March 21, 2011 6:52 PM
To: Venkatesh Babu Chitlur Srinivasa (vchitlur)
Cc: ltt-dev at lists.casi.polymtl.ca
Subject: Re: [ltt-dev] Marker and trace point API with compound data
types

* Venkatesh Babu Chitlur Srinivasa (vchitlur) (vchitlur at cisco.com)
wrote:
> CTF v1.7 which was published earlier talks about compound data types
> (struct, variant, array, sequence, strings) in section 4.2. What are
the
> APIs to specify these compound data types with markers and trace
points
> ? Since markers relies on the format string to specify the data type,
it
> may not be possible. So is it only supported with trace points as
these
> compound data types can be passed as function arguments ?

Hi Venkatesh,

As you noticed, there is nothing part of the Markers that allows
recording compound data types, and nothing is planned in this respect.
Markers are more of a "debug-only" type of interface.

However, Tracepoints and TRACE_EVENT macros sitting on top of
Tracepoints are currently able to serialize dynamic arrays (sequences)
and statically-sized arrays (arrays). They will eventually also be able
to serialize structures received as parameter into an event field. The
way I envision supporting structure serialization within TRACE_EVENT is
by wrapping the structure declaration in a macro, and allowing the
tracer to gather the textual C-code description of the structure. Given
that CTF metadata is C99-compatible, we should be able to read and
understand the C structure from its C declaration copied into the CTF
metadata.

For now, variants will be mainly used to serialize the event header in a
very compact way, which is internal to the tracer. Maybe we'll find a
way to add support for it to TRACE_EVENT field types eventually.

Please don't hesitate to ask if you have more questions, your feedback
is very much appreciated,

Thanks,

Mathieu

> 
> Regards,
> 
>   VBabu
> 

> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev


-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list