linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/3] perf tools: Add support for used defined metric
@ 2019-12-11 22:47 Jiri Olsa
  2019-12-11 22:47 ` [PATCH 1/3] perf tools: Factor metric addition into add_metric function Jiri Olsa
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jiri Olsa @ 2019-12-11 22:47 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, Ingo Molnar, Namhyung Kim, Alexander Shishkin,
	Peter Zijlstra, Michael Petlan, Joe Mario, Andi Kleen,
	Kajol Jain

hi,
Joe asked for possibility to add user defined metrics. Given that
we already have metrics support, I added --metric option that allows
to specify metric on the command line, like:

  # perf stat  --metric 'DECODED_ICACHE_UOPS% = 100 * (idq.dsb_uops / \
    (idq.ms_uops + idq.mite_uops + idq.dsb_uops + lsd.uops))' ...

The code facilitates the current metric code, and I was surprised
how easy it was, so I'm not sure I omitted something ;-)

Also available in:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/metric

thoughts?
jirka

---
Jiri Olsa (3):
      perf tools: Factor metric addition into add_metric function
      perf tools: Factor metric setup code into metricgroup__setup function
      perf stat: Add --metric option

 tools/perf/Documentation/perf-stat.txt |  16 ++++++++++
 tools/perf/builtin-stat.c              |  21 +++++++++++++
 tools/perf/util/metricgroup.c          | 189 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------
 tools/perf/util/metricgroup.h          |   2 ++
 4 files changed, 168 insertions(+), 60 deletions(-)


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

end of thread, other threads:[~2019-12-12  9:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 22:47 [RFC 0/3] perf tools: Add support for used defined metric Jiri Olsa
2019-12-11 22:47 ` [PATCH 1/3] perf tools: Factor metric addition into add_metric function Jiri Olsa
2019-12-11 22:47 ` [PATCH 2/3] perf tools: Factor metric setup code into metricgroup__setup function Jiri Olsa
2019-12-11 22:48 ` [PATCH 3/3] perf stat: Add --metric option Jiri Olsa
2019-12-11 23:02   ` Andi Kleen
2019-12-12  9:41     ` Jiri Olsa
2019-12-11 23:01 ` [RFC 0/3] perf tools: Add support for used defined metric Andi Kleen
2019-12-12  9:37   ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).