From: Nick Alcock <nick.alcock@oracle.com>
To: Kris Van Hees <kris.van.hees@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [DTrace-devel] [PATCH v4 3/5] cg: add argument mapping in the trampoline
Date: Mon, 04 Nov 2024 16:41:59 +0000 [thread overview]
Message-ID: <87y11zgdd4.fsf@esperi.org.uk> (raw)
In-Reply-To: <ZyVx5oA+nJSqzctw@oracle.com> (Kris Van Hees's message of "Fri, 1 Nov 2024 20:27:18 -0400")
On 2 Nov 2024, Kris Van Hees uttered the following:
> On Fri, Nov 01, 2024 at 03:57:10PM +0000, Nick Alcock via DTrace-devel wrote:
>> + /*
>> + * Work from saved args so we don't need to worry about overwriting regs
>> + * we're about to map into different positions.
>> + */
>> + dt_cg_tramp_save_args(pcb);
>
> I still maintain that this should be done in the caller. (See patch 4/5 for
> more info on that.) As mentioned before, you can mention in the comment before
> this function that the caller must save the arguments, just like you already
> mention that %r7 must contain a value set by dt_cg_tramp_prologue*().
I think this is gross and just asking for trouble later, but fixed for
the sake of avoiding argument.
>> @@ -5060,7 +5089,12 @@ dt_cg_array_op(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
>> * array index according to the static argument mapping (if any),
>> * unless the argument reference is provided by a dynamic translator.
>> * If we're using a dynamic translator for args[], then just set dn_reg
>> - * to an invalid reg and return: DIF_OP_XLARG will fetch the arg later.
>
> You dropped the end of a sentence without replacing it with anything?
Argh! Fixed.
>> + *
>> + * If dt_cg_tramp_map_args is in use, you should apply the mapping at
>> + * the probe_info stage, since the effective "native" arg positions will
>> + * be changed.
>
> This does not belong here. If anything, clauses get compiled separete from
> trampolines and a given clause (compiled once) may get used in more than one
> BPF program, i.e. it may get associated with more than one trampoline. So
> you can't really depend on what a specific trampoline does when generating code
> for a clause.
... well, we *do*. All over the place.
But instructions to the caller don't really belong here in any case:
dropped. dt_cg_tramp_map_args's header comment already notes it, and
that's the right place for it.
--
NULL && (void)
next prev parent reply other threads:[~2024-11-04 16:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 15:57 [PATCH v4 0/5] usdt typed args, translators and arg remapping Nick Alcock
2024-11-01 15:57 ` [PATCH v4 1/5] usdt: get arg types and xlations into DTrace from the DOF Nick Alcock
2024-11-01 23:46 ` [DTrace-devel] " Kris Van Hees
2024-11-02 0:14 ` Kris Van Hees
2024-11-04 15:26 ` Nick Alcock
2024-11-01 15:57 ` [PATCH v4 2/5] dtprobed: stop skipping zero-tracepoint probes in dof_stash.c Nick Alcock
2024-11-01 15:57 ` [PATCH v4 3/5] cg: add argument mapping in the trampoline Nick Alcock
2024-11-02 0:27 ` [DTrace-devel] " Kris Van Hees
2024-11-04 16:41 ` Nick Alcock [this message]
2024-11-01 15:57 ` [PATCH v4 4/5] usdt: typed args and arg mapping Nick Alcock
2024-11-02 1:09 ` Kris Van Hees
2024-11-04 16:38 ` Nick Alcock
2024-11-01 15:57 ` [PATCH v4 5/5] usdt: fix create_underlying error path Nick Alcock
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=87y11zgdd4.fsf@esperi.org.uk \
--to=nick.alcock@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=kris.van.hees@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