* [PATCH] trace-cmd split: Fail with an error message if appending data fails
@ 2021-06-22 21:18 Steven Rostedt
0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2021-06-22 21:18 UTC (permalink / raw)
To: Linux Trace Devel; +Cc: Julia Lawall
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
If appending the CPU data fails, error out with a message to inform the
user what happened and not just continue as if nothing went wrong.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
tracecmd/trace-split.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c
index 10d0943d..233feb89 100644
--- a/tracecmd/trace-split.c
+++ b/tracecmd/trace-split.c
@@ -385,7 +385,8 @@ static double parse_file(struct tracecmd_input *handle,
cpu_list[cpu] = cpu_data[cpu].file;
tracecmd_set_out_clock(ohandle, tracecmd_get_trace_clock(handle));
- tracecmd_append_cpu_data(ohandle, cpus, cpu_list);
+ if (tracecmd_append_cpu_data(ohandle, cpus, cpu_list) < 0)
+ die("Failed to append tracing data\n");
current = end;
for (cpu = 0; cpu < cpus; cpu++) {
--
2.29.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-22 21:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-22 21:18 [PATCH] trace-cmd split: Fail with an error message if appending data fails Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).