From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Cc: Julia Lawall <julia.lawall@inria.fr>
Subject: [PATCH] trace-cmd split: Fail with an error message if appending data fails
Date: Tue, 22 Jun 2021 17:18:33 -0400 [thread overview]
Message-ID: <20210622171833.37b1e22b@gandalf.local.home> (raw)
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
reply other threads:[~2021-06-22 21:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210622171833.37b1e22b@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=julia.lawall@inria.fr \
--cc=linux-trace-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).