Skip to content

perf tools: Add switch-output size and time threshold options

Jiri Olsa lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest0 of 7 patches 0 repliesNew
  2. v17 patches 12 repliesSuperseded

Changes in v2 from the cover letter

- some patches already accepted
- add warning for switched size lower than ring buffer wakeup size
- got Wang Nan's Tested-by, but did not include it
due to changes I made in v2

Patches in v2 No applies recorded yet

None of the 7 patches the cover letter announces are in this archive.

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCHv2 0/7] perf tools: Add switch-output size and time threshold options

hi,
adding a way to configure switch data output
for size and time, like:

  $ sudo perf record -e 'sched:*' --switch-output=10M -avg
  callchain: type FP
  switch-output with 10M size threshold
  mmap size 528384B
  [ perf record: dump data: Woken up 37 times ]
  [ perf record: Dump perf.data.2017010309135512 ]
  [ perf record: dump data: Woken up 39 times ]
  [ perf record: Dump perf.data.2017010309135771 ]
  [ perf record: dump data: Woken up 38 times ]
  [ perf record: Dump perf.data.2017010309140005 ]
  ^C[ perf record: Woken up 16 times to write data ]
  [ perf record: Dump perf.data.2017010309140111 ]
  [ perf record: Captured and wrote 4.748 MB perf.data.<timestamp> ]
  ...

the default for switch-output option stays and does the SIGUSR2 output switch

v2 changes:
- some patches already accepted
- add warning for switched size lower than ring buffer wakeup size
- got Wang Nan's Tested-by, but did not include it
due to changes I made in v2

Also available in:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/fixes

thanks,
jirka

Cc Wang Nan <[email protected]>

---
Jiri Olsa (6):
perf tools: Add unit_number__scnprint function
perf record: Add struct switch_output
perf record: Change switch-output option to take optional argument perf record: Add switch-output size option argument perf record: Add switch-output size warning
perf record: Add switch-output time option argument

 tools/perf/Documentation/perf-record.txt |  14 +++++++--
 tools/perf/builtin-record.c              | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
 tools/perf/tests/Build                   |   1 +
 tools/perf/tests/builtin-test.c          |   4 +++
 tools/perf/tests/tests.h                 |   1 +
 tools/perf/tests/unit_number__scnprint.c |  37 ++++++++++++++++++++++
 tools/perf/util/evlist.c                 |  10 ++++--
 tools/perf/util/evlist.h                 |   2 ++
 tools/perf/util/util.c                   |  13 ++++++++
 tools/perf/util/util.h                   |   1 +
 10 files changed, 219 insertions(+), 18 deletions(-)
 create mode 100644 tools/perf/tests/unit_number__scnprint.c