lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 30 Apr 2020 14:43:06 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     kajoljain <kjain@...ux.ibm.com>
Cc:     Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Michael Petlan <mpetlan@...hat.com>,
        Joe Mario <jmario@...hat.com>, Andi Kleen <ak@...ux.intel.com>,
        John Garry <john.garry@...wei.com>
Subject: Re: [PATCHv2 0/3] perf tools: Add support for user defined metric

On Thu, Apr 30, 2020 at 04:54:41PM +0530, kajoljain wrote:
> 
> 
> On 4/21/20 11:43 PM, Jiri Olsa wrote:
> > hi,
> > Joe asked for possibility to add user defined metrics. Given that
> > we already have metrics support, I added --metrics-file option that
> > allows to specify custom metrics.
> > 
> >   $ cat metrics
> >   # IPC
> >   mine1 = instructions / cycles;
> >   /* DECODED_ICACHE_UOPS% */
> >   mine2 = 100 * (idq.dsb_uops / \ (idq.ms_uops + idq.mite_uops + idq.dsb_uops + lsd.uops));
> > 
> >   $ sudo perf stat --metrics-file ./metrics -M mine1,mine2 --metric-only -a -I 1000
> >   #           time       insn per cycle                mine1                mine2
> >        1.000536263                0.71                   0.7                 41.4
> >        2.002069025                0.31                   0.3                 14.1
> >        3.003427684                0.27                   0.3                 14.8
> >        4.004807132                0.25                   0.2                 12.1
> >   ...
> > 
> > v2 changes:
> >   - add new --metrics-file option
> >   - rebased on current perf/core expression bison/flex enhancements
> > 
> > Also available in:
> >   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
> >   perf/metric
> > 
> > thanks,
> > jirka
> > 
> > 
> > ---
> > Jiri Olsa (3):
> >       perf expr: Add parsing support for multiple expressions
> >       perf expr: Allow comments in custom metric file
> >       perf stat: Add --metrics-file option
> 
> Hi Jiri,
>      I try to look into these patches. As far as I understand we are using
> syntax "Name: Expression" for user defined events. It will be great if we mention
> this format somewhere for users.

right, Andi also asked for that, I'll describe it in a man page

> 
> Otherwise it works fine for me. Try by testing it for different metric expressions.

thanks for testing

> But still curious about reason for adding this support. Isn't json file is there for same purpose?

we've been asked by Joe about the possibility to specify metric by user
through the command line..  with json you have all them compiled in and 
you can't change them or specify your own without recompiling perf

jirka

> 
> Thanks,
> Kajol Jain
> > 
> >  tools/perf/Documentation/perf-stat.txt |  3 +++
> >  tools/perf/builtin-stat.c              |  7 +++++--
> >  tools/perf/tests/expr.c                | 13 +++++++++++++
> >  tools/perf/util/expr.c                 |  6 ++++++
> >  tools/perf/util/expr.h                 | 19 +++++++++++++++++--
> >  tools/perf/util/expr.l                 | 24 ++++++++++++++++++++++++
> >  tools/perf/util/expr.y                 | 13 ++++++++++++-
> >  tools/perf/util/metricgroup.c          | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
> >  tools/perf/util/metricgroup.h          |  3 ++-
> >  tools/perf/util/stat.h                 |  1 +
> >  10 files changed, 142 insertions(+), 13 deletions(-)
> > 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ