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

McDermott, Andrew Andrew.McDermott at windriver.com
Wed Oct 24 07:21:55 EDT 2012


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

Thanks,
Andy.


More information about the lttng-dev mailing list