From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org, namhyung@kernel.org,
acme@infradead.org, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] perf, tools: Support spark lines in perf stat v5
Date: Tue, 3 Jun 2014 21:47:02 +0200 [thread overview]
Message-ID: <20140603194702.GC4213@krava.brq.redhat.com> (raw)
In-Reply-To: <1401486136-20892-1-git-send-email-andi@firstfloor.org>
On Fri, May 30, 2014 at 02:42:16PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> perf stat -rX prints the stddev for multiple measurements.
> Just looking at the stddev for judging the quality of the data
> is a bit dangerous The simplest sanity check is to just look
> at a simple plot. This patchs add a sparkline to the end
> of the measurements to make it simple to judge the data.
>
> The sparkline only uses UTF-8, so should be readable
> in all modern tools and terminals.
>
> The sparkline is between the minimum and maximum of the data,
> so it's mainly a indicator of variance. To keep the code
> simple and make the output not too wide only the first
> 8 values are printed. If more values are there it adds '..'
>
> The code is inspired by Zach Holman's spark shell script.
>
> Example output (view in non-proportial font):
>
> Performance counter stats for 'true' (10 runs):
>
> 0.175672 task-clock (msec) # 0.555 CPUs utilized ( +- 1.77% ) █▄▁▁▁▁▁▁..
> 0 context-switches # 0.000 K/sec
> 0 cpu-migrations # 0.000 K/sec
> 114 page-faults # 0.647 M/sec ( +- 0.14% ) ▁█▁▁████..
> 520,798 cycles # 2.965 GHz ( +- 1.75% ) █▄▁▁▁▁▁▁..
> 433,525 instructions # 0.83 insns per cycle ( +- 0.28% ) ▅▇▅▄▇█▁▆..
> 83,012 branches # 472.537 M/sec ( +- 0.31% ) ▅▇▆▄▇█▁▆..
> 3,157 branch-misses # 3.80% of all branches ( +- 2.55% ) ▇█▃▅▁▃▁▂..
>
> 0.000316660 seconds time elapsed ( +- 1.78% ) █▅▁▁▁▁▁▁..
>
> As you can see even in the most simple run there are quite interesting
> patterns. The time sparkline suggests it would be also useful to have an option
> to throw the first measurement away.
>
> Known issues:
> - Makes the perf stat output wider. Could be adjust by shrinking
> some white space. Not done so far.
> - No output for -A/--per-socket/--per-core with -rX. This code
> is missing the basic noise detection code. Once it's added there
> sparklines could be shown too.
>
> v2: Avoid printing spark lines for normal CSV case (Jiri)
> v3: LONG->ULONG, random changes
> v4: Add some missing changes from the forked v2: checks value is not
> zero instead of all the same. Update documentation. Remove n variable.
> Remove #pragma once
> v5: Add overflow fixes from Jiri.
got compilation error on Fedora 15 i386:
CC util/stat.o
util/stat.c: In function ‘print_stat_spark’:
util/stat.c:91:2: error: passing argument 1 of ‘all_zero’ from incompatible pointer type [-Werror]
util/stat.c:71:12: note: expected ‘long unsigned int *’ but argument is of type ‘u64 *’
util/stat.c:94:2: error: passing argument 2 of ‘print_spark’ from incompatible pointer type [-Werror]
util/spark.h:3:6: note: expected ‘long unsigned int *’ but argument is of type ‘u64 *’
cc1: all warnings being treated as errors
make[1]: *** [util/stat.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
jirka
prev parent reply other threads:[~2014-06-03 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-30 21:42 Andi Kleen
2014-06-03 19:47 ` Jiri Olsa [this message]
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=20140603194702.GC4213@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=acme@infradead.org \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.org \
/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
all inboxes | Powered by JetHome®