From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7LYqFrLqZ2WC7hIAWB0awg (envelope-from ) for ; Wed, 29 Nov 2023 20:51:46 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=lists.lttng.org header.i=@lists.lttng.org header.a=rsa-sha256 header.s=default header.b=qwWi8Kax; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4DE751E11B; Wed, 29 Nov 2023 20:51:46 -0500 (EST) Received: from lists.lttng.org (lists.lttng.org [167.114.26.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 121D11E091 for ; Wed, 29 Nov 2023 20:51:44 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1701309103; bh=UEBAO1K+vPJeg3cbB3m9NRfX07BYFC+QSKNZ7HDCFhc=; h=References:In-Reply-To:Date:To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=qwWi8KaxTfo0n3dYrcJqfn0XmTgzPnGjxNAQa+ciiYYtaqylkRNbycQsI4DhGO16p 0G/8AUDD5XGCN0QdliRS2o6Rg0CE6PQzVDxoPGfrZsNZmt0U9TSJ5Vrm8g5slcet8r eEh32Nltk2MRr2lqZRjydSKNuALrFItMiTjuGzX3Pt+niQHoIvxVTqyvenvj4FrJJP NfUmnWGRWRXx9mBgPU/NO3OU+vhvRMJPN51Ca5HNqk2WrdRjAMrT2wqXW9HjAgB4pC Lr/Z+Bz4rnbx/twZROzhU9EhJ6nqJBaDPqt7df1dQAg849r4bXOjHO3/sYWVXuUGOF Fvr3oDe1jj4aw== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4SgfLl2x9yzP1F; Wed, 29 Nov 2023 20:51:43 -0500 (EST) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lists.lttng.org (Postfix) with ESMTPS id 4SgfLk0mnlzNgn for ; Wed, 29 Nov 2023 20:51:41 -0500 (EST) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a0029289b1bso49751566b.1 for ; Wed, 29 Nov 2023 17:51:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701309101; x=1701913901; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jLDVbyo5OueLI88FzbNe/29EjYrPDMkA0j4DplIY7Vo=; b=o+YSEKEBCxCkiYo6LiTZp9bAfH3pyoEjh/SABOwHsBA3I2KPXVch1e+a6knBnMFPlU zj3Wz6vItEDqMe7VMpbKjC4lzEZ1ra1+/x06C0wx8ZJ4GrMDLJcwuTAq2iyweX0M6Qev djWf5vEL4vIueDvdZ7+ROC4jMS54Bse7bGilV3J10kAJzprH51iy6PeaEx9gSrBp5TaK 4SDB2cUgGKZPxzzuZRuAN1+euFAS+B3P5W/Zv5W+RaISeTR7mliJFSxm/uaP3z/d0CBt H4dPrZko6Ypoylt4KjpXgvfOS5QkpH3M3xObsdsmG2cKeW6mVodtCaWLAPUNEzaGhBay qGvQ== X-Gm-Message-State: AOJu0YwXH3IRgV62rE5UpjUfYjoR60DYyN3VgvG6K2uS/xTIBGreAwOL PyouXF2ufapQ18F/I7NIWSZWp1iuZb8yvph3YULr5Zev X-Google-Smtp-Source: AGHT+IE80GfMcodB8w8KYceQ/0JaVb+9HBfrsLekI+Sd0GAYPs2ABn2AS0rTbLAycZghl1Uni/3RvZo3kShD/uR0eyA= X-Received: by 2002:a17:906:10d:b0:a00:2686:6b40 with SMTP id 13-20020a170906010d00b00a0026866b40mr12063963eje.14.1701309100480; Wed, 29 Nov 2023 17:51:40 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 29 Nov 2023 20:51:29 -0500 Message-ID: To: Kienan Stewart Cc: lttng-dev Subject: Re: [lttng-dev] Any particular reason that the LTTNG_UST_TRACEPOINT_EVENT args and fields are limited to max 10? X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Yonghong Yan via lttng-dev Reply-To: Yonghong Yan Content-Type: multipart/mixed; boundary="===============0408751637798179146==" Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" --===============0408751637798179146== Content-Type: multipart/alternative; boundary="000000000000965c4d060b54e4ee" --000000000000965c4d060b54e4ee Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Kienan, Thank you very much for the information and solution. Best, Yonghong On Tue, Nov 28, 2023 at 10:20=E2=80=AFAM Kienan Stewart 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 > --000000000000965c4d060b54e4ee Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Kienan,=C2=A0

Thank you very much for the information and solutio= n.=C2=A0

Best,
Yonghong

<= /div>

On Tue, Nov 28, 2023 at 10:20=E2=80=AFAM 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(
=C2=A0 =C2=A0 tp,
=C2=A0 =C2=A0 many,
=C2=A0 =C2=A0 LTTNG_UST_TP_ARGS(
=C2=A0 =C2=A0 =C2=A0 =C2=A0const struct Sample*, mystruct
=C2=A0 =C2=A0 ),
=C2=A0 =C2=A0 LTTNG_UST_TP_FIELDS(
=C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_integer(int, a, mystruct->a)<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_integer(int, b, mystruct->b)<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_integer(int, c, mystruct->c)<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_integer(int, e, mystruct->d)<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_integer(int, f, mystruct->e)<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_float(double, g, mystruct->g)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_float(double, h, mystruct->h)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_float(double, i, mystruct->i)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_float(double, j, mystruct->j)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_float(double, k, mystruct->k)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_string(string_field, mystruct-&g= t;thing)
=C2=A0 =C2=A0 =C2=A0 =C2=A0lttng_ust_field_string(string_field2, mystruct-&= gt;thing2)
=C2=A0 =C2=A0 )
)

```

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-d= ev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailm= an/listinfo/lttng-dev
--000000000000965c4d060b54e4ee-- --===============0408751637798179146== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev --===============0408751637798179146==--