[lttng-dev] Limit on the number of arguments in TP_ARGS
Kienan Stewart
kstewart at efficios.com
Wed Aug 7 11:28:38 EDT 2024
Hi Shahar,
On 8/7/24 10:03 AM, Shahar Hochma via lttng-dev wrote:
> Hi,
> I've been using LTTNG traces and I was trying to create events with more
> than 10 arguments. But, I'm having an issue where this seems to fail in
> compilation with a cryptic error when I define more than 10 arguments in
> TP_ARGS. >
> I assume the issue is that there are some macros that are only defined
> up to 10 arguments. I didn't see any documentation of this limit or any
> mention of this anywhere, and I wanted to know if there is maybe a way
> to get around this.
That's correct the macros are only defined for up to 10 arguments. This
was initially due to a desire to maintain compatibility with SDT, which
also had a 10 argument limit. That limit is now slightly higher (12) in
recent versions of SDT.
The limit is documented here[1]. There's also previous mailing list
threads[2], and here is the relevant portion[3] of the source code.
>
> Of course I can combine arguments to struts or define 2 events instead
> of one. But I wanted to know if there is a native way to resolve this.
>
The canonical way to do this is to use a structure. Using two events
would also work, but I think it's slightly more desirable to use fewer
events (especially if you want to keep the data together).
> Thanks.
thanks,
kienan
[1]: https://lttng.org/man/3/lttng-ust/v2.13/#doc-tracepoint-event
[2]: https://lists.lttng.org/pipermail/lttng-dev/2023-November/030673.html
[3]:
https://github.com/lttng/lttng-ust/blob/5d10459b6b5182fcbc98240d9dace026c87a5037/include/lttng/tracepoint.h#L76
>
>
>
> _______________________________________________
> 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