Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1314873

Re: perf, tools: Refactor and support interval and CSV metrics

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: perf, tools: Refactor and support interval and CSV metrics
Date 2016-01-22 11:20 +0100
Message-ID <qTGYW-2El-7@gated-at.bofh.it> (permalink)
References <qSQH0-8jG-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jan 19, 2016 at 06:26:43PM -0800, Andi Kleen wrote:
> [v5: Fix mainly bisect problems. No regressions introduced by one
> patch and fixed again later. Some minor fixes in addition]
> [v6: Fix running/noise printing patch.]
> [v7: Reorder and merge two patches to avoid a bisect hole where unsupported was
> printed as 0]
> [v8: Minor fixes for review feedback. See changelog in patches.]
> [v9: Fix newline bug. Add support for -A for --metric-only]
> 
> 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,
> and finally a --metric-only 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-2.6 perf/stat-metrics-13

this looks like great test candidate for the testing
suite Michael is working on.. CC-ed

thanks,
jirka

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

perf, tools: Refactor and support interval and CSV metrics Andi Kleen <andi@firstfloor.org> - 2016-01-20 03:30 +0100
  [PATCH 7/9] perf, tools, stat: Implement --metric-only mode Andi Kleen <andi@firstfloor.org> - 2016-01-20 03:30 +0100
  [PATCH 9/9] perf, tools, stat: Fix indentation of counter running printout Andi Kleen <andi@firstfloor.org> - 2016-01-20 03:30 +0100
  [PATCH 5/9] perf, tools: Support metrics in --per-core/socket mode Andi Kleen <andi@firstfloor.org> - 2016-01-20 03:40 +0100
  [PATCH 8/9] perf, tools: Add --metric-only support for -A Andi Kleen <andi@firstfloor.org> - 2016-01-20 03:40 +0100
  [PATCH 1/9] perf, tools, stat: Abstract stat metrics printing Andi Kleen <andi@firstfloor.org> - 2016-01-20 03:40 +0100
    Re: [PATCH 1/9] perf, tools, stat: Abstract stat metrics printing Jiri Olsa <jolsa@redhat.com> - 2016-01-22 10:50 +0100
    Re: [PATCH 1/9] perf, tools, stat: Abstract stat metrics printing Jiri Olsa <jolsa@redhat.com> - 2016-01-22 11:10 +0100
  Re: perf, tools: Refactor and support interval and CSV metrics Jiri Olsa <jolsa@redhat.com> - 2016-01-22 11:20 +0100

csiph-web