lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <c2fcf5b7-217b-4287-94ef-7429fbfe9b53@web.de>
Date: Thu, 18 Jul 2024 15:24:18 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-perf-users@...r.kernel.org, kernel-janitors@...r.kernel.org,
 Adrian Hunter <adrian.hunter@...el.com>,
 Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
 Arnaldo Carvalho de Melo <acme@...nel.org>, Ian Rogers <irogers@...gle.com>,
 Ingo Molnar <mingo@...hat.com>, Jiri Olsa <jolsa@...nel.org>,
 Kan Liang <kan.liang@...ux.intel.com>, Mark Rutland <mark.rutland@....com>,
 Namhyung Kim <namhyung@...nel.org>, Peter Zijlstra <peterz@...radead.org>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] perf trace: Simplify output of string literals in
 thread__dump_stats()

From: Markus Elfring <elfring@...rs.sourceforge.net>
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@...rs.sourceforge.net>
---
 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ