Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: Yonghong Yan via lttng-dev <lttng-dev@lists.lttng.org>
To: Kienan Stewart <kstewart@efficios.com>
Cc: lttng-dev <lttng-dev@lists.lttng.org>
Subject: Re: [lttng-dev] Any particular reason that the LTTNG_UST_TRACEPOINT_EVENT args and fields are limited to max 10?
Date: Wed, 29 Nov 2023 20:51:29 -0500	[thread overview]
Message-ID: <CACJEY851bpw4rWODzQwa=WWz6sNTnN3C6iR+npikBikjPAVDUg@mail.gmail.com> (raw)
In-Reply-To: <c1d6a91f-f30f-4494-8b31-91deb2aa5ca7@efficios.com>


[-- 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

      reply	other threads:[~2023-11-30  1:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28  3:26 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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACJEY851bpw4rWODzQwa=WWz6sNTnN3C6iR+npikBikjPAVDUg@mail.gmail.com' \
    --to=lttng-dev@lists.lttng.org \
    --cc=kstewart@efficios.com \
    --cc=yanyh15@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox