Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: Kienan Stewart via lttng-dev <lttng-dev@lists.lttng.org>
To: Shahar Hochma <shaharhoch@google.com>, lttng-dev@lists.lttng.org
Subject: Re: [lttng-dev] Limit on the number of arguments in TP_ARGS
Date: Wed, 7 Aug 2024 11:28:38 -0400	[thread overview]
Message-ID: <adda05bd-06e6-42da-8ee4-3a7487fe8814@efficios.com> (raw)
In-Reply-To: <CADoB5d61PHip7Rp2SyzooXg_EUC6x__OYXrndRmOy8Pb-2OBjw@mail.gmail.com>

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

      reply	other threads:[~2024-08-07 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07 14:03 Shahar Hochma via lttng-dev
2024-08-07 15:28 ` Kienan Stewart 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=adda05bd-06e6-42da-8ee4-3a7487fe8814@efficios.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=kstewart@efficios.com \
    --cc=shaharhoch@google.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