From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D0BBC4332F for ; Wed, 16 Nov 2022 23:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231688AbiKPXFG (ORCPT ); Wed, 16 Nov 2022 18:05:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbiKPXFF (ORCPT ); Wed, 16 Nov 2022 18:05:05 -0500 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B926317CD; Wed, 16 Nov 2022 15:05:05 -0800 (PST) Received: by mail-ot1-f51.google.com with SMTP id db10-20020a0568306b0a00b0066d43e80118so32697otb.1; Wed, 16 Nov 2022 15:05:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sch7gU4JnEJeZm0TBzlZLEZhC+3AQoj3+UVYWjWRf4Y=; b=VWxEk9L4tyQ8ZIkHG3Eat02HjroRu2diUWrcuAAa26m82dYJ9p7O1D9jLG8DJ1gp98 2SGOaysvYYk5VsZy1lTsVF5gBAjAFR8w0Y7AaxX6webhD1H9wasdunPprxoOsF6nYEHM Upw4sCmes+DX3Vf3IwhyZG5xJuYZzFa1UnNRoxDUNfWhXwhrnJYIQyeLAb55FyHycMZe 5ZiebClQRbfxm9mC53Fc1swB5G694C6tDx32TGtH7lO+zakIHRxmbpWQev6z1CC6iNou V8aGUEIYVLk3XQVAMt8VLRCOZ6nUy55QC1irQawLJA4WgVKDzo52uufxq7sCags1zpSK xlvg== X-Gm-Message-State: ANoB5pnv0XPJpYSC8bJsQ5evv+TdKnHirhbiU9KscrC6IcREh4g9bHfu uqNAZWKsHg4banNCl52UQTBCGSphGtiuwggbuaXCOUsC X-Google-Smtp-Source: AA0mqf7TtJVP83TCvzFw7lohwMhWEajHyRUN2mHS1nCyxot6jnARFVNR6lxYPj/Vz0BYXz65jqK06TvbSxJFTIxBW0g= X-Received: by 2002:a05:6830:1215:b0:66d:78b8:7b1a with SMTP id r21-20020a056830121500b0066d78b87b1amr175243otp.206.1668639904228; Wed, 16 Nov 2022 15:05:04 -0800 (PST) MIME-Version: 1.0 References: <20221114210723.2749751-1-irogers@google.com> <20221114210723.2749751-11-irogers@google.com> In-Reply-To: From: Namhyung Kim Date: Wed, 16 Nov 2022 15:04:52 -0800 Message-ID: Subject: Re: [PATCH v3 10/10] perf list: Add json output option To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Weilin Wang , Perry Taylor , Caleb Biggers , Leo Yan , Adrian Hunter , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Sandipan Das , Kajol Jain , Zhengjun Xing , Kan Liang , Ravi Bangoria , Xin Gao , Rob Herring , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Stephane Eranian Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Hi, On Tue, Nov 15, 2022 at 5:44 AM Arnaldo Carvalho de Melo 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 > 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 > Tested-by: Arnaldo Carvalho de Melo > Cc: Adrian Hunter > Cc: Alexander Shishkin > Cc: Caleb Biggers > Cc: Jiri Olsa > Cc: Kajol Jain > Cc: Kan Liang > Cc: Leo Yan > Cc: Mark Rutland > Cc: Namhyung Kim > Cc: Perry Taylor > Cc: Peter Zijlstra > Cc: Ravi Bangoria > Cc: Rob Herring > Cc: Sandipan Das > Cc: Stephane Eranian > Cc: Weilin Wang > Cc: Xin Gao > Cc: Xing Zhengjun > Link: http://lore.kernel.org/lkml/20221114210723.2749751-11-irogers@google.com > Signed-off-by: Arnaldo Carvalho de Melo