linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd report: Have --align-ts ignore empty CPU buffers
@ 2021-05-06 15:48 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2021-05-06 15:48 UTC (permalink / raw)
  To: Linux Trace Devel; +Cc: Tzvetomir Stoyanov

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-06 15:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-06 15:48 [PATCH] trace-cmd report: Have --align-ts ignore empty CPU buffers 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).