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

Yonghong Yan yanyh15 at gmail.com
Wed Nov 29 20:51:29 EST 2023


Hi Kienan,

Thank you very much for the information and solution.

Best,
Yonghong



On Tue, Nov 28, 2023 at 10:20 AM Kienan Stewart <kstewart at efficios.com>
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
> > lttng-dev at lists.lttng.org
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20231129/19da5300/attachment.htm>


More information about the lttng-dev mailing list