From: Jim Cromie <jim.cromie@gmail.com>
To: mingo@elte.hu
Cc: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] perf-stat: refactor print/formatting into print-ops
Date: Thu, 26 May 2011 13:50:03 -0600 [thread overview]
Message-ID: <1306439406-18037-1-git-send-email-jim.cromie@gmail.com> (raw)
In-Reply-To: <BANLkTimJp9o5_P73eNn5rMJbfRC2sCRdJA@mail.gmail.com>
[PATCH 1/3] perf-stat: refactor print/formatting into print-ops for
[PATCH 2/3] perf-stat: fix +- nan% in -Aa runs
[PATCH 3/3] perf-stat: clean up <no count> handling, CPUx prefixing
[PATCH 1/3] perf-stat: refactor print/formatting into print-ops for
produces output like this for csv-output:
[jimc@harpo perf]$ sudo ./perf stat -Aa -x'\t' perl -e '$i++ for 1..100000'
CPU0 task-clock-msecs 16.255272
CPU0 context-switches 12
CPU0 CPU-migrations 0
CPU0 page-faults 445
CPU0 cycles 27441481 67.07%
CPU0 instructions 36775396 73.16%
CPU0 branches 8836245 20.72%
CPU0 branch-misses 21646 14.62%
CPU0 cache-references 58221 12.31%
CPU0 cache-misses 6815 12.28%
seconds-time-elapsed 0.016211262
This alters csv-output form by printing event-name in 1st column,
swapping cols 1, 2 from previous table. This may be problematic for
some existing users, but is more "normal" and therefore better
long-term. The 3rd - 5th colums match those in pretty
As before, csv-output is triggered by use of -x "sep", where sep can
be any string, not just a char. This patch adds special case for
"\t", which is converted to a tab.
[PATCH 2/3] perf-stat: fix +- nan% in -Aa runs
without this patch, I get computations like this:
[jimc@groucho perf]$ sudo ./perf stat -r3 -Aa perl -e '$i++ for 1..100000'
Performance counter stats for 'perl -e $i++ for 1..100000' (3 runs):
CPU0 12.391883 task-clock-msecs # 0.966 CPUs ( +- -nan% )
CPU1 12.446571 task-clock-msecs # 0.970 CPUs ( +- -nan% )
CPU2 12.408014 task-clock-msecs # 0.967 CPUs ( +- -nan% )
CPU3 12.422264 task-clock-msecs # 0.968 CPUs ( +- -nan% )
I couldnt see anything wrong in the caller, so fixed it in stddev_stats()
[PATCH 3/3] perf-stat: clean up <no count> handling, CPUx prefixing
push <no-count> printing into print-ops to hide some cruft, and fold
away dynamic formats. Refactor cpustr string prep into cpustr(int
cpu), use it everywhere, and change fn-sigs accordingly.
Also includes 1-line fixup for overlooked hack in earlier patch:
- if (scaled == -1 && !csv_output) {
+ if (scaled == -1) {
next prev parent reply other threads:[~2011-05-26 19:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-21 8:56 [PATCH 0/2] perf stat: add -l <N> option to redirect stderr elsewhere Jim Cromie
2011-05-21 8:56 ` [PATCH 1/2] " Jim Cromie
2011-05-21 10:34 ` Ingo Molnar
2011-05-21 20:41 ` Arnaldo Carvalho de Melo
2011-09-01 21:58 ` Jim Cromie
2011-09-02 14:35 ` Arnaldo Carvalho de Melo
2011-09-02 18:02 ` Arnaldo Carvalho de Melo
2011-09-02 18:04 ` Jim Cromie
2011-09-02 18:58 ` Arnaldo Carvalho de Melo
2011-09-07 23:13 ` [patch 0/5] perf stat --log-fd=N Jim Cromie
2011-09-07 23:14 ` [PATCH 1/5] perf stat: add --log-fd <N> option to redirect stderr elsewhere Jim Cromie
2011-09-07 23:14 ` [PATCH 2/5] perf-stat: fix +- nan% in --no-aggr runs Jim Cromie
2011-09-07 23:14 ` [PATCH 3/5] perf stat: suppress printing std-dev when its 0 Jim Cromie
2011-09-07 23:14 ` [PATCH 4/5] perf stat: allow tab as cvs delimiter Jim Cromie
2011-09-07 23:14 ` [PATCH 5/5] perf stat: fix spelling in comment Jim Cromie
2011-05-21 8:56 ` [PATCH 2/2] dont commify big numbers by default, let -B do it Jim Cromie
2011-05-21 10:33 ` Ingo Molnar
2011-05-24 22:05 ` Jim Cromie
2011-05-24 22:11 ` [PATCH] add --simple output mode to perf-stat, based upon csv-output Jim Cromie
2011-05-25 12:44 ` [PATCH 2/2] dont commify big numbers by default, let -B do it Ingo Molnar
2011-05-26 19:41 ` Jim Cromie
2011-05-26 19:50 ` Jim Cromie [this message]
2011-05-26 19:50 ` [PATCH 1/3] perf-stat: refactor print/formatting into print-ops for pretty, csv Jim Cromie
2011-05-26 19:50 ` [PATCH 2/3] perf-stat: fix +- nan% in -Aa runs Jim Cromie
2011-05-26 19:50 ` [PATCH 3/3] perf-stat: clean up <no count> handling, CPUx prefixing Jim Cromie
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=1306439406-18037-1-git-send-email-jim.cromie@gmail.com \
--to=jim.cromie@gmail.com \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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;
as well as URLs for NNTP newsgroup(s).