Linux DTrace development list
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: dtrace@lists.linux.dev
Cc: dtrace-devel@oss.oracle.com, Alan Maguire <alan.maguire@oracle.com>
Subject: [PATCH v3 2/7] cg: bump number of TSLOTS to 6
Date: Wed,  9 Jul 2025 15:09:43 +0100	[thread overview]
Message-ID: <20250709140948.15090-3-alan.maguire@oracle.com> (raw)
In-Reply-To: <20250709140948.15090-1-alan.maguire@oracle.com>

Because of the ternary operations using inet_ntoa*() in the
TCP translators more temporary string slots are needed.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
---
 libdtrace/dt_impl.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libdtrace/dt_impl.h b/libdtrace/dt_impl.h
index 2adc1252..b8c0f94c 100644
--- a/libdtrace/dt_impl.h
+++ b/libdtrace/dt_impl.h
@@ -203,14 +203,17 @@ typedef struct dt_kern_path {
 #define DT_DM_KERN_UNLOADED	0x8	/* module not loaded into the kernel */
 
 /*
- * Why do we need (only) 4 slots?  The maximum amount of string arguments to
+ * Why do we need 8 slots?  The maximum amount of string arguments to
  * any function is 2, and if the result is a string as well, that means we may
  * need 3 temporary strings during code generation for that function.
+ * However if operations like inet_ntoa6 are used in ternary operations we need 
+ * 2x the number of slots for left and right.
  *
  * Since string functions can be nested, we can (at most) end up with 1 tstring
  * (from a nested function for which we already generated code) along with a
  * nested function being processed which needs 3 temporary strings as mentioned
- * above.  That brings us to a total of 4.
+ * above.  That brings us to a total of 4, but since the ternary case requires
+ * 2x we need 8 in total.
  *
  * Each tstring needs to be large enough to hold the largest possible string
  * and accomodate the largest known need for tstring space in subroutines.
@@ -222,7 +225,7 @@ typedef struct dt_kern_path {
  * - cleanpath() holds a prepended '/' char, a string, an appended '/' char,
  *   and a terminating NUL char, or STRSZ + 3 chars altogether
  */
-#define DT_TSTRING_SLOTS	4
+#define DT_TSTRING_SLOTS	8
 #define DT_TSTRING_SIZE(dtp)	\
 		MAX(P2ROUNDUP((dtp)->dt_options[DTRACEOPT_STRSIZE] + 3, 8), \
 		    72)
-- 
2.39.3


  parent reply	other threads:[~2025-07-09 14:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 14:09 [PATCH v3 0/7] DTrace TCP provider Alan Maguire
2025-07-09 14:09 ` [PATCH v3 1/7] cg: move get_member() to dt_cg.c Alan Maguire
2025-07-21 20:37   ` [DTrace-devel] " Kris Van Hees
2025-07-09 14:09 ` Alan Maguire [this message]
2025-07-21 20:39   ` [DTrace-devel] [PATCH v3 2/7] cg: bump number of TSLOTS to 6 Kris Van Hees
2025-07-09 14:09 ` [PATCH v3 3/7] test/operators: extend ternary tests to cover inet_ntoa*()s Alan Maguire
2025-07-09 14:09 ` [PATCH v3 4/7] providers: move network-generic definitions to net.d Alan Maguire
2025-07-09 14:09 ` [PATCH v3 5/7] tcp: new provider Alan Maguire
2025-07-09 14:09 ` [PATCH v3 6/7] dlibs: sync ip.d, net.d and tcp.d Alan Maguire
2025-07-09 14:09 ` [PATCH v3 7/7] unittest/tcp: update test.x Alan Maguire

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=20250709140948.15090-3-alan.maguire@oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    /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