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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
 tools/perf/builtin-trace.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 8449f2beb54d..b96fc6c00e26 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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






[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux