From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
Weilin Wang <weilin.wang@intel.com>,
Perry Taylor <perry.taylor@intel.com>,
Caleb Biggers <caleb.biggers@intel.com>,
Leo Yan <leo.yan@linaro.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Sandipan Das <sandipan.das@amd.com>,
Kajol Jain <kjain@linux.ibm.com>,
Zhengjun Xing <zhengjun.xing@linux.intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
Ravi Bangoria <ravi.bangoria@amd.com>,
Xin Gao <gaoxin@cdjrlc.com>, Rob Herring <robh@kernel.org>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH v3 10/10] perf list: Add json output option
Date: Wed, 16 Nov 2022 15:04:52 -0800 [thread overview]
Message-ID: <CAM9d7ch3SkBzjXUsGXKTqQzAkvCpm1jOmf5YEf609t1v=4v0wg@mail.gmail.com> (raw)
In-Reply-To: <Y3OX1pcclKCgbpeT@kernel.org>
Hi,
On Tue, Nov 15, 2022 at 5:44 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Em Mon, Nov 14, 2022 at 01:07:23PM -0800, Ian Rogers escreveu:
> > Output events and metrics in a json format by overriding the print
> > callbacks. Currently other command line options aren't supported and
> > metrics are repeated once per metric group.
>
> Applied the patch with a few fixes and added this to the last cset:
>
> commit c9367a0658ebcfe8ab0bc4af2648f144c64b53a4
> Author: Ian Rogers <irogers@google.com>
> Date: Mon Nov 14 13:07:23 2022 -0800
>
> perf list: Add JSON output option
>
> Output events and metrics in a JSON format by overriding the print
> callbacks. Currently other command line options aren't supported and
> metrics are repeated once per metric group.
>
> Committer testing:
>
> $ perf list cache
>
> List of pre-defined events (to be used in -e or -M):
>
> L1-dcache-load-misses [Hardware cache event]
> L1-dcache-loads [Hardware cache event]
> L1-dcache-prefetches [Hardware cache event]
> L1-icache-load-misses [Hardware cache event]
> L1-icache-loads [Hardware cache event]
> branch-load-misses [Hardware cache event]
> branch-loads [Hardware cache event]
> dTLB-load-misses [Hardware cache event]
> dTLB-loads [Hardware cache event]
> iTLB-load-misses [Hardware cache event]
> iTLB-loads [Hardware cache event]
> $ perf list --json cache
> [
> {
> "Unit": "cache",
It's confusing to call it 'unit', but we have it in the JSON metrics, sigh..
Thanks,
Namhyung
> "EventName": "L1-dcache-load-misses",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "L1-dcache-loads",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "L1-dcache-prefetches",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "L1-icache-load-misses",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "L1-icache-loads",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "branch-load-misses",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "branch-loads",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "dTLB-load-misses",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "dTLB-loads",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "iTLB-load-misses",
> "EventType": "Hardware cache event"
> },
> {
> "Unit": "cache",
> "EventName": "iTLB-loads",
> "EventType": "Hardware cache event"
> }
> ]
> $
>
> Signed-off-by: Ian Rogers <irogers@google.com>
> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Caleb Biggers <caleb.biggers@intel.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Kajol Jain <kjain@linux.ibm.com>
> Cc: Kan Liang <kan.liang@linux.intel.com>
> Cc: Leo Yan <leo.yan@linaro.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Perry Taylor <perry.taylor@intel.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ravi Bangoria <ravi.bangoria@amd.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Sandipan Das <sandipan.das@amd.com>
> Cc: Stephane Eranian <eranian@google.com>
> Cc: Weilin Wang <weilin.wang@intel.com>
> Cc: Xin Gao <gaoxin@cdjrlc.com>
> Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
> Link: http://lore.kernel.org/lkml/20221114210723.2749751-11-irogers@google.com
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
prev parent reply other threads:[~2022-11-16 23:05 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 21:07 [PATCH v3 00/10] Restructure perf list and add json output Ian Rogers
2022-11-14 21:07 ` [PATCH v3 01/10] perf pmu: Remove is_hybrid member Ian Rogers
2022-11-14 21:07 ` [PATCH v3 02/10] perf pmu: Add documentation Ian Rogers
2022-11-14 21:07 ` [PATCH v3 03/10] tools lib api fs tracing_path: Add scandir alphasort Ian Rogers
2022-11-14 21:07 ` [PATCH v3 04/10] perf tracepoint: Sort events in iterator Ian Rogers
2022-11-14 21:07 ` [PATCH v3 05/10] perf list: Generalize limiting to a PMU name Ian Rogers
2022-11-14 21:07 ` [PATCH v3 06/10] perf list: Simplify cache event printing Ian Rogers
2022-11-15 13:33 ` Arnaldo Carvalho de Melo
2022-11-14 21:07 ` [PATCH v3 07/10] perf list: Simplify symbol " Ian Rogers
2022-11-14 21:07 ` [PATCH v3 08/10] perf pmu: Restructure print_pmu_events Ian Rogers
2022-11-14 21:07 ` [PATCH v3 09/10] perf list: Reorganize to use callbacks Ian Rogers
2022-11-15 13:40 ` Arnaldo Carvalho de Melo
2022-11-15 16:53 ` Ian Rogers
2022-11-14 21:07 ` [PATCH v3 10/10] perf list: Add json output option Ian Rogers
2022-11-15 13:44 ` Arnaldo Carvalho de Melo
2022-11-16 11:23 ` Arnaldo Carvalho de Melo
2022-11-16 11:35 ` Arnaldo Carvalho de Melo
2022-11-16 11:51 ` Arnaldo Carvalho de Melo
2022-11-16 12:41 ` Arnaldo Carvalho de Melo
2022-11-16 13:10 ` Arnaldo Carvalho de Melo
2022-11-16 15:21 ` Arnaldo Carvalho de Melo
2022-11-16 19:52 ` Ian Rogers
2022-11-17 16:31 ` Arnaldo Carvalho de Melo
2022-11-17 16:47 ` Arnaldo Carvalho de Melo
2022-11-18 2:47 ` Ian Rogers
2022-11-16 23:04 ` Namhyung Kim [this message]
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='CAM9d7ch3SkBzjXUsGXKTqQzAkvCpm1jOmf5YEf609t1v=4v0wg@mail.gmail.com' \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=caleb.biggers@intel.com \
--cc=eranian@google.com \
--cc=gaoxin@cdjrlc.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=kjain@linux.ibm.com \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=perry.taylor@intel.com \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=robh@kernel.org \
--cc=sandipan.das@amd.com \
--cc=weilin.wang@intel.com \
--cc=zhengjun.xing@linux.intel.com \
/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;
as well as URLs for NNTP newsgroup(s).