All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@elte.hu, acme@redhat.com,
	jolsa@redhat.com, irogers@google.com, ak@linux.intel.com,
	kan.liang@intel.com
Subject: [PATCH] perf/script: remove extraneous newline in perf_sample__fprintf_regs()
Date: Sat, 18 Apr 2020 16:19:08 -0700	[thread overview]
Message-ID: <20200418231908.152212-1-eranian@google.com> (raw)

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


             reply	other threads:[~2020-04-18 23:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 23:19 Stephane Eranian [this message]
2020-04-27 21:43 ` [PATCH] perf/script: remove extraneous newline in perf_sample__fprintf_regs() 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200418231908.152212-1-eranian@google.com \
    --to=eranian@google.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.