From: kajoljain <kjain@linux.ibm.com>
To: Jiri Olsa <jolsa@kernel.org>, Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Michael Petlan <mpetlan@redhat.com>,
Joe Mario <jmario@redhat.com>, Andi Kleen <ak@linux.intel.com>,
John Garry <john.garry@huawei.com>
Subject: Re: [PATCHv2 0/3] perf tools: Add support for user defined metric
Date: Thu, 30 Apr 2020 16:54:41 +0530 [thread overview]
Message-ID: <8df4b32b-4abc-7ea9-feaf-a16be6edf64f@linux.ibm.com> (raw)
In-Reply-To: <20200421181337.988681-1-jolsa@kernel.org>
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.
Otherwise it works fine for me. Try by testing it for different metric expressions.
But still curious about reason for adding this support. Isn't json file is there for same purpose?
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(-)
>
next prev parent reply other threads:[~2020-04-30 11:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 18:13 [PATCHv2 0/3] perf tools: Add support for user defined metric Jiri Olsa
2020-04-21 18:13 ` [PATCH 1/3] perf expr: Add parsing support for multiple expressions Jiri Olsa
2020-04-21 18:13 ` [PATCH 2/3] perf expr: Allow comments in custom metric file Jiri Olsa
2020-04-21 18:13 ` [PATCH 3/3] perf stat: Add --metrics-file option Jiri Olsa
2020-04-21 18:36 ` Andi Kleen
2020-04-21 18:52 ` Jiri Olsa
2020-04-21 20:06 ` Andi Kleen
2020-04-23 13:24 ` Jiri Olsa
2020-04-30 11:24 ` kajoljain [this message]
2020-04-30 12:43 ` [PATCHv2 0/3] perf tools: Add support for user defined metric Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8df4b32b-4abc-7ea9-feaf-a16be6edf64f@linux.ibm.com \
--to=kjain@linux.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jmario@redhat.com \
--cc=john.garry@huawei.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mpetlan@redhat.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox