lkml.org 
[lkml]   [2019]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 0/3] perf tools: Add support for used defined metric
On Wed, Dec 11, 2019 at 11:47:57PM +0100, Jiri Olsa wrote:
> 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 ;-)

There are some asserts you can hit, like for too many events.

Also some of the syntax (e.g. using @ instead of / and escapes) are
not super user friendly.

Other than that it should be ok.

Of course it would be better to put it into a file,
and then support comments etc.

I've been considering some extensions to perf to support @file
reading with comment support.

Right now there are some very odd bugs when you do that, lie

-e 'event,<newline>
event,<newline>
event...'

adds the newline to the event name, which breaks the output formats.

-Andi

\
 
 \ /
  Last update: 2019-12-12 00:01    [W:0.047 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site