lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YvO6yY9Cxm2km9Qq@kernel.org>
Date:   Wed, 10 Aug 2022 11:03:53 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Namhyung Kim <namhyung@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Kan Liang <kan.liang@...ux.intel.com>,
        Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
        Sandipan Das <sandipan.das@....com>,
        Claire Jensen <cjense@...gle.com>, Alyssa Ross <hi@...ssa.is>,
        Like Xu <likexu@...cent.com>,
        James Clark <james.clark@....com>,
        Florian Fischer <florian.fischer@...q.space>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        linux-perf-users <linux-perf-users@...r.kernel.org>,
        Claire Jensen <clairej735@...il.com>,
        Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v4 2/3] perf stat: Add JSON output option

Em Tue, May 31, 2022 at 04:13:59PM -0700, Ian Rogers escreveu:
> On Tue, May 31, 2022 at 3:46 PM Namhyung Kim <namhyung@...nel.org> wrote:
> >
> > Hi Ian,
> >
> > On Tue, May 24, 2022 at 10:38 PM Ian Rogers <irogers@...gle.com> wrote:
> > >
> > > From: Claire Jensen <cjense@...gle.com>
> > >
> > > CSV output is tricky to format and column layout changes are susceptible
> > > to breaking parsers. New JSON-formatted output has variable names to
> > > identify fields that are consistent and informative, making
> > > the output parseable.
> > >
> > > CSV output example:
> > >
> > > 1.20,msec,task-clock:u,1204272,100.00,0.697,CPUs utilized
> > > 0,,context-switches:u,1204272,100.00,0.000,/sec
> > > 0,,cpu-migrations:u,1204272,100.00,0.000,/sec
> > > 70,,page-faults:u,1204272,100.00,58.126,K/sec
> > >
> > > JSON output example:
> > >
> > > {"counter-value" : "3805.723968", "unit" : "msec", "event" :
> > > "cpu-clock", "event-runtime" : 3805731510100.00, "pcnt-running"
> > > : 100.00, "metric-value" : 4.007571, "metric-unit" : "CPUs utilized"}
> > > {"counter-value" : "6166.000000", "unit" : "", "event" :
> > > "context-switches", "event-runtime" : 3805723045100.00, "pcnt-running"
> > > : 100.00, "metric-value" : 1.620191, "metric-unit" : "K/sec"}
> > > {"counter-value" : "466.000000", "unit" : "", "event" :
> > > "cpu-migrations", "event-runtime" : 3805727613100.00, "pcnt-running"
> > > : 100.00, "metric-value" : 122.447136, "metric-unit" : "/sec"}
> > > {"counter-value" : "208.000000", "unit" : "", "event" :
> > > "page-faults", "event-runtime" : 3805726799100.00, "pcnt-running"
> > > : 100.00, "metric-value" : 54.654516, "metric-unit" : "/sec"}
> > >
> > > Also added documentation for JSON option.
> > > There is some tidy up of CSV code including a potential memory over run
> > > in the os.nfields set up. To facilitate this an AGGR_MAX value is added.
> > >
> > > Signed-off-by: Claire Jensen <cjense@...gle.com>
> >
> > Your sign-off as well?
> 
> Doh:
> Signed-off-by: Ian Rogers <irogers@...gle.com>

Added it (b4 did it really) and also added the fixup below.

- Arnaldo

diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index 33e0ee9633291fd5..b82844cb0ce77845 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -35,7 +35,7 @@ static void print_running(struct perf_stat_config *config,
 		enabled_percent = 100 * run / ena;
 	if (config->json_output)
 		fprintf(config->output,
-			"\"event-runtime\" : %lu, \"pcnt-running\" : %.2f, ",
+			"\"event-runtime\" : %" PRIu64 ", \"pcnt-running\" : %.2f, ",
 			run, enabled_percent);
 	else if (config->csv_output)
 		fprintf(config->output,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ