All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: TP_ARGS for TRACEPOINT_EVENT_CLASS and TRACEPOINT_EVENT_INSTANCE
       [not found] <CACJEY862Ytj85N+sidwaq1JEQ+FCiAFo7x5JGuTb992mUrYkdg@mail.gmail.com>
@ 2018-12-20 16:55 ` Philippe Proulx
       [not found] ` <CAB4xu_0JxAfA9QtU-NHgtoTOh6c_eT+zQPBvXNr_HZgKE6GvWA@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Philippe Proulx @ 2018-12-20 16:55 UTC (permalink / raw)
  To: Yonghong Yan; +Cc: lttng-dev

On Thu, Dec 20, 2018 at 11:47 AM Yonghong Yan <yanyh15@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@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TP_ARGS for TRACEPOINT_EVENT_CLASS and TRACEPOINT_EVENT_INSTANCE
       [not found] ` <CAB4xu_0JxAfA9QtU-NHgtoTOh6c_eT+zQPBvXNr_HZgKE6GvWA@mail.gmail.com>
@ 2018-12-20 17:21   ` Yonghong Yan
       [not found]   ` <CACJEY84HU4jdKWdo_6ZJO88MYhHN7XvQ-2uDSQAjE-6L06zwiw@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Yonghong Yan @ 2018-12-20 17:21 UTC (permalink / raw)
  To: Philippe Proulx; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 1988 bytes --]

Then why bother to require to have the TP_ARGS in
TRACEPOINT_EVENT_INSTANCE?

Yonghong

On Thu, Dec 20, 2018 at 11:56 AM Philippe Proulx <eeppeliteloop@gmail.com>
wrote:

> On Thu, Dec 20, 2018 at 11:47 AM Yonghong Yan <yanyh15@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@lists.lttng.org
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>

[-- Attachment #1.2: Type: text/html, Size: 3194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TP_ARGS for TRACEPOINT_EVENT_CLASS and TRACEPOINT_EVENT_INSTANCE
       [not found]   ` <CACJEY84HU4jdKWdo_6ZJO88MYhHN7XvQ-2uDSQAjE-6L06zwiw@mail.gmail.com>
@ 2018-12-20 19:28     ` Mathieu Desnoyers
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2018-12-20 19:28 UTC (permalink / raw)
  To: Yonghong Yan; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 2982 bytes --]

This is due to limitations of the C preprocessor. We need to have the TP_ARGS() available 
both in the TRACEPOINT_EVENT_INSTANCE(), which generates the tracepoint prototype 
used to validate type compability of the tracepoint callsite within the application, and within 
TRACEPOINT_EVENT_CLASS() which is used to generate the probe callback with the 
correct arguments. 

Unfortunately, the C preprocessor does not allow much freedom when it comes to accessing 
arguments of another macro. 

Thanks, 

Mathieu 

----- On Dec 20, 2018, at 12:21 PM, Yonghong Yan <yanyh15@gmail.com> wrote: 

> Then why bother to require to have the TP_ARGS in TRACEPOINT_EVENT_INSTANCE?

> Yonghong

> On Thu, Dec 20, 2018 at 11:56 AM Philippe Proulx < [
> mailto:eeppeliteloop@gmail.com | eeppeliteloop@gmail.com ] > wrote:

>> On Thu, Dec 20, 2018 at 11:47 AM Yonghong Yan < [ mailto:yanyh15@gmail.com |
>> yanyh15@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
>> |
>> 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
>> > [ mailto:lttng-dev@lists.lttng.org | lttng-dev@lists.lttng.org ]
>>> [ https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev |
>> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ]

> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

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

[-- Attachment #1.2: Type: text/html, Size: 5214 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

* TP_ARGS for TRACEPOINT_EVENT_CLASS and TRACEPOINT_EVENT_INSTANCE
@ 2018-12-20 16:46 Yonghong Yan
  0 siblings, 0 replies; 4+ messages in thread
From: Yonghong Yan @ 2018-12-20 16:46 UTC (permalink / raw)
  To: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 1236 bytes --]

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?

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

[-- Attachment #1.2: Type: text/html, Size: 2261 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-20 19:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CACJEY862Ytj85N+sidwaq1JEQ+FCiAFo7x5JGuTb992mUrYkdg@mail.gmail.com>
2018-12-20 16:55 ` TP_ARGS for TRACEPOINT_EVENT_CLASS and TRACEPOINT_EVENT_INSTANCE Philippe Proulx
     [not found] ` <CAB4xu_0JxAfA9QtU-NHgtoTOh6c_eT+zQPBvXNr_HZgKE6GvWA@mail.gmail.com>
2018-12-20 17:21   ` Yonghong Yan
     [not found]   ` <CACJEY84HU4jdKWdo_6ZJO88MYhHN7XvQ-2uDSQAjE-6L06zwiw@mail.gmail.com>
2018-12-20 19:28     ` Mathieu Desnoyers
2018-12-20 16:46 Yonghong Yan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.