linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] perf stat: Fix JSON output formatting in iostat_prefix()
@ 2025-05-20  9:45 Suchit Karunakaran
  2025-05-28 18:07 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 6+ messages in thread
From: Suchit Karunakaran @ 2025-05-20  9:45 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin
  Cc: linux-perf-users, linux-kernel-mentees, linux-kernel, skhan,
	Suchit Karunakaran

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.

Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
---
 tools/perf/arch/x86/util/iostat.c | 35 ++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/tools/perf/arch/x86/util/iostat.c b/tools/perf/arch/x86/util/iostat.c
index 7442a2cd87ed..1d9c20dab5c7 100644
--- a/tools/perf/arch/x86/util/iostat.c
+++ b/tools/perf/arch/x86/util/iostat.c
@@ -403,18 +403,29 @@ void iostat_prefix(struct evlist *evlist,
 	struct iio_root_port *rp = evlist->selected->priv;
 
 	if (rp) {
-		/*
-		 * TODO: This is the incorrect format in JSON mode.
-		 *       See prepare_timestamp()
-		 */
-		if (ts)
-			sprintf(prefix, "%6lu.%09lu%s%04x:%02x%s",
-				ts->tv_sec, ts->tv_nsec,
-				config->csv_sep, rp->domain, rp->bus,
-				config->csv_sep);
-		else
-			sprintf(prefix, "%04x:%02x%s", rp->domain, rp->bus,
-				config->csv_sep);
+		if (ts) {
+			if (config->json_output)
+				sprintf(prefix,
+					"\"interval\" : %lu.%09lu, \"device\" : \"%04x:%02x\"",
+					(unsigned long)ts->tv_sec, ts->tv_nsec,
+					rp->domain, rp->bus);
+			else if (config->csv_output)
+				sprintf(prefix, "%lu.%09lu%s%04x:%02x%s",
+					(unsigned long)ts->tv_sec, ts->tv_nsec,
+					config->csv_sep,
+					rp->domain, rp->bus, config->csv_sep);
+			else
+				sprintf(prefix, "%6lu.%09lu %04x:%02x%s",
+					(unsigned long)ts->tv_sec, ts->tv_nsec,
+					rp->domain, rp->bus, config->csv_sep);
+		} else {
+			if (config->json_output)
+				sprintf(prefix, "\"device\" : \"%04x:%02x\"",
+					rp->domain, rp->bus);
+			else
+				sprintf(prefix, "%04x:%02x%s", rp->domain,
+					rp->bus, config->csv_sep);
+		}
 	}
 }
 
-- 
2.49.0


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

* Re: [PATCH RESEND] perf stat: Fix JSON output formatting in iostat_prefix()
  2025-05-20  9:45 Suchit Karunakaran
@ 2025-05-28 18:07 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-05-28 18:07 UTC (permalink / raw)
  To: Suchit Karunakaran
  Cc: Yicong Yang, Jonathan Cameron, Junhao He, Mark Rutland,
	Peter Zijlstra, Shameerali Kolothum Thodi, Ingo Molnar,
	Namhyung Kim, alexander.shishkin, linux-perf-users,
	linux-kernel-mentees, linux-kernel, skhan

On Tue, May 20, 2025 at 03:15:25PM +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.

O don't have how to test this as I dont have:

access("/sys/bus/event_source/devices/uncore_iio_0", F_OK) = -1 ENOENT (No such file or directory)
write(2, ""..., 37Unsupported uncore pmu configuration
)                     = 37
write(2, ""..., 43
 Usage: perf stat [<options>] [<command>]
)                     = 43
write(2, ""..., 1
<SNIP>
write(2, ""..., 84                          measure I/O performance metrics provided by arch/platform
)                     = 84
exit_group(129)                         = ?
+++ exited with 129 +++
root@x1:~# strace -s0 perf stat --iostat --timeout 1000

Could someone with access to hardware with this capability to try this
patch and provide a  Tested-by?

- Arnaldo
 
> Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
> ---
>  tools/perf/arch/x86/util/iostat.c | 35 ++++++++++++++++++++-----------
>  1 file changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/perf/arch/x86/util/iostat.c b/tools/perf/arch/x86/util/iostat.c
> index 7442a2cd87ed..1d9c20dab5c7 100644
> --- a/tools/perf/arch/x86/util/iostat.c
> +++ b/tools/perf/arch/x86/util/iostat.c
> @@ -403,18 +403,29 @@ void iostat_prefix(struct evlist *evlist,
>  	struct iio_root_port *rp = evlist->selected->priv;
>  
>  	if (rp) {
> -		/*
> -		 * TODO: This is the incorrect format in JSON mode.
> -		 *       See prepare_timestamp()
> -		 */
> -		if (ts)
> -			sprintf(prefix, "%6lu.%09lu%s%04x:%02x%s",
> -				ts->tv_sec, ts->tv_nsec,
> -				config->csv_sep, rp->domain, rp->bus,
> -				config->csv_sep);
> -		else
> -			sprintf(prefix, "%04x:%02x%s", rp->domain, rp->bus,
> -				config->csv_sep);
> +		if (ts) {
> +			if (config->json_output)
> +				sprintf(prefix,
> +					"\"interval\" : %lu.%09lu, \"device\" : \"%04x:%02x\"",
> +					(unsigned long)ts->tv_sec, ts->tv_nsec,
> +					rp->domain, rp->bus);
> +			else if (config->csv_output)
> +				sprintf(prefix, "%lu.%09lu%s%04x:%02x%s",
> +					(unsigned long)ts->tv_sec, ts->tv_nsec,
> +					config->csv_sep,
> +					rp->domain, rp->bus, config->csv_sep);
> +			else
> +				sprintf(prefix, "%6lu.%09lu %04x:%02x%s",
> +					(unsigned long)ts->tv_sec, ts->tv_nsec,
> +					rp->domain, rp->bus, config->csv_sep);
> +		} else {
> +			if (config->json_output)
> +				sprintf(prefix, "\"device\" : \"%04x:%02x\"",
> +					rp->domain, rp->bus);
> +			else
> +				sprintf(prefix, "%04x:%02x%s", rp->domain,
> +					rp->bus, config->csv_sep);
> +		}
>  	}
>  }
>  
> -- 
> 2.49.0

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

* [PATCH RESEND] perf stat: Fix JSON output formatting in iostat_prefix()
@ 2025-06-05 18:00 Suchit Karunakaran
  2025-06-06  3:57 ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Suchit Karunakaran @ 2025-06-05 18:00 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin
  Cc: linux-perf-users, linux-kernel-mentees, linux-kernel, skhan,
	Suchit Karunakaran

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.

Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
---
 tools/perf/arch/x86/util/iostat.c | 35 ++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/tools/perf/arch/x86/util/iostat.c b/tools/perf/arch/x86/util/iostat.c
index 7442a2cd87ed..1d9c20dab5c7 100644
--- a/tools/perf/arch/x86/util/iostat.c
+++ b/tools/perf/arch/x86/util/iostat.c
@@ -403,18 +403,29 @@ void iostat_prefix(struct evlist *evlist,
 	struct iio_root_port *rp = evlist->selected->priv;
 
 	if (rp) {
-		/*
-		 * TODO: This is the incorrect format in JSON mode.
-		 *       See prepare_timestamp()
-		 */
-		if (ts)
-			sprintf(prefix, "%6lu.%09lu%s%04x:%02x%s",
-				ts->tv_sec, ts->tv_nsec,
-				config->csv_sep, rp->domain, rp->bus,
-				config->csv_sep);
-		else
-			sprintf(prefix, "%04x:%02x%s", rp->domain, rp->bus,
-				config->csv_sep);
+		if (ts) {
+			if (config->json_output)
+				sprintf(prefix,
+					"\"interval\" : %lu.%09lu, \"device\" : \"%04x:%02x\"",
+					(unsigned long)ts->tv_sec, ts->tv_nsec,
+					rp->domain, rp->bus);
+			else if (config->csv_output)
+				sprintf(prefix, "%lu.%09lu%s%04x:%02x%s",
+					(unsigned long)ts->tv_sec, ts->tv_nsec,
+					config->csv_sep,
+					rp->domain, rp->bus, config->csv_sep);
+			else
+				sprintf(prefix, "%6lu.%09lu %04x:%02x%s",
+					(unsigned long)ts->tv_sec, ts->tv_nsec,
+					rp->domain, rp->bus, config->csv_sep);
+		} else {
+			if (config->json_output)
+				sprintf(prefix, "\"device\" : \"%04x:%02x\"",
+					rp->domain, rp->bus);
+			else
+				sprintf(prefix, "%04x:%02x%s", rp->domain,
+					rp->bus, config->csv_sep);
+		}
 	}
 }
 
-- 
2.49.0


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

* Re: [PATCH RESEND] perf stat: Fix JSON output formatting in iostat_prefix()
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Namhyung Kim @ 2025-06-06  3:57 UTC (permalink / raw)
  To: Suchit Karunakaran
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin,
	linux-perf-users, linux-kernel-mentees, linux-kernel, skhan

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"

Thanks,
Namhyung

> 
> Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
> ---
>  tools/perf/arch/x86/util/iostat.c | 35 ++++++++++++++++++++-----------
>  1 file changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/perf/arch/x86/util/iostat.c b/tools/perf/arch/x86/util/iostat.c
> index 7442a2cd87ed..1d9c20dab5c7 100644
> --- a/tools/perf/arch/x86/util/iostat.c
> +++ b/tools/perf/arch/x86/util/iostat.c
> @@ -403,18 +403,29 @@ void iostat_prefix(struct evlist *evlist,
>  	struct iio_root_port *rp = evlist->selected->priv;
>  
>  	if (rp) {
> -		/*
> -		 * TODO: This is the incorrect format in JSON mode.
> -		 *       See prepare_timestamp()
> -		 */
> -		if (ts)
> -			sprintf(prefix, "%6lu.%09lu%s%04x:%02x%s",
> -				ts->tv_sec, ts->tv_nsec,
> -				config->csv_sep, rp->domain, rp->bus,
> -				config->csv_sep);
> -		else
> -			sprintf(prefix, "%04x:%02x%s", rp->domain, rp->bus,
> -				config->csv_sep);
> +		if (ts) {
> +			if (config->json_output)
> +				sprintf(prefix,
> +					"\"interval\" : %lu.%09lu, \"device\" : \"%04x:%02x\"",
> +					(unsigned long)ts->tv_sec, ts->tv_nsec,
> +					rp->domain, rp->bus);
> +			else if (config->csv_output)
> +				sprintf(prefix, "%lu.%09lu%s%04x:%02x%s",
> +					(unsigned long)ts->tv_sec, ts->tv_nsec,
> +					config->csv_sep,
> +					rp->domain, rp->bus, config->csv_sep);
> +			else
> +				sprintf(prefix, "%6lu.%09lu %04x:%02x%s",
> +					(unsigned long)ts->tv_sec, ts->tv_nsec,
> +					rp->domain, rp->bus, config->csv_sep);
> +		} else {
> +			if (config->json_output)
> +				sprintf(prefix, "\"device\" : \"%04x:%02x\"",
> +					rp->domain, rp->bus);
> +			else
> +				sprintf(prefix, "%04x:%02x%s", rp->domain,
> +					rp->bus, config->csv_sep);
> +		}
>  	}
>  }
>  
> -- 
> 2.49.0
> 

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

* Re: [PATCH RESEND] perf stat: Fix JSON output formatting in iostat_prefix()
  2025-06-06  3:57 ` Namhyung Kim
@ 2025-06-06  4:34   ` Suchit K
  2025-06-06 17:29     ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Suchit K @ 2025-06-06  4:34 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin,
	linux-perf-users, linux-kernel-mentees, linux-kernel, skhan

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"
>
> Thanks,
> Namhyung
>
> >
> > Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
> > ---
> >  tools/perf/arch/x86/util/iostat.c | 35 ++++++++++++++++++++-----------
> >  1 file changed, 23 insertions(+), 12 deletions(-)
> >
> > diff --git a/tools/perf/arch/x86/util/iostat.c b/tools/perf/arch/x86/util/iostat.c
> > index 7442a2cd87ed..1d9c20dab5c7 100644
> > --- a/tools/perf/arch/x86/util/iostat.c
> > +++ b/tools/perf/arch/x86/util/iostat.c
> > @@ -403,18 +403,29 @@ void iostat_prefix(struct evlist *evlist,
> >       struct iio_root_port *rp = evlist->selected->priv;
> >
> >       if (rp) {
> > -             /*
> > -              * TODO: This is the incorrect format in JSON mode.
> > -              *       See prepare_timestamp()
> > -              */
> > -             if (ts)
> > -                     sprintf(prefix, "%6lu.%09lu%s%04x:%02x%s",
> > -                             ts->tv_sec, ts->tv_nsec,
> > -                             config->csv_sep, rp->domain, rp->bus,
> > -                             config->csv_sep);
> > -             else
> > -                     sprintf(prefix, "%04x:%02x%s", rp->domain, rp->bus,
> > -                             config->csv_sep);
> > +             if (ts) {
> > +                     if (config->json_output)
> > +                             sprintf(prefix,
> > +                                     "\"interval\" : %lu.%09lu, \"device\" : \"%04x:%02x\"",
> > +                                     (unsigned long)ts->tv_sec, ts->tv_nsec,
> > +                                     rp->domain, rp->bus);
> > +                     else if (config->csv_output)
> > +                             sprintf(prefix, "%lu.%09lu%s%04x:%02x%s",
> > +                                     (unsigned long)ts->tv_sec, ts->tv_nsec,
> > +                                     config->csv_sep,
> > +                                     rp->domain, rp->bus, config->csv_sep);
> > +                     else
> > +                             sprintf(prefix, "%6lu.%09lu %04x:%02x%s",
> > +                                     (unsigned long)ts->tv_sec, ts->tv_nsec,
> > +                                     rp->domain, rp->bus, config->csv_sep);
> > +             } else {
> > +                     if (config->json_output)
> > +                             sprintf(prefix, "\"device\" : \"%04x:%02x\"",
> > +                                     rp->domain, rp->bus);
> > +                     else
> > +                             sprintf(prefix, "%04x:%02x%s", rp->domain,
> > +                                     rp->bus, config->csv_sep);
> > +             }
> >       }
> >  }
> >
> > --
> > 2.49.0
> >

Hi Namhyung,
Thanks for testing it. Could you please tell what could be improved?

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

* Re: [PATCH RESEND] perf stat: Fix JSON output formatting in iostat_prefix()
  2025-06-06  4:34   ` Suchit K
@ 2025-06-06 17:29     ` Namhyung Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Namhyung Kim @ 2025-06-06 17:29 UTC (permalink / raw)
  To: Suchit K
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin,
	linux-perf-users, linux-kernel-mentees, linux-kernel, skhan

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


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

end of thread, other threads:[~2025-06-06 17:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).