Re: [PATCH v3 4/4] tracing/probes: Fix to record 0-length data_loc in fetch_store_string*() if fails

From: Steven Rostedt
Date: Mon Jul 10 2023 - 20:16:46 EST


On Tue, 11 Jul 2023 09:05:15 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:

> > And this patch could have been:
> >
> > static nokprobe_inline void set_data_loc(int ret, void *dest, void *__dest, void *base)
> > {
> > *(u32 *)dest = make_data_loc(ret, __dest - base);
> > }
>
> and introduce it. I also want to put the ternary operator into set_data_loc() too
> for simplicity.
>
> static nokprobe_inline void set_data_loc(int ret, void *dest, void *__dest, void *base)
> {
> if (ret < 0)
> ret = 0;
> *(u32 *)dest = make_data_loc(ret, __dest - base);
> }
>

Sounds good.

-- Steve