From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: acme@kernel.org, jolsa@kernel.org, eranian@google.com,
linux-kernel@vger.kernel.org
Subject: Re: perf, tools: Refactor and support interval and CSV metrics v2
Date: Wed, 5 Aug 2015 09:34:50 +0200 [thread overview]
Message-ID: <20150805073450.GE20530@krava.redhat.com> (raw)
In-Reply-To: <1438649408-20807-1-git-send-email-andi@firstfloor.org>
On Mon, Aug 03, 2015 at 05:50:00PM -0700, Andi Kleen wrote:
> [v2: Addressed (near) all review feedback. No manpage updates so far.
> Add support for --per-core metrics. Various cleanups.]
>
> Currently perf stat does not support printing computed metrics for interval (-I xxx)
> or CSV (-x,) mode. For example IPC or TSX metrics over time are quite useful to know.
>
> This patch implements them. The main obstacle was that the
> metrics printing was all open coded all over the metrics computation code.
> The second patch refactors the metrics printing to work through call backs that
> can be more easily changed. This also cleans up the metrics printing significantly.
> The indentation is now handled through printf, no more need to manually count spaces.
>
> Then based on that it implements metrics printing for CSV and interval mode.
>
> Example output:
>
> % perf stat -I1000 -a sleep 1
> # time counts unit events metric multiplex
> 1.001301370 12020.049593 task-clock (msec) (100.00%)
> 1.001301370 3,952 context-switches # 0.329 K/sec (100.00%)
> 1.001301370 69 cpu-migrations # 0.006 K/sec (100.00%)
> 1.001301370 76 page-faults # 0.006 K/sec
> 1.001301370 386,582,789 cycles # 0.032 GHz (100.00%)
> 1.001301370 716,441,544 stalled-cycles-frontend # 185.33% frontend cycles idle (100.00%)
> 1.001301370 <not supported> stalled-cycles-backend
> 1.001301370 101,751,678 instructions # 0.26 insn per cycle
> 1.001301370 # 7.04 stalled cycles per insn (100.00%)
> 1.001301370 20,914,692 branches # 1.740 M/sec (100.00%)
> 1.001301370 1,943,630 branch-misses # 9.29% of all branches
>
> CSV mode
>
> % perf stat -x, -I1000 -a sleep 1
> 1.000852081,12016.143006,,task-clock
> 1.000852081,4457,,context-switches,12015168277,100.00,0.371,K/sec
> 1.000852081,50,,cpu-migrations,12014024424,100.00,0.004,K/sec
> 1.000852081,76,,page-faults,12013076716,100.00,0.006,K/sec
> 1.000852081,515854373,,cycles,12011235336,100.00,0.043,GHz
> 1.000852081,1030742150,,stalled-cycles-frontend,12010984057,100.00,199.81,frontend cycles idle
> 1.000852081,<not supported>,,stalled-cycles-backend,0,100.00
> 1.000852081,116782495,,instructions,12011130729,100.00,0.23,insn per cycle
> 1.000852081,,,,12011130729,100.00,8.83,stalled cycles per insn
> 1.000852081,23748237,,branches,12010745125,100.00,1.976,M/sec
> 1.000852081,1976560,,branch-misses,12010501884,100.00,8.32,of all branches
>
>
> Available in
> git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc perf/stat-metrics-2
got build failure:
CC builtin-stat.o
builtin-stat.c: In function ‘aggr_update_shadow’:
builtin-stat.c:848:10: error: implicit declaration of function ‘scale_val’ [-Werror=implicit-function-declaration]
val = scale_val(counter, val);
^
builtin-stat.c:848:4: error: nested extern declaration of ‘scale_val’ [-Werror=nested-externs]
val = scale_val(counter, val);
^
cc1: all warnings being treated as errors
/home/jolsa/kernel/linux-perf/tools/build/Makefile.build:68: recipe for target 'builtin-stat.o' failed
make[2]: *** [builtin-stat.o] Error 1
Makefile.perf:296: recipe for target 'perf-in.o' failed
make[1]: *** [perf-in.o] Error 2
Makefile:68: recipe for target 'all' failed
make: *** [all] Error 2
jirka
next prev parent reply other threads:[~2015-08-05 7:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 0:50 perf, tools: Refactor and support interval and CSV metrics v2 Andi Kleen
2015-08-04 0:50 ` [PATCH 1/8] perf, tools: Remove trail argument to color vsprintf Andi Kleen
2015-08-06 7:03 ` [tip:perf/core] perf " tip-bot for Jiri Olsa
2015-08-04 0:50 ` [PATCH 2/8] perf, tools: Do not include escape sequences in color_vfprintf return Andi Kleen
2015-08-06 7:03 ` [tip:perf/core] perf " tip-bot for Andi Kleen
2015-08-04 0:50 ` [PATCH 3/8] perf, tools, stat: Move sw clock metrics printout to stat-shadow Andi Kleen
2015-08-04 0:50 ` [PATCH 4/8] perf, tools, stat: Abstract stat metrics printing Andi Kleen
2015-08-04 0:50 ` [PATCH 5/8] perf, tools, stat: Add support for metrics in interval mode Andi Kleen
2015-08-04 0:50 ` [PATCH 6/8] perf, tools, stat: Move noise/running printing into printout Andi Kleen
2015-08-04 0:50 ` [PATCH 7/8] perf, tools, stat: Implement CSV metrics output Andi Kleen
2015-08-04 0:50 ` [PATCH 8/8] perf, tools: Support metrics in --per-core/socket mode Andi Kleen
2015-08-05 7:34 ` Jiri Olsa [this message]
2015-08-05 15:42 ` perf, tools: Refactor and support interval and CSV metrics v2 Andi Kleen
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=20150805073450.GE20530@krava.redhat.com \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.