[lttng-dev] registering user-defined properties on tracepoints

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Fri May 3 11:19:07 EDT 2013


* McDermott, Andrew (Andrew.McDermott at windriver.com) wrote:
> 
> Is it possible to add /other/ user-defined attributes to an event
> definition.  What I'm trying to do is associate other related
> properties/attributes to the event itself and on each field in the
> event.
> 
> In this example I'm choosing to encode my attributes using a JSON-like
> syntax, but the point is that this is really user-defined.
> 
>   TRACEPOINT_EVENT(foo, some_event,
> 	TP_ARGS(int, value),
>         TP_ATTRIBUTES("{ icon:some_event.png, helpIndex:docs/help/0001.html ... }")
> 	TP_FIELDS(ctf_integer(int, foo, foo, "{java_formatter:com.windriver.SomeEventFormatter, leftAdjust:1, mask:64, ... }"))
>   )
> 
> I could create an associated event:
> 
>   TRACEPOINT_EVENT(foo, some_event_metadata,
> 	TP_ARGS(char *, str),
> 	TP_FIELDS(ctf_string(char *, str))
>   )
> 
> and have some rules based on the event names to bind the two together
> but it seems "nicer" to keep them together.  My motivation is keeping
> this kind of auxiliary information available with the trace itself as
> opposed to some side-files which have the tendency to get out of sync.
> 
> Or perhaps this is another way of achieving this.  Any hints gratefully
> received...

I would advise adding this info similarly to what we do for EMF modeling
info, and loglevels, in UST tracepoints: adding a separate
TRACEPOINT_ATTRIBUTES(provider, name, ....), outside of
TRACEPOINT_EVENT. It's a much easier way to add new stuff without
breaking backward compatibility.

Thanks,

Mathieu

> 
> Thanks,
> Andy.
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list