From: Valdis.Kletnieks@vt.edu
To: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: "Ingo Molnar" <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
"Stephane Eranian" <eranian@google.com>,
"David S. Miller" <davem@davemloft.net>,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Mike Galbraith" <efault@gmx.de>,
"Paul Mackerras" <paulus@samba.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"Tom Zanussi" <tzanussi@gmail.com>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>
Subject: Re: [PATCH 1/5] perf stat: add perf stat -B to pretty print large numbers
Date: Mon, 31 May 2010 15:11:39 -0400 [thread overview]
Message-ID: <52092.1275333099@localhost> (raw)
In-Reply-To: Your message of "Tue, 18 May 2010 23:08:16 -0300." <1274234900-12162-2-git-send-email-acme@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 3035 bytes --]
On Tue, 18 May 2010 23:08:16 -0300, Arnaldo Carvalho de Melo said:
(Sorry for late reply)
> instance LC_NUMERIC=en_US.UTF8. You need to pass -B to activate this
> feature. This way existing scripts parsing the output do not need to be
> changed. Here is an example.
>
> $ perf stat noploop 2
> noploop for 2 seconds
>
> Performance counter stats for 'noploop 2':
>
> 1998.347031 task-clock-msecs # 0.998 CPUs
> 61 context-switches # 0.000 M/sec
> 0 CPU-migrations # 0.000 M/sec
> 118 page-faults # 0.000 M/sec
> 4,138,410,900 cycles # 2070.917 M/sec (scaled from 70.01%)
> 2,062,650,268 instructions # 0.498 IPC (scaled from 70.01%)
> 2,057,653,466 branches # 1029.678 M/sec (scaled from 70.01%)
> 40,267 branch-misses # 0.002 % (scaled from 30.04%)
> 2,055,961,348 cache-references # 1028.831 M/sec (scaled from 30.03%)
> 53,725 cache-misses # 0.027 M/sec (scaled from 30.02%)
>
> 2.001393933 seconds time elapsed
>
> $ perf stat -B noploop 2
> noploop for 2 seconds
>
> Performance counter stats for 'noploop 2':
>
> 1998.297883 task-clock-msecs # 0.998 CPUs
> 59 context-switches # 0.000 M/sec
> 0 CPU-migrations # 0.000 M/sec
> 119 page-faults # 0.000 M/sec
> 4,131,380,160 cycles # 2067.450 M/sec (scaled from 70.01%)
> 2,059,096,507 instructions # 0.498 IPC (scaled from 70.01%)
> 2,054,681,303 branches # 1028.216 M/sec (scaled from 70.01%)
> 25,650 branch-misses # 0.001 % (scaled from 30.05%)
> 2,056,283,014 cache-references # 1029.017 M/sec (scaled from 30.03%)
> 47,097 cache-misses # 0.024 M/sec (scaled from 30.02%)
>
> 2.001391016 seconds time elapsed
Is it me, or did -B not make any difference for these two examples?
I'm confused.
> - fprintf(stderr, " %14.6f %-24s", msecs, event_name(counter));
> + fprintf(stderr, " %18.6f %-24s", msecs, event_name(counter));
> - fprintf(stderr, " %14.0f %-24s", avg, event_name(counter));
> + if (big_num)
> + fprintf(stderr, " %'18.0f %-24s", avg, event_name(counter));
> + else
> + fprintf(stderr, " %18.0f %-24s", avg, event_name(counter));
> - fprintf(stderr, " %14s %-24s\n",
> + fprintf(stderr, " %18s %-24s\n",
> "<not counted>", event_name(counter));
> - fprintf(stderr, " %14.9f seconds time elapsed",
> + fprintf(stderr, " %18.9f seconds time elapsed",
Why is the 'if (big_num)' applied to only one of the 4 sites, and the
other 3 blindly expanded from 14 to 18 characters?
[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]
next prev parent reply other threads:[~2010-05-31 19:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-19 2:08 [GIT PULL v2 0/5] perf tools fixes and improvements Arnaldo Carvalho de Melo
2010-05-19 2:08 ` [PATCH 1/5] perf stat: add perf stat -B to pretty print large numbers Arnaldo Carvalho de Melo
2010-05-19 6:28 ` Ingo Molnar
2010-05-31 19:11 ` Valdis.Kletnieks [this message]
2010-05-31 19:30 ` Stephane Eranian
2010-05-31 20:49 ` Valdis.Kletnieks
2010-05-31 23:11 ` Arnaldo Carvalho de Melo
2010-05-31 23:37 ` Arnaldo Carvalho de Melo
2010-05-19 2:08 ` [PATCH 2/5] perf tools: Remove some unused functions Arnaldo Carvalho de Melo
2010-05-19 2:08 ` [PATCH v2 3/5] perf probe: Fix some error exit paths Arnaldo Carvalho de Melo
2010-05-19 2:08 ` [PATCH v2 4/5] perf probe: Don't call die() Arnaldo Carvalho de Melo
2010-05-19 2:08 ` [PATCH 5/5] perf tools: remove xstrndup, xmalloc, xzalloc Arnaldo Carvalho de Melo
-- strict thread matches above, loose matches on Subject: below --
2010-05-19 0:27 [GIT PULL 0/5] perf tools fixes and improvements Arnaldo Carvalho de Melo
2010-05-19 0:27 ` [PATCH 1/5] perf stat: add perf stat -B to pretty print large numbers 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=52092.1275333099@localhost \
--to=valdis.kletnieks@vt.edu \
--cc=acme@infradead.org \
--cc=acme@redhat.com \
--cc=davem@davemloft.net \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tzanussi@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