Re: [PATCH v7 0/6] tracing: More synthetic event error fixes

From: Tom Zanussi
Date: Tue Feb 09 2021 - 20:25:14 EST


Hi Steve,

On Tue, 2021-02-09 at 16:09 -0500, Steven Rostedt wrote:
> On Mon, 1 Feb 2021 13:48:10 -0600
> Tom Zanussi <zanussi@xxxxxxxxxx> wrote:
>
> > Hi,
> >
> > This is v7 of the synthetic event error fix patchset. This version
> > addresses the comments from v6:
> >
> > - moved check_command() from '[PATCH v6 3/6] tracing: Update
> > synth
> > command errors' to '[PATCH v6 2/6] tracing: Rework synthetic
> > event
> > command parsing'.
> >
> > - in __create_synth_event(), moved mutex_lock(&event_mutex) after
> > is_good_name() check and changed related error handling.
> >
> > - simplified check_command() a bit by calling argv_free() sooner
> > as
> > suggested by Steve.
> >
> > - added Steve's comment about check_field_version() into that
> > function and added additional comments to the caller.
> >
>
> After applying these, the following test fails:
>
> test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc
>

Did you apply '[PATCH v7 5/6] selftests/ftrace: Update synthetic event
syntax errors' before you ran the test? It actually removes the test
that failed. Here's what I get with all patches applied:

# ./ftracetest test.d/trigger/inter-event/
=== Ftrace unit tests ===
[1] event trigger - test inter-event histogram trigger expected fail
actions [XFAIL]
[2] event trigger - test field variable support [PASS]
[3] event trigger - test inter-event combined histogram trigger [PASS]
[4] event trigger - test multiple actions on hist trigger [PASS]
[5] event trigger - test inter-event histogram trigger onchange action
[PASS]
[6] event trigger - test inter-event histogram trigger onmatch action
[PASS]
[7] event trigger - test inter-event histogram trigger onmatch-onmax
action [PASS]
[8] event trigger - test inter-event histogram trigger onmax action
[PASS]
[9] event trigger - test inter-event histogram trigger snapshot action
[PASS]
[10] event trigger - test synthetic event create remove [PASS]
[11] event trigger - test inter-event histogram trigger trace action
with dynamic string param [PASS]
[12] event trigger - test synthetic_events syntax parser errors [PASS]
[13] event trigger - test synthetic_events syntax parser [PASS]
[14] event trigger - test inter-event histogram trigger trace action
[PASS]


# of passed: 13
# of failed: 0
# of unresolved: 0
# of untested: 0
# of unsupported: 0
# of xfailed: 1
# of undefined(test bug): 0

> It appears that:
>
> echo 'myevent char str[];; int v' > synthetic_events
>
> doesn't error after these changes.
>

Right, it shouldn't fail any more - that was one of the reasons for
reworking the parser, so things like that wouldn't fail.

My assumption, and the reason for adding '[PATCH v7 4/6] tracing: Add a
backward-compatibility check for synthetic event creation', was that we
didn't want previously-working things to suddenly start failing after
the rework, but not that things that used to fail would continue to
backwards-compatibly fail.

Tom

> -- Steve