[DTrace-devel] [PATCH v4 1/7] cg: move get_member() to dt_cg.c
Alan Maguire
alan.maguire at oracle.com
Wed Jul 9 19:47:48 UTC 2025
On 09/07/2025 17:47, Kris Van Hees wrote:
> Woops, one more.
>
> On Wed, Jul 09, 2025 at 12:28:15PM -0400, Kris Van Hees wrote:
>> Some comments below... Sorry - I got distracted by the other patches and
>> failed to give this one attention.
>>
>> On Wed, Jul 09, 2025 at 03:46:54PM +0100, Alan Maguire via DTrace-devel wrote:
>>> It will be used by both dt_prov_ip.c and dt_prov_tcp.c.
>>>
>>> Signed-off-by: Alan Maguire <alan.maguire at oracle.com>
>>> Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
>>> ---
>>> libdtrace/dt_cg.c | 39 ++++++++++++++++++++++++++++++++++++
>>> libdtrace/dt_cg.h | 2 ++
>>> libdtrace/dt_prov_ip.c | 45 ++++--------------------------------------
>>> 3 files changed, 45 insertions(+), 41 deletions(-)
>>>
>>> diff --git a/libdtrace/dt_cg.c b/libdtrace/dt_cg.c
>>> index bd0763d6..d6fc8259 100644
>>> --- a/libdtrace/dt_cg.c
>>> +++ b/libdtrace/dt_cg.c
>>> @@ -1901,6 +1901,45 @@ dt_cg_ctf_offsetof(const char *structname, const char *membername,
>>> return (ctm.ctm_offset / NBBY);
>>> }
>>>
>>> +/*
>>> + * Retrieve the value of a member in a given struct.
>>> + *
>>> + * Entry:
>>> + * reg = TYPE *ptr
>>> + *
>>> + * Return:
>>> + * %r0 = ptr->member
>>> + * Clobbers:
>>> + * %r1 .. %r5
>>> + */
>>> +int
>>> +dt_cg_get_member(dt_pcb_t *pcb, const char *name, int reg,
>>> + const char *member)
>
> Why is dt_cg_get_member() returning int? Nothing looks at it anyway. ANd
> with the change to use dt_cg_ctf_offset(), compilation error will be repotred
> from there.
>
all sounds good; I've removed the return value and refactored as you
suggest, all working now. I'll hold off on sending an updated v5 patch
series since this one's only just out the door. Thanks!
Alan
More information about the DTrace-devel
mailing list