[DTrace-devel] [PATCH v5 3/6] cg: add argument mapping in the trampoline

Nick Alcock nick.alcock at oracle.com
Tue Nov 5 19:58:39 UTC 2024


On 5 Nov 2024, Kris Van Hees told this:

> On Tue, Nov 05, 2024 at 12:06:05AM +0000, Nick Alcock wrote:
>> +/*
>> + * Move arguments according to the mappings in the array of arguments given.
>> + * The original arguments are obtained from the saved regs, and overwritten, so
>> + * the regs must be saved in advance of this call.  In effect, this changes the
>> + * native arguments: the caller should adjust the mappings array accordingly,
>> + * and shuffle the native arg types to match.
>
> This is confusing...  How about;
>
> "Populate the probe arguments based on the provided dt_argdesc_t array.
>  The caller must save the arguments because argument mapping copies values from
>  the saved arguments to the  current arguments.  After this function returns,
>  the caller should adjust the mapping to reflect that shuffling has been done."
>
> There is no need to talk about shuffling types because the dt_argdesc_t array
> already lists the correct types anyway.

Ah yeah, historical wart -- when that comment was written, it didn't.

Adjusted as you suggest.

-- 
NULL && (void)



More information about the DTrace-devel mailing list