Skip to content

tracing: Synthetic event dynamic string fixes

Tom Zanussi lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 6 repliesIn review
  2. v27 patches 7 repliesSuperseded
  3. v15 patches 11 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7tracing: Don't show dynamic string internals in synthetic event descriptionkernel/trace/trace_events_synth.c+9 -10 replies
2/7tracing: Move is_good_name() from trace_probe.h to trace.hkernel/trace/trace.h kernel/trace/trace_probe.h+13 -130 replies
3/7tracing: Check that the synthetic event and field names are legalkernel/trace/trace_events_synth.c+9 -00 replies
4/7tracing: Add synthetic event error loggingkernel/trace/trace_events_synth.c+90 -21 reply
5/7selftests/ftrace: Change synthetic event name for inter-event-combined testtools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc+4 -40 replies
6/7tracing: Handle synthetic event array field type checking correctlykernel/trace/trace_events_synth.c+9 -30 replies
7/7selftests/ftrace: Add test case for synthetic event syntax errorstools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc+19 -04 replies

Reviews trailers per patch

3 of 7 patches have a Reviewed-by or Acked-by.

PatchMasami Hiramatsu
SeriesT-b
1/7
2/7A-b
3/7R-b T-b
4/7
5/7A-b
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/7] tracing: Synthetic event dynamic string fixes

This updates v2 to replace some of the v2 code with improved code from Steve (tracing: Add synthetic event error logging) and (tracing:
Handle synthetic event array field type checking correctly) and remove the synth_error_clear() function and change last_cmd_set() to use strncpy.

Thanks,

Tom

v2 text:

This updates v1 to fix a couple of additional things that Masami pointed out:

- The error logging for the BAD_TYPE error was actually pointing to the name - it now points to the type as it should.

- Added a new test case that verifies most of the synthetic event error messages and caret positions.

- Added a new patch that correctly strips off trailing semicolons and everything else from array types, which wasn't happening before, even before the dynamic array patches.

Original v1 text:

These patches provide fixes for the problems observed by Masami in the new synthetic event dynamic string patchset.

The first patch (tracing: Don't show dynamic string internals in synthetic event description) removes the __data_loc from the event description but leaves it in the format.

The patch (tracing: Add synthetic event error logging) addresses the lack of error messages when parse errors occur.

The remaining three patches address the other problems Masami noted which result from allowing illegal characters in synthetic event and field names when defining an event. The is_good_name() function is used to check that's not possible for the probe events, but should also be used for the synthetic events as well.

(tracing: Move is_good_name() from trace_probe.h to trace.h) makes that function available to other trace subsystems by putting it in trace.h. (tracing: Check that the synthetic event and field names are legal) applies it to the synthetic events, and (selftests/ftrace:
Change synthetic event name for inter-event-combined test) changes a testcase that now fails because it uses an illegal name.

The following changes since commit 848183553e431e6e9c2ea2f72421a7a1bbc6532e:

tracing: Fix synthetic print fmt check for use of __get_str() (2020-10-08 15:29:07 -0400)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/zanussi/linux-trace.git ftrace/dynstring-fixes-v3

Tom Zanussi (7):
tracing: Don't show dynamic string internals in synthetic event
description
tracing: Move is_good_name() from trace_probe.h to trace.h
tracing: Check that the synthetic event and field names are legal
tracing: Add synthetic event error logging selftests/ftrace: Change synthetic event name for inter-event-combined
test
tracing: Handle synthetic event array field type checking correctly selftests/ftrace: Add test case for synthetic event syntax errors

 kernel/trace/trace.h                          |  13 ++
 kernel/trace/trace_events_synth.c             | 123 +++++++++++++++++-
 kernel/trace/trace_probe.h                    |  13 --
 .../trigger-inter-event-combined-hist.tc      |   8 +-
 .../trigger-synthetic_event_syntax_errors.tc  |  19 +++
 5 files changed, 153 insertions(+), 23 deletions(-)
 create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic_event_syntax_errors.tc
Signature · 1 line
2.17.1