public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] perf stat: add interval counter printing
@ 2013-01-18 13:06 Stephane Eranian
  2013-01-18 13:06 ` [PATCH v2 1/2] perf tools: add evsel prev_raw_count field Stephane Eranian
  2013-01-18 13:06 ` [PATCH v2 2/2] perf stat: add interval printing Stephane Eranian
  0 siblings, 2 replies; 8+ messages in thread
From: Stephane Eranian @ 2013-01-18 13:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, ak, acme, jolsa, namhyung.kim

This small patchset extends perf stat with the -I option.

The -I option enables interval printing. It expects
an interval duration in milliseconds. Minimum is
100ms. Once, activated perf stat prints events deltas
since last printout. All modes are supported.

$ perf stat -I 1000 -e cycles noploop 10
noploop for 10 seconds
1.000086918         2385155642 cycles                    #    0.000 GHz
2.000267937         2392279774 cycles                    #    0.000 GHz
3.000385400         2390971450 cycles                    #    0.000 GHz
4.000504408         2390996752 cycles                    #    0.000 GHz
5.000626878         2390853097 cycles                    #    0.000 GHz

The output format makes it easy to feed into a plotting program
such as gnuplot when the -I option is used in combination with the -x
option:

$ perf stat -x, -I 1000 -e cycles noploop 10
noploop for 10 seconds
1.000084113,2378775498,cycles
2.000245798,2391056897,cycles
3.000354445,2392089414,cycles
4.000459115,2390936603,cycles
5.000565341,2392108173,cycles

The first patch adds the code to keep previous counts. The second
is the actual extension of perf stat.

In v2, we changed the option from -T to -I based on feedback
from Andi Kleen (who is using -T in an upcoming patch).

Signed-off-by: Stephane Eranian <eranian@google.com>

Stephane Eranian (2):
  perf tools: add evsel prev_raw_count field
  perf stat: add interval printing

 tools/perf/Documentation/perf-stat.txt |    4 +
 tools/perf/builtin-stat.c              |  157 ++++++++++++++++++++++++++++----
 tools/perf/util/evsel.c                |   21 +++++
 tools/perf/util/evsel.h                |    1 +
 4 files changed, 167 insertions(+), 16 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-18 14:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-18 13:06 [PATCH v2 0/2] perf stat: add interval counter printing Stephane Eranian
2013-01-18 13:06 ` [PATCH v2 1/2] perf tools: add evsel prev_raw_count field Stephane Eranian
2013-01-18 13:49   ` Jiri Olsa
2013-01-18 13:06 ` [PATCH v2 2/2] perf stat: add interval printing Stephane Eranian
2013-01-18 13:50   ` Jiri Olsa
2013-01-18 13:59     ` Stephane Eranian
2013-01-18 14:05       ` Jiri Olsa
2013-01-18 14:09       ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox