Skip to content

rtla/timerlat: Stop on signal properly when overloaded

Tomas Glozar linux-trace-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5rtla: Add trace_instance_stoptools/tracing/rtla/src/trace.c tools/tracing/rtla/src/trace.h+9 -00 replies
2/5rtla/timerlat_hist: Stop timerlat tracer on signaltools/tracing/rtla/src/timerlat_hist.c+10 -10 replies
3/5rtla/timerlat_top: Stop timerlat tracer on signaltools/tracing/rtla/src/timerlat_top.c+11 -13 replies
4/5rtla/timerlat_hist: Abort event processing on second signaltools/tracing/rtla/src/timerlat_hist.c+8 -00 replies
5/5rtla/timerlat_top: Abort event processing on second signaltools/tracing/rtla/src/timerlat_top.c+8 -02 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by.

PatchGabriele Monaco
1/5
2/5
3/5
4/5
5/5T-b

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

Read the v1 thread

Cover letter [PATCH 0/5] rtla/timerlat: Stop on signal properly when overloaded

We have been seeing an issue where if rtla is run on machines with a high number of CPUs (100+), timerlat can generate more samples than rtla is able to process via tracefs_iterate_raw_events. This is especially common when the interval is set to 100us (rteval and cyclictest default) as opposed to the rtla default of 1000us, but also happens with the rtla default.

Currently, this leads to rtla hanging and having to be terminated with SIGTERM. SIGINT setting stop_tracing is not enough, since more and more events are coming and tracefs_iterate_raw_events never exits.

This patchset contains two changes:
- Stop the timerlat tracer on SIGINT/SIGALRM to ensure no more events are generated when rtla is supposed exit. This fixes rtla hanging and should go to stable.
- On receiving SIGINT/SIGALRM twice, abort iteration immediately with tracefs_iterate_stop, making rtla exit right away instead of waiting for all events to be processed. This is more of a usability feature: if the user is in a hurry, they can Ctrl-C twice (or once after the duration has expired) and exit immediately, discarding any events pending processing.

Note: I am sending those together only because the second one depends on the first. Also this should be fixed in osnoise, too.

In the future, two more patchsets will be sent: one to display how many events/samples were dropped (either left in tracefs buffer or by buffer overflow), one to improve sample processing performance to be on par with cyclictest (ideally) so that samples are not dropped in the cases mentioned in the beginning of the email.

Tomas Glozar (5):
rtla: Add trace_instance_stop
rtla/timerlat_hist: Stop timerlat tracer on signal rtla/timerlat_top: Stop timerlat tracer on signal rtla/timerlat_hist: Abort event processing on second signal rtla/timerlat_top: Abort event processing on second signal

 tools/tracing/rtla/src/timerlat_hist.c | 19 ++++++++++++++++++-
 tools/tracing/rtla/src/timerlat_top.c  | 20 +++++++++++++++++++-
 tools/tracing/rtla/src/trace.c         |  8 ++++++++
 tools/tracing/rtla/src/trace.h         |  1 +
 4 files changed, 46 insertions(+), 2 deletions(-)
Signature · 1 line
2.47.1