diff mbox series

[2/4] trace-cmd: Only show unit test output when -v is supplied

Message ID 20221115205355.2580214-3-rostedt@goodmis.org (mailing list archive)
State Accepted
Commit 01926bce6c685ee1c06d7fb01a57ae6c8e8fc620
Headers show
Series trace-cmd utest: Add test for max buffer (record -m) | expand

Commit Message

Steven Rostedt Nov. 15, 2022, 8:53 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The "Use libraries to read file" test shows the output of the reading of
the trace.dat file. That should only happen if the '-v' option is
supplied, otherwise, it should be muted.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 utest/tracecmd-utest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/utest/tracecmd-utest.c b/utest/tracecmd-utest.c
index e45b3537365c..2ec3f7118690 100644
--- a/utest/tracecmd-utest.c
+++ b/utest/tracecmd-utest.c
@@ -264,7 +264,8 @@  static int read_events(struct tracecmd_input *handle, struct tep_record *record,
 	tep_print_event(tep, seq, record, "%s-%d %s %s\n",
 			TEP_PRINT_COMM, TEP_PRINT_PID,
 			TEP_PRINT_NAME, TEP_PRINT_INFO);
-	trace_seq_do_printf(seq);
+	if (show_output)
+		trace_seq_do_printf(seq);
 	return 0;
 }