trace-cmd split: Fail with an error message if appending data fails
PATCH 1/1 trace-cmd split: Fail with an error message if appending data fails
From: "Steven Rostedt (VMware)" <[email protected]>
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) <[email protected]>
--- tracecmd/trace-split.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tracecmd/trace-split.c +2 -1
@@ -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++) {
Signature · 1 line
2.29.2