aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2024-01-29 17:42:18 -0300
committerSteven Rostedt (Google) <rostedt@goodmis.org>2024-02-19 12:38:22 -0500
commitc7f19c48d000e67bac82eb4089f6f819df97e415 (patch)
treeaebc2225bdc2e63b373250fa5059842fb0f6b7a2
parente53ab33dd68f67858e816508e796b5ba3892c8b0 (diff)
downloadtrace-cmd-c7f19c48d000e67bac82eb4089f6f819df97e415.tar.gz
trace-cmd: Fix --poll trace recording
When using --poll, move_data() returns -1 and errno is set to EAGAIN. This causes the record threads to stop recording. Fix it by returning to the read loop in case EAGAIN, if --poll is specified. Link: https://lore.kernel.org/linux-trace-devel/ZbgNqiyocHf/FEQw@tpad Fixes: 2610bdcde43a6 ("trace-cmd library: Use tracefs_cpu for recorder helpers") Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--lib/trace-cmd/trace-recorder.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/trace-cmd/trace-recorder.c b/lib/trace-cmd/trace-recorder.c
index 70ce52e2..0633edf5 100644
--- a/lib/trace-cmd/trace-recorder.c
+++ b/lib/trace-cmd/trace-recorder.c
@@ -421,6 +421,9 @@ int tracecmd_start_recording(struct tracecmd_recorder *recorder, unsigned long s
if (ret < 0) {
if (errno == EINTR)
continue;
+ if ((recorder->flags & TRACECMD_RECORD_POLL) &&
+ errno == EAGAIN)
+ continue;
return ret;
}
read += ret;