* [lttng-dev] Any particular reason that the LTTNG_UST_TRACEPOINT_EVENT args and fields are limited to max 10?
@ 2023-11-28 3:26 Yonghong Yan via lttng-dev
2023-11-28 15:20 ` Kienan Stewart via lttng-dev
0 siblings, 1 reply; 3+ messages in thread
From: Yonghong Yan via lttng-dev @ 2023-11-28 3:26 UTC (permalink / raw)
To: lttng-dev
[-- Attachment #1.1: Type: text/plain, Size: 194 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 564 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] 3+ messages in thread
* Re: [lttng-dev] Any particular reason that the LTTNG_UST_TRACEPOINT_EVENT args and fields are limited to max 10?
2023-11-28 3:26 [lttng-dev] Any particular reason that the LTTNG_UST_TRACEPOINT_EVENT args and fields are limited to max 10? Yonghong Yan via lttng-dev
@ 2023-11-28 15:20 ` Kienan Stewart via lttng-dev
2023-11-30 1:51 ` Yonghong Yan via lttng-dev
0 siblings, 1 reply; 3+ messages in thread
From: Kienan Stewart via lttng-dev @ 2023-11-28 15:20 UTC (permalink / raw)
To: Yonghong Yan, lttng-dev
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@lists.lttng.org
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lttng-dev] Any particular reason that the LTTNG_UST_TRACEPOINT_EVENT args and fields are limited to max 10?
2023-11-28 15:20 ` Kienan Stewart via lttng-dev
@ 2023-11-30 1:51 ` Yonghong Yan via lttng-dev
0 siblings, 0 replies; 3+ messages in thread
From: Yonghong Yan via lttng-dev @ 2023-11-30 1:51 UTC (permalink / raw)
To: Kienan Stewart; +Cc: lttng-dev
[-- Attachment #1.1: Type: text/plain, Size: 2408 bytes --]
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@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@lists.lttng.org
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
[-- Attachment #1.2: Type: text/html, Size: 3543 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] 3+ messages in thread
end of thread, other threads:[~2023-11-30 1:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28 3:26 [lttng-dev] Any particular reason that the LTTNG_UST_TRACEPOINT_EVENT args and fields are limited to max 10? Yonghong Yan via lttng-dev
2023-11-28 15:20 ` Kienan Stewart via lttng-dev
2023-11-30 1:51 ` Yonghong Yan via lttng-dev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox