Re: [PATCH v2 1/2] tracing/hist: rebuild full_name on each hist_field_name() call

Steven Rostedt
2026-04-08T02:13:26Z

On Wed, 8 Apr 2026 10:15:00 +0800
Pengpeng Hou <pengpeng@iscas.ac.cn> wrote:

> Hi Steve,
>
> Thanks for looking at this.
>
> I believe this path is reachable.
>
> field->system is set when a VAR_REF is created with an event-qualified
> reference. The assignment happens in init_var_ref(), which is called
> from create_var_ref().
>
> The parser accepts fully qualified references of the form
>
> system.event.$var
>
> and parse_expr() passes the parsed system/event strings into
> create_var_ref(). trace_action_create() also accepts explicitly
> qualified action parameters in the same form and passes those strings
> into create_var_ref().
>
> This is also documented in Documentation/trace/histogram.rst:
>
> fully-qualified name is of the form 'system.event_name.$var_name'
> or 'system.event_name.field'.

Ah I read the document and missed this part. Thanks for pointing it out.

None of our tests use this, so that definitely needs to be fixed.

OK, yeah I can trigger that path now. I'll continue looking at the patch.

Thanks,

-- Steve

>
> The path is user-visible because reading back the trigger goes through
>
> event_hist_trigger_print() -> hist_field_print() -> hist_field_name()
>
> so creating a hist trigger that uses an inter-event variable reference
> in fully qualified form is enough to exercise it.
>
> So I don't think this is dead code. If you would prefer a different way
> of handling the printed name, I can respin accordingly, but I don't
> think the current branch is unreachable.
>
> Thanks,
> Pengpeng
>