public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Suchit K <suchitkarunakaran@gmail.com>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	linux-perf-users@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev,
	linux-kernel@vger.kernel.org, skhan@linuxfoundation.org
Subject: Re: [PATCH RESEND] perf stat: Fix JSON output formatting in iostat_prefix()
Date: Fri, 6 Jun 2025 10:29:21 -0700	[thread overview]
Message-ID: <aEMlcf02v1kpNVEa@google.com> (raw)
In-Reply-To: <CAO9wTFhyQnE2hgvtQuYxfCTjd7iRHJN5O+v3wka7smDkrUX1GA@mail.gmail.com>

On Fri, Jun 06, 2025 at 10:04:17AM +0530, Suchit K wrote:
> On Fri, 6 Jun 2025 at 09:27, Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > Hello,
> >
> > On Thu, Jun 05, 2025 at 11:30:11PM +0530, Suchit Karunakaran wrote:
> > > The iostat_prefix() function previously included a TODO noting that its output
> > > format was incorrect in JSON mode. This patch corrects that by conditionally
> > > formatting the prefix string based on the output mode specified in
> > > perf_stat_config.
> >
> > I've tested this.  It doesn't work well.
> >
> > Before:
> >   # ./perf iostat -j -I 1000 true
> >   #          time    port              0.000517525 0000:00 "Inbound Read(MB)" : "0", "Inbound Write(MB)" : "0", "Outbound Read(MB)" : "0", "Outbound Write(MB)" : "0"
> >        0.000517525 0000:80
> >        0.000517525 0000:17 , "Inbound Read(MB)" : "0", "Inbound Write(MB)" : "0", "Outbound Read(MB)" : "0", "Outbound Write(MB)" : "0"
> >        0.000517525 0000:85
> >        0.000517525 0000:3a , "Inbound Read(MB)" : "0", "Inbound Write(MB)" : "0", "Outbound Read(MB)" : "0", "Outbound Write(MB)" : "0"
> >        0.000517525 0000:ae
> >        0.000517525 0000:5d , "Inbound Read(MB)" : "0", "Inbound Write(MB)" : "0", "Outbound Read(MB)" : "0", "Outbound Write(MB)" : "0"
> >        0.000517525 0000:d7
> >
> >
> > After:
> >   # ./perf iostat -j -I 1000 true
> >   #          time    port         "interval" : 0.000463559, "device" : "0000:00""Inbound Read(MB)" : "0", "Inbound Write(MB)" : "0", "Outbound Read(MB)" : "0", "Outbound Write(MB)" : "0"
> >   "interval" : 0.000463559, "device" : "0000:80"
> >   "interval" : 0.000463559, "device" : "0000:17", "Inbound Read(MB)" : "0", "Inbound Write(MB)" : "0", "Outbound Read(MB)" : "0", "Outbound Write(MB)" : "0"
> >   "interval" : 0.000463559, "device" : "0000:85"
> >   "interval" : 0.000463559, "device" : "0000:3a", "Inbound Read(MB)" : "0", "Inbound Write(MB)" : "0", "Outbound Read(MB)" : "0", "Outbound Write(MB)" : "0"
> >   "interval" : 0.000463559, "device" : "0000:ae"
> >   "interval" : 0.000463559, "device" : "0000:5d", "Inbound Read(MB)" : "0", "Inbound Write(MB)" : "0", "Outbound Read(MB)" : "0", "Outbound Write(MB)" : "0"
> >   "interval" : 0.000463559, "device" : "0000:d7"
> 
> Hi Namhyung,
> Thanks for testing it. Could you please tell what could be improved?

I think it should show a valid JSON.  Something like this?

  # ./perf iostat -j -I 1000 true
  {"interval" : 0.000463559, "device" : "0000:00", "Inbound Read(MB)" : "0", ...}
  {"interval" : 0.000463559, "device" : "0000:80", "Inbound Read(MB)" : "0", ...}
  {"interval" : 0.000463559, "device" : "0000:17", "Inbound Read(MB)" : "0", ...}
  {"interval" : 0.000463559, "device" : "0000:85", "Inbound Read(MB)" : "0", ...}
  ...

Thanks,
Namhyung


  reply	other threads:[~2025-06-06 17:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05 18:00 [PATCH RESEND] perf stat: Fix JSON output formatting in iostat_prefix() Suchit Karunakaran
2025-06-06  3:57 ` Namhyung Kim
2025-06-06  4:34   ` Suchit K
2025-06-06 17:29     ` Namhyung Kim [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-20  9:45 Suchit Karunakaran
2025-05-28 18:07 ` Arnaldo Carvalho de Melo

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=aEMlcf02v1kpNVEa@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=suchitkarunakaran@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox