[lttng-dev] TP_ARGS for TRACEPOINT_EVENT_CLASS and TRACEPOINT_EVENT_INSTANCE
Philippe Proulx
eeppeliteloop at gmail.com
Thu Dec 20 11:55:49 EST 2018
On Thu, Dec 20, 2018 at 11:47 AM Yonghong Yan <yanyh15 at gmail.com> wrote:
>
> I am looking at the following example from lttng-ust manual. The same TP_ARGS ( ... ) are repeated in both the TRACEPOINT_EVENT_CLASS and TRACEPOINT_EVENT_INSTANCE definition. My understanding is that it actually allows using different arguments, even in this example it is the same. Am I right?
No it does not: they need to match.
See <https://github.com/lttng/lttng-ust/commit/c75c0422c64f33c0102e1778cecc812c58b700e5>.
Phil
>
> I also like the feature of having one TP_ARGS in the TRACEPOINT_EVENT_CLASS that declares the arguments for several TRACEPOINT_EVENT_INSTANCE so we do not need to have TP_ARGS in TRACEPOINT_EVENT_INSTANCE. Is that possible?
>
> Thank you
> Yonghong
>
> TRACEPOINT_EVENT_CLASS(
> my_provider,
> my_tracepoint_class,
> TP_ARGS(
> int, my_integer_arg,
> struct app_struct *, app_struct_arg
> ),
> TP_FIELDS(
> ctf_integer(int, a, my_integer_arg)
> ctf_integer(unsigned long, b, app_struct_arg->b)
> ctf_string(c, app_struct_arg->c)
> )
> )
>
> TRACEPOINT_EVENT_INSTANCE(
> my_provider,
> my_tracepoint_class,
> event_instance1,
> TP_ARGS(
> int, my_integer_arg,
> struct app_struct *, app_struct_arg
> )
> )
>
> TRACEPOINT_EVENT_INSTANCE(
> my_provider,
> my_tracepoint_class,
> event_instance2,
> TP_ARGS(
> int, my_integer_arg,
> struct app_struct *, app_struct_arg
> )
> )
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
More information about the lttng-dev
mailing list