Re: [PATCH] perf/script: remove extraneous newline in perf_sample__fprintf_regs()
From: Andi Kleen
Date: Mon Apr 27 2020 - 22:47:47 EST
On Sat, Apr 18, 2020 at 04:19:08PM -0700, Stephane Eranian wrote:
> 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:
I don't think the patch is quite correct because there could be
other fields after it, and they need to be separated by a
new line too.
e.g. i suspect if someone prints iregs,uregs or iregs,brstack
or something else that is printed in process_event after *regs
you would get garbled output.
So you have to track if the newline is needed or not.
-Andi