Re: [lttng-dev] Any particular reason that the LTTNG_UST_TRACEPOINT_EVENT args and fields are limited to max 10?

Yonghong Yan via lttng-dev <[email protected]>
Newsgroups org.lttng.lists.lttng-dev
Message-ID <CACJEY851bpw4rWODzQwa=WWz6sNTnN3C6iR+npikBikjPAVDUg@mail.gmail.com>
Hi Kienan,

Thank you very much for the information and solution.

Best,
Yonghong



On Tue, Nov 28, 2023 at 10:20 AM Kienan Stewart <[email protected]>
wrote:

> Hi Yonghong,
>
> My understanding is that the limit of 10 trac epoint arguments was
> initially chosen because it matched with the argumente limit in SDT
> probe points and there is optional integration between LTTng trace
> points and SDT. More recent versions of SDT, as of 1.7+, support up to
> 12 arguments for probe points.
>
> Beyond that, there may be standards/compiler-specific limits for the
> number of parameters to macros and/or function calls, but I don't think
> we're close to hitting any of those.
>
> Note that the LTTNG_UST_TRACEPOINT_FIELDS macro doesn't share the same
> 10 field limit.
>
> Therefore, one work-around that is possible to to pack the values into a
> custom structure to reduce the number of arguments that need to be set
> in the lTTNG_UST_TRACEPOINT_ARGS macro.
>
> eg.
>
> ```
> LTTNG_UST_TRACEPOINT_EVENT(
>     tp,
>     many,
>     LTTNG_UST_TP_ARGS(
>        const struct Sample*, mystruct
>     ),
>     LTTNG_UST_TP_FIELDS(
>        lttng_ust_field_integer(int, a, mystruct->a)
>        lttng_ust_field_integer(int, b, mystruct->b)
>        lttng_ust_field_integer(int, c, mystruct->c)
>        lttng_ust_field_integer(int, e, mystruct->d)
>        lttng_ust_field_integer(int, f, mystruct->e)
>        lttng_ust_field_float(double, g, mystruct->g)
>        lttng_ust_field_float(double, h, mystruct->h)
>        lttng_ust_field_float(double, i, mystruct->i)
>        lttng_ust_field_float(double, j, mystruct->j)
>        lttng_ust_field_float(double, k, mystruct->k)
>        lttng_ust_field_string(string_field, mystruct->thing)
>        lttng_ust_field_string(string_field2, mystruct->thing2)
>     )
> )
>
> ```
>
> Hope this helps!
>
> thanks,
> kienan
>
> On 2023-11-27 22:26, Yonghong Yan via lttng-dev wrote:
> > I have a situation where I need to record more than 10 fields. If you
> > can extend it to support more, but not introduce overhead of handling
> > such rare cases, that will be great.
> >
> > Thanks
> > Yonghong
> >
> >
> > _______________________________________________
> > lttng-dev mailing list
> > [email protected]
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.