Skip to content

tracing: Override trace_instance parameter

Masami Hiramatsu (Google) linux-doc linux-kselftest linux-trace-kernel lkml 3 versions – New

Get series with b4
b4 am 179094973121.609715.2103310055830923648.stgit@devnote2

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesNew
  2. v22 patches 1 replySuperseded
  3. v12 patches 0 repliesSuperseded

Changes in v3 from the cover letter

[01/02]
- Count the number of instances in enable_instances().
- Check whether source instance exists before the backup instance.
- Fix memmap_area leaking across loop iterations.
- Add array index range check for boot_instances array.
[02/02]
- Add test cases for overriding memory-mapped instances (@trace).
- Add test cases for overriding backup instances (=source).
- Add test cases for multiple tabs and empty strings.

[1] https://lore.kernel.org/all/178649540853.438282.4271870161169100680.stgit@devnote2/

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tracing: Override the same name trace_instance= by latter oneDocumentation/admin-guide/kernel-parameters.txt Documentation/trace/debugging.rst kernel/trace/trace.c+135 -370 replies
2/2selftests/ftrace: Add test case for overriding trace_instance parametertools/testing/selftests/ftrace/boottime/bootconfigs/cmdline-07-trace-instance-override.bconf tools/testing/selftests/ftrace/boottime/cmdlines/cmdline-07-trace-instance-override.cmdline tools/testing/selftests/ftrace/boottime/run_boottime_test.sh +1 more+155 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] tracing: Override trace_instance parameter

Hi,

Here is the 3rd version of the patches to change the "trace_instance=" kernel parameter to be overridden by later parameters.
The previous version is here:

https://lore.kernel.org/all/179091984881.537422.15308457677039592540.stgit@devnote2/

This version fixes some issues pointed by Sashiko and add more selftests. (the selftest is optional.)

Currently if the user specifies the same name trace_instance at boot time, the later one is skipped.
However, this does not allow user to override the trace_instance setting via bootloader if user specifies the default trace_instance in the bootconfig, because the bootconfig parameter is prepended to the kernel cmdline. (IOW, the bootconfig expects kernel parameters follow a LAST_WIN policy.)

To fix this issue, [01/02] splits the command line parsing loop and trace instance initialization loop. The parser checks the overlap of the trace instance name and overrides with the later one if those have the same name.

This series also includes a test set as [02/02], which is based on the ftrace boottime test patchset [1], currently on probes/core.

Detailed changes are here:

Changes in v3:
[01/02]
- Count the number of instances in enable_instances().
- Check whether source instance exists before the backup instance.
- Fix memmap_area leaking across loop iterations.
- Add array index range check for boot_instances array.
[02/02]
- Add test cases for overriding memory-mapped instances (@trace).
- Add test cases for overriding backup instances (=source).
- Add test cases for multiple tabs and empty strings.

[1] https://lore.kernel.org/all/178649540853.438282.4271870161169100680.stgit@devnote2/

Thank you,

---
base-commit: b15df7805dc52555e7c867d33a496edf5be11289

Masami Hiramatsu (Google) (2):
tracing: Override the same name trace_instance= by latter one selftests/ftrace: Add test case for overriding trace_instance parameter

 Documentation/admin-guide/kernel-parameters.txt    |    7 +
 Documentation/trace/debugging.rst                  |   15 ++
 kernel/trace/trace.c                               |  150 +++++++++++++++-----
 .../cmdline-07-trace-instance-override.bconf       |    4 +
 .../cmdline-07-trace-instance-override.cmdline     |    1 
 .../selftests/ftrace/boottime/run_boottime_test.sh |    2 
 .../tests/cmdline-07-trace-instance-override.sh    |  148 ++++++++++++++++++++
 7 files changed, 290 insertions(+), 37 deletions(-)
 create mode 100644 tools/testing/selftests/ftrace/boottime/bootconfigs/cmdline-07-trace-instance-override.bconf
 create mode 100644 tools/testing/selftests/ftrace/boottime/cmdlines/cmdline-07-trace-instance-override.cmdline
 create mode 100755 tools/testing/selftests/ftrace/boottime/tests/cmdline-07-trace-instance-override.sh

--
Masami Hiramatsu (Google) <[email protected]>