public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: Eugene Loh <eugene.loh@oracle.com>, dtrace@lists.linux.dev
Cc: dtrace-devel@oss.oracle.com
Subject: Re: [PATCH v2 2/4] dt_impl: bump number of TSLOTS to 8
Date: Thu, 3 Jul 2025 16:18:08 +0100	[thread overview]
Message-ID: <7e2c55b0-9472-42cb-86d0-23b1e5e01ea4@oracle.com> (raw)
In-Reply-To: <2d8d7b61-29ef-04ae-bffd-0dcb0709a106@oracle.com>

On 02/07/2025 21:22, Eugene Loh wrote:
> On 7/2/25 10:52, Alan Maguire wrote:
> 
>> On 01/07/2025 19:31, Eugene Loh wrote:
>>> Very simple patch, but one key problem.  The changed line is preceded by
>>> a huge comment block that goes to excruciating pains to explain why the
>>> value should be 4.  So, I'm fine with the change itself and I think the
>>> "Because of the complexity..." sentence in the commit message can be
>>> dropped, but the comment block in the file needs to be updated to
>>> explain (with corresponding pains?) why we need 8 (not 9, not 7).
>>>
>> Ah good catch, forgot to do this. I actually think 6 is enough.
>> The additional seems to be a result of the various complex inet_ntoa*()
>> calls in the tcp.d translators; some have ternary operators with
>> multiple inet_ntoa*()s. The origin appears to be dt_cg_ternary_op() and
>> that has the comment:
>>
>>          /*
>>           * Strings complicate things a bit because dn_left and dn_right
>> might
>>           * actually be temporary strings (tstring) *and* in different
>> slots.
>>           * We need to allocate a new tstring to hold the result, and
>> copy the
>>           * value into the new tstring (and free any tstrings in
>> dn_left and
>>           * dn_right).
>>           */
>>
>> So if we have a left and right ternary and both allocate 3 tstring slots
>> for inet_ntoa*()s that means 3*2 = 6 tstring slots should actually be
>> enough. Additional testing suggests that is so; does the above make
>> sense or are there additional things to consider here?
> 
> Ha!  I do not know;  I prefer NOT to have a headache.  But maybe there
> should also be some tstring stress test using inet_ntoa*() and ternary ops.
>

sure, I can add some tests to operators/tst.ternary.d

>> I'll update the
>> next version with a comment describing the above anyhow. Thanks for the
>> review!
>> Alan
>>
>>
>>> On 6/10/25 09:58, Alan Maguire wrote:
>>>> Because of the complexity of the TCP translators, more tslots are
>>>> needed.
>>>>
>>>> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
>>>> ---
>>>>    libdtrace/dt_impl.h | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/libdtrace/dt_impl.h b/libdtrace/dt_impl.h
>>>> index 68fb8ec5..10424f9c 100644
>>>> --- a/libdtrace/dt_impl.h
>>>> +++ b/libdtrace/dt_impl.h
>>>> @@ -218,7 +218,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)


  reply	other threads:[~2025-07-03 15:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 13:58 [PATCH v2 0/4] DTrace TCP provider Alan Maguire
2025-06-10 13:58 ` [PATCH v2 1/4] dtrace: move get_member() to dt_cg.c Alan Maguire
2025-07-01 18:23   ` Eugene Loh
2025-06-10 13:58 ` [PATCH v2 2/4] dt_impl: bump number of TSLOTS to 8 Alan Maguire
2025-07-01 18:31   ` Eugene Loh
2025-07-02 14:52     ` Alan Maguire
2025-07-02 20:22       ` Eugene Loh
2025-07-03 15:18         ` Alan Maguire [this message]
2025-06-10 13:58 ` [PATCH v2 3/4] dtrace: add tcp provider Alan Maguire
2025-07-01 23:16   ` Eugene Loh
2025-07-02 15:06     ` Alan Maguire
2025-07-03  0:02       ` Eugene Loh
2025-07-03 15:03         ` Alan Maguire
2025-07-03 15:29         ` Kris Van Hees
2025-07-03 15:38           ` Kris Van Hees
2025-07-03 19:55   ` Eugene Loh
2025-07-07 18:44   ` Kris Van Hees
2025-06-10 13:58 ` [PATCH v2 4/4] dtrace: sync dlibs with tcp.d, ip.d and net.d changes Alan Maguire
2025-07-01 19:08 ` [PATCH v2 0/4] DTrace TCP provider Eugene Loh
2025-07-01 19:27   ` Kris Van Hees
2025-07-02 14:52     ` 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=7e2c55b0-9472-42cb-86d0-23b1e5e01ea4@oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=eugene.loh@oracle.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