From: Eugene Loh <eugene.loh@oracle.com>
To: Alan Maguire <alan.maguire@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: Wed, 2 Jul 2025 16:22:27 -0400 [thread overview]
Message-ID: <2d8d7b61-29ef-04ae-bffd-0dcb0709a106@oracle.com> (raw)
In-Reply-To: <d886c84d-f208-465f-a95a-0f6f8133ef1a@oracle.com>
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.
> 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)
next prev parent reply other threads:[~2025-07-02 20:22 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 [this message]
2025-07-03 15:18 ` Alan Maguire
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=2d8d7b61-29ef-04ae-bffd-0dcb0709a106@oracle.com \
--to=eugene.loh@oracle.com \
--cc=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