All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/script: remove extraneous newline in perf_sample__fprintf_regs()
@ 2020-04-18 23:19 Stephane Eranian
  2020-04-27 21:43 ` Stephane Eranian
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stephane Eranian @ 2020-04-18 23:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, acme, jolsa, irogers, ak, kan.liang

When printing iregs, there was a double newline printed because
perf_sample__fprintf_regs() was printing its own and then at the
end of all fields, perf script was adding one.
This was causing blank line in the output:

Before:
$ perf script -Fip,iregs
           401b8d ABI:2    DX:0x100    SI:0x4a8340    DI:0x4a9340

           401b8d ABI:2    DX:0x100    SI:0x4a9340    DI:0x4a8340

           401b8d ABI:2    DX:0x100    SI:0x4a8340    DI:0x4a9340

           401b8d ABI:2    DX:0x100    SI:0x4a9340    DI:0x4a8340

After:
$ perf script -Fip,iregs
           401b8d ABI:2    DX:0x100    SI:0x4a8340    DI:0x4a9340
           401b8d ABI:2    DX:0x100    SI:0x4a9340    DI:0x4a8340
           401b8d ABI:2    DX:0x100    SI:0x4a8340    DI:0x4a9340

Signed-off-by: Stephane Eranian <eranian@google.com>
---
 tools/perf/builtin-script.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 1f57a7ecdf3d0..0c0b6e807d06e 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -604,8 +604,6 @@ static int perf_sample__fprintf_regs(struct regs_dump *regs, uint64_t mask,
 		printed += fprintf(fp, "%5s:0x%"PRIx64" ", perf_reg_name(r), val);
 	}
 
-	fprintf(fp, "\n");
-
 	return printed;
 }
 
-- 
2.26.1.301.g55bc3eb7cb9-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-08 13:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-18 23:19 [PATCH] perf/script: remove extraneous newline in perf_sample__fprintf_regs() Stephane Eranian
2020-04-27 21:43 ` Stephane Eranian
2020-04-28 12:29   ` Arnaldo Carvalho de Melo
2020-04-28  2:47 ` Andi Kleen
2020-04-29 19:32   ` Stephane Eranian
2020-04-30  2:09     ` Andi Kleen
2020-04-30  2:13       ` Stephane Eranian
2020-05-08 13:05 ` [tip: perf/core] perf script: Remove " tip-bot2 for Stephane Eranian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.