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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101201185452.GB26071@ghostprotocols.net>
Date:	Wed, 1 Dec 2010 16:54:52 -0200
From:	Arnaldo Carvalho de Melo <acme@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	linux-kernel@...r.kernel.org, peterz@...radead.org, mingo@...e.hu,
	paulus@...ba.org, davem@...emloft.net, fweisbec@...il.com,
	perfmon2-devel@...ts.sf.net, eranian@...il.com,
	robert.richter@....com
Subject: Re: [PATCH] perf: add csv-style output to perf stat (v2)

Em Wed, Dec 01, 2010 at 04:10:01PM -0200, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Dec 01, 2010 at 06:49:05PM +0200, Stephane Eranian escreveu:
> > This patch adds an option (-x/--field-separator) to print counts using
> > a CSV-style output. The user can pass a custom separator. This makes it
> > very easy to import counts directly into your favorite spreadsheet without
> > having to write scripts.
> 
> [root@...a ~]# perf stat -x,  -a -A -- sleep 1
> -B option not supported with -x
> 
>  usage: perf stat [<options>] [<command>]
> 
>     -e, --event <event>   event selector. use 'perf list' to list
> 
> Guess we'll have to disable big_num automatically when -x is specified,
> but at the same time notice if the user _explicitely_ asked for -B.
> 
> I'll fix this now.

Should be OK now, patch attached. Please check if it works as expected
and then I'll push it to Ingo, thanks.

[root@...a ~]# perf stat -x, -a -A -- sleep 1 2>&1 | head -5
CPU0,998.225789,task-clock-msecs
CPU1,998.385393,task-clock-msecs
CPU2,998.370913,task-clock-msecs
CPU3,998.356865,task-clock-msecs
CPU0,2272,context-switches
[root@...a ~]# perf stat -B -x, -a -A -- sleep 1 2>&1 | head -5
-B option not supported with -x

 usage: perf stat [<options>] [<command>]

    -e, --event <event>   event selector. use 'perf list' to list available events
[root@...a ~]# perf stat -B -a -- sleep 1 2>&1 | head -10

 Performance counter stats for 'sleep 1':

       3992.488962 task-clock-msecs         #      3.988 CPUs 
             9,082 context-switches         #      0.002 M/sec
                15 CPU-migrations           #      0.000 M/sec
               160 page-faults              #      0.000 M/sec
        84,802,643 cycles                   #     21.241 M/sec  (scaled from 70.03%)
        45,056,634 instructions             #      0.531 IPC    (scaled from 80.02%)
         8,672,889 branches                 #      2.172 M/sec  (scaled from 80.01%)
[root@...a ~]# perf stat -B -A -a -- sleep 1 2>&1 | head -10

 Performance counter stats for 'sleep 1':

CPU0            998.135082 task-clock-msecs         #      0.997 CPUs 
CPU1            998.137405 task-clock-msecs         #      0.997 CPUs 
CPU2            998.144046 task-clock-msecs         #      0.997 CPUs 
CPU3            998.146202 task-clock-msecs         #      0.997 CPUs 
CPU0                 2,280 context-switches         #      0.002 M/sec
CPU1                 2,282 context-switches         #      0.002 M/sec
CPU2                 2,244 context-switches         #      0.002 M/sec
[root@...a ~]# perf stat --no-big-num -A -a -- sleep 1 2>&1 | head -10

 Performance counter stats for 'sleep 1':

CPU0            998.125848 task-clock-msecs         #      0.997 CPUs 
CPU1            998.244633 task-clock-msecs         #      0.997 CPUs 
CPU2            998.337969 task-clock-msecs         #      0.997 CPUs 
CPU3            998.313756 task-clock-msecs         #      0.997 CPUs 
CPU0                  2268 context-switches         #      0.002 M/sec
CPU1                  2218 context-switches         #      0.002 M/sec
CPU2                  2218 context-switches         #      0.002 M/sec
[root@...a ~]#

View attachment "0001-perf-stat-Add-csv-style-output.patch" of type "text/plain" (10853 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ