Skip to contentSkip to conversation

perf trace: Simplify output of string literals in thread__dump_stats()

PATCH New Markus Elfring 1 participant 1 message Jul 18, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf trace: Simplify output of string literals in thread__dump_stats()

From: Markus Elfring <[email protected]>
Date: Thu, 18 Jul 2024 15:12:13 +0200

Combine four fprintf() calls so that the same text is printed by a single function call.

---
 tools/perf/builtin-trace.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tools/perf/builtin-trace.c +5 -5
index 8449f2beb54d..b96fc6c00e26 100644
@@ -4238,11 +4238,11 @@ static size_t thread__dump_stats(struct thread_trace *ttrace,
 	if (syscall_stats == NULL)
 		return 0;
 
-	printed += fprintf(fp, "\n");
-
-	printed += fprintf(fp, "   syscall            calls  errors  total       min       avg       max       stddev\n");
-	printed += fprintf(fp, "                                     (msec)    (msec)    (msec)    (msec)        (%%)\n");
-	printed += fprintf(fp, "   --------------- --------  ------ -------- --------- --------- ---------     ------\n");
+	printed += fprintf(fp,
+			   "\n"
+			   "   syscall            calls  errors  total       min       avg       max       stddev\n"
+			   "                                     (msec)    (msec)    (msec)    (msec)        (%%)\n"
+			   "   --------------- --------  ------ -------- --------- --------- ---------     ------\n");
 
 	resort_rb__for_each_entry(nd, syscall_stats) {
 		struct syscall_stats *stats = syscall_stats_entry->stats;

--
2.45.2