<div dir="ltr"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Kienan, </div><div><br></div><div>Thank you very much for the information and solution. </div><div><br></div><div>Best,</div><div>Yonghong</div><div><br></div><div dir="ltr"><div dir="ltr"><p style="font-size:12.8px"></p></div><div dir="ltr"></div></div></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 28, 2023 at 10:20 AM Kienan Stewart <<a href="mailto:kstewart@efficios.com">kstewart@efficios.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Yonghong,<br>
<br>
My understanding is that the limit of 10 trac epoint arguments was <br>
initially chosen because it matched with the argumente limit in SDT <br>
probe points and there is optional integration between LTTng trace <br>
points and SDT. More recent versions of SDT, as of 1.7+, support up to <br>
12 arguments for probe points.<br>
<br>
Beyond that, there may be standards/compiler-specific limits for the <br>
number of parameters to macros and/or function calls, but I don't think <br>
we're close to hitting any of those.<br>
<br>
Note that the LTTNG_UST_TRACEPOINT_FIELDS macro doesn't share the same <br>
10 field limit.<br>
<br>
Therefore, one work-around that is possible to to pack the values into a <br>
custom structure to reduce the number of arguments that need to be set <br>
in the lTTNG_UST_TRACEPOINT_ARGS macro.<br>
<br>
eg.<br>
<br>
```<br>
LTTNG_UST_TRACEPOINT_EVENT(<br>
tp,<br>
many,<br>
LTTNG_UST_TP_ARGS(<br>
const struct Sample*, mystruct<br>
),<br>
LTTNG_UST_TP_FIELDS(<br>
lttng_ust_field_integer(int, a, mystruct->a)<br>
lttng_ust_field_integer(int, b, mystruct->b)<br>
lttng_ust_field_integer(int, c, mystruct->c)<br>
lttng_ust_field_integer(int, e, mystruct->d)<br>
lttng_ust_field_integer(int, f, mystruct->e)<br>
lttng_ust_field_float(double, g, mystruct->g)<br>
lttng_ust_field_float(double, h, mystruct->h)<br>
lttng_ust_field_float(double, i, mystruct->i)<br>
lttng_ust_field_float(double, j, mystruct->j)<br>
lttng_ust_field_float(double, k, mystruct->k)<br>
lttng_ust_field_string(string_field, mystruct->thing)<br>
lttng_ust_field_string(string_field2, mystruct->thing2)<br>
)<br>
)<br>
<br>
```<br>
<br>
Hope this helps!<br>
<br>
thanks,<br>
kienan<br>
<br>
On 2023-11-27 22:26, Yonghong Yan via lttng-dev wrote:<br>
> I have a situation where I need to record more than 10 fields. If you <br>
> can extend it to support more, but not introduce overhead of handling <br>
> such rare cases, that will be great.<br>
> <br>
> Thanks<br>
> Yonghong<br>
> <br>
> <br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br>
> <a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
</blockquote></div>