From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Subject: [PATCH] trace-cmd report: Have --align-ts ignore empty CPU buffers
Date: Thu, 6 May 2021 11:48:45 -0400 [thread overview]
Message-ID: <20210506114845.5c2cf201@gandalf.local.home> (raw)
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
When testing out the trace-cmd report --align-ts, I saw no difference. And
that was because one of the CPUs were empty.
Have the --align-ts option ignore empty CPUs.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
Based on top of: https://lore.kernel.org/linux-trace-devel/20210428122839.805296-6-tz.stoyanov@gmail.com/
lib/trace-cmd/trace-input.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 4d5940d8..9726e994 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -4089,6 +4089,9 @@ unsigned long long tracecmd_get_first_ts(struct tracecmd_input *handle)
int i;
for (i = 0; i < handle->cpus; i++) {
+ /* Ignore empty buffers */
+ if (!handle->cpu_data[i].size)
+ continue;
if (first || ts > handle->cpu_data[i].first_ts)
ts = handle->cpu_data[i].first_ts;
first = false;
--
2.29.2
reply other threads:[~2021-05-06 15:48 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=20210506114845.5c2cf201@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=tz.stoyanov@gmail.com \
/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).