lkml.org 
[lkml]   [2022]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 10/10] perf list: Add json output option
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>

\
 
 \ /
  Last update: 2022-11-17 00:06    [W:0.304 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site