Why define TP_ARGS in TRACEPOINT_EVENT_CLASS and in TRACEPOINT_EVENT_INSTANCE both?

154 Views Asked by At

I'm currently using LTTng for such performances issues, and I want to use TRACEPOINT_EVENT_CLASS and TRACEPOINT_EVENT_INSTANCE as well.

But I don't understand the 2.10 version's documentation. I wonder why we need to define TP_ARGS in each event instance as well as defining it in the event class. Because we can't modify TP_FIELDS to change the type of any field, or compose it from many arguments.

1

There are 1 best solutions below

0
JonathanR On

The TP_ARGS() portion of a TRACEPOINT_EVENT_INSTANCE is used to validate that each instance matches the TRACEPOINT_EVENT_CLASS. See ust-tracepoint-event.h for more context.

I recommend that you repost your question on our mailing list/irc channel so that we can have an actual discussion regarding this. The maintainer of lttng-ust and lttng-modules, Compudj will surely provide more context and might even be open to the introduction of a new macro allowing event instance declaration without the TP_ARGS() portion.