rtla/timerlat: Support actions on threshold and on end
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest9 patches 4 repliesIn review
- v18 patches 4 repliesSuperseded
Changes in v2 from the cover letter
- Dropped short options on suggestion from Arnaldo.
- Added documentation.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | rtla/timerlat: Introduce enum timerlat_tracing_modetools/ tools/ tools/ +1 more | +97 | 0 replies | |
| 2/9 | rtla/timerlat: Add action on threshold featuretools/ tools/ tools/ +3 more | +341 | 0 replies | |
| 3/9 | rtla/timerlat_bpf: Allow resuming tracingtools/ tools/ tools/ | +25 | 0 replies | |
| 4/9 | rtla/timerlat: Add continue actiontools/ tools/ tools/ +1 more | +100 | 0 replies | |
| 5/9 | rtla/timerlat: Add action on end featuretools/ tools/ tools/ | +65 | 0 replies | |
| 6/9 | rtla/tests: Check rtla output with greptools/ | +17 | 0 replies | |
| 7/9 | rtla/tests: Add tests for actionstools/ | +28 | 0 replies | |
| 8/9 | rtla/tests: Limit duration to maximum of 10stools/ tools/ tools/ | +10 | 0 replies | |
| 9/9 | Documentation/rtla: Add actions featureDocumentation/ | +64 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/9] rtla/timerlat: Support actions on threshold and on end
This series adds a feature that allows to user to specify certain kinds of "actions" to be executed at one of two places in the rtla
measurement: when tracing is stopped on latency threshold, and at the end of tracing.
Two new options are added: --on-threshold, and --on-end, taking the action as an argument. For example:
$ rtla timerlat hist -T 10 \ --on-threshold shell,command="echo Threshold" --on-end shell,command="echo Tracing stopped"
will print "Threshold" if a thread latency higher than 10 microseconds is reached, and "Tracing stopped" always at the end.
The list of possible actions is extensible and is covered in the commit messages. Later, a documentation patch series will be sent with clear explanation of every action and its syntax.
Notably, a special action "continue" resumes tracing. For example:
$ rtla timerlat hist -T 100 \ --on-threshold shell,command="echo Threshold" \ --on-threshold continue -d 10s
will print "Threshold" as many times as tracing is stopped after thread latency reaches 100us.
The feature was inspired by a case where collecting perf data on rtla latency overflow was required, which can be done by sending a signal to the perf process.
Example of this with Intel PT aux buffer:
$ perf record --cpu 0 -e intel_pt// -S -- rtla timerlat top -q -T 100 \ -c 0 --on-threshold signal,pid=parent,num=12 --on-theshold continue
In general, the feature is aiming to allow integration with external tooling. To implement even more flexibility, passing context to the shell through environmental variables, or even an entire scripting language with access to the rtla internals can be implemented if needed.
Changes since v1:
- Dropped short options on suggestion from Arnaldo.
- Added documentation.
Tomas Glozar (9):
rtla/timerlat: Introduce enum timerlat_tracing_mode rtla/timerlat: Add action on threshold feature rtla/timerlat_bpf: Allow resuming tracing rtla/timerlat: Add continue action rtla/timerlat: Add action on end feature rtla/tests: Check rtla output with grep rtla/tests: Add tests for actions rtla/tests: Limit duration to maximum of 10s Documentation/rtla: Add actions feature
.../tools/rtla/common_timerlat_options.rst | 64 +++++ tools/tracing/rtla/src/Build | 1 + tools/tracing/rtla/src/actions.c | 260 ++++++++++++++++++ tools/tracing/rtla/src/actions.h | 52 ++++ tools/tracing/rtla/src/timerlat.bpf.c | 13 +- tools/tracing/rtla/src/timerlat.c | 24 +- tools/tracing/rtla/src/timerlat.h | 24 +- tools/tracing/rtla/src/timerlat_bpf.c | 13 + tools/tracing/rtla/src/timerlat_bpf.h | 3 + tools/tracing/rtla/src/timerlat_hist.c | 140 +++++++--- tools/tracing/rtla/src/timerlat_top.c | 165 +++++++---- tools/tracing/rtla/tests/engine.sh | 21 +- tools/tracing/rtla/tests/hwnoise.t | 8 +- tools/tracing/rtla/tests/osnoise.t | 4 +- tools/tracing/rtla/tests/timerlat.t | 36 ++- 15 files changed, 712 insertions(+), 116 deletions(-) create mode 100644 tools/tracing/rtla/src/actions.c create mode 100644 tools/tracing/rtla/src/actions.h
Signature · 1 line
2.49.0