Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4373400pxb; Tue, 25 Jan 2022 09:02:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPU4WPY3kgzXZZRbhEg1kE5CFzAR5H3yV9JLyxQjf38YoRKDBthxLc/o4POxreSf16yK/m X-Received: by 2002:a63:a84b:: with SMTP id i11mr15752996pgp.486.1643130155095; Tue, 25 Jan 2022 09:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643130155; cv=none; d=google.com; s=arc-20160816; b=zoMPOS+3qxiDdelW6KVSIGxdRJhYOXcNdOTQMgs8boNH99z4dYsRI62BdvEwZZEEBG 2hJ5wuzRCPKWYMGaEEW/g6QOGhzTKBj3SMj8N4eF12WsdJIN0hvBLGTOODcRIe1MG9O6 K5nMzc5Z6zeoctHUSk5eFuVHvYLEmRyY+fBRkwmn2zOaYbkNjKVEL/OIcF3YogDv69lh bt+Vcav6zDsCPlsjjKQjvr2puDpXWN2D2nDdtQodpiRmUlOK5W6lsRB43r7/8o+Thk1N b3JUGyXtfMjdcwkZxa6oa7RQWod8wX4lhB9OiLSXrM3C0jj7R5HWdLIzbNgZIytEk7i2 B9/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature; bh=PR6uwgDgL7aChE501knvgOsvQhUSV8GT+c6/3WqDTls=; b=R2Qo/Peltp5oTZO0kUWGSjfjTzxSxw1XEESXTiBQDehEX0fkPDxkc2OriWbGGzOjHv ryYkg/BHR1xqaQ61zrOWUoeEAd0k+QjFufR0cUu2HBfmBKhIaCMVTE2JmmZ17SBU+uNH 8TeUrrhUSVoSDXxVSwB/jZqd0YkF4gvwpFqk3kPGDS8rjNbZ9VP2SB/Q5mlAGy4V8Q0n /idA1IVk5K7KbzWEhx4X2VIY29AOatTHEjRsya51tEs/QU4jjC7+GC/cLvEWBOs0HOKu BdMN/2SZjX/cFc0EdMcj4LqBqeL7aMoZn9O97X28GNey8GSwKqs/lIrfe+HJ1oZr+uFo nvoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nEcDwqik; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 20si15514971pll.0.2022.01.25.09.02.21; Tue, 25 Jan 2022 09:02:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nEcDwqik; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1455463AbiAYMqG (ORCPT + 99 others); Tue, 25 Jan 2022 07:46:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1453176AbiAYMmr (ORCPT ); Tue, 25 Jan 2022 07:42:47 -0500 Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C12F3C061755 for ; Tue, 25 Jan 2022 04:42:29 -0800 (PST) Received: by mail-oo1-xc2e.google.com with SMTP id c7-20020a4ad207000000b002e7ab4185d2so2425463oos.6 for ; Tue, 25 Jan 2022 04:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:user-agent:in-reply-to:references :message-id:mime-version:content-transfer-encoding; bh=PR6uwgDgL7aChE501knvgOsvQhUSV8GT+c6/3WqDTls=; b=nEcDwqikpSLn+ljJFPPhKo9EGtJYfxAUheWug68vPrtfCrIM+nZIdSfeEWYoMJvdiM nqhebEsJCoMBqiBfK14DOXM1OugAP3nX2FT+qcr7AvsSgNaRjZyJ3bfZ5uRa6cyxUfWH eDZrwvQrnDQjssuv98D6z8iAOhuF2PYhFNXVCBFZxCUggW8tEb7oo8JwuHLLskPkRflR NJG1lr68guCOpMGIzvgj/ZrF4OQCLQahunWMcfckBjrd7IEATn67z9yJtkoZL3FXRy8g OFm/m0WvuSXLCV76gTYHctRxTq5QlY172VBUh4CfNcUmSSV7xw0lkIdbFmuTKX06oUVS RNbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:user-agent:in-reply-to :references:message-id:mime-version:content-transfer-encoding; bh=PR6uwgDgL7aChE501knvgOsvQhUSV8GT+c6/3WqDTls=; b=e2M2NXcIogCiz9BpovjohXVXAEFahrOTzLxbZ1Q+ripYzt/6H2eI/6EVRko2nXZDcv Ys7n9KV1yKE1cB30j+ybBAL+28WNAIif29pICTCzUI22/QY+NiiAqSCgpTkOcndMo6HL lr1+6DPnnlkl91LnQW6nqyRIAFhi5ua0l+Ma1p1DpyVAabzqtVf/iOBywsTUKeLsZ78g iZ2DbU/K3462HXBRWeTqdfHVJUm7JkKvMelOLYQadUmzuT3cHyiw8WTu/RV5WGdL/7cU 5Gi9bGVdBNzsYjKO0+KqFyFF+b0hVDiV3Qy5ML+qpgKBdLimUhwpOrZ11/U+PZBxEyZO T0EA== X-Gm-Message-State: AOAM531wcogj6kGbcYNpL4UyiLj9TgiMtDBqsttIkFFs6ZFIcXkIUEPZ FnTaN3nNnyWl4I41tjg1WRizuRtHz1U= X-Received: by 2002:a4a:c593:: with SMTP id x19mr13206268oop.52.1643114549052; Tue, 25 Jan 2022 04:42:29 -0800 (PST) Received: from [127.0.0.1] ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id c26sm5851110oov.22.2022.01.25.04.42.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Jan 2022 04:42:28 -0800 (PST) Date: Tue, 25 Jan 2022 09:41:49 -0300 From: Arnaldo Carvalho de Melo To: John Garry , Jiri Olsa , Arnaldo Carvalho de Melo CC: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Joe Mario , Andi Kleen , Kajol Jain , "liuqi (BA)" , Guangbin Huang , Zhangshaokun , "irogers@google.com" Subject: Re: [PATCHv3 0/4] perf tools: Add support for user defined metric User-Agent: K-9 Mail for Android In-Reply-To: <2e2da73a-7085-b488-4764-705adbff70cc@huawei.com> References: <20200511205307.3107775-1-jolsa@kernel.org> <2e2da73a-7085-b488-4764-705adbff70cc@huawei.com> Message-ID: <0DF6E63D-C359-4D81-8F87-A64D30D75BCA@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On January 25, 2022 9:34:19 AM GMT-03:00, John Garry wrote: >On 11/05/2020 21:53, Jiri Olsa wrote: > >+ > >Hi jirka, > >Did you a plan to continue to work? I don't think that this support was= =20 >ever merged=2E > >We have a requirement to be able to tune parameters of metrics, and=20 >support here seems suitable=2E John,=20 Have you tried to apply that series to see if it still applies? - Arnaldo > >Thanks, >John > >> hi, >> Joe asked for possibility to add user defined metrics=2E Given that >> we already have metrics support, I added --metrics-file option that >> allows to specify custom metrics=2E >>=20 >> $ cat metrics >> # IPC >> mine1 =3D instructions / cycles; >> /* DECODED_ICACHE_UOPS% */ >> mine2 =3D 100 * (idq=2Edsb_uops / \ (idq=2Ems_uops + idq=2Emite_uops= + idq=2Edsb_uops + lsd=2Euops)); >>=20 >> $ sudo perf stat --metrics-file =2E/metrics -M mine1,mine2 --metric-= only -a -I 1000 >> # time insn per cycle mine1 = mine2 >> 1=2E000536263 0=2E71 0=2E7 = 41=2E4 >> 2=2E002069025 0=2E31 0=2E3 = 14=2E1 >> 3=2E003427684 0=2E27 0=2E3 = 14=2E8 >> 4=2E004807132 0=2E25 0=2E2 = 12=2E1 >> =2E=2E=2E >>=20 >> v3 changes: >> - added doc for metrics file in perf stat man page >> - reporting error line number now >> - changed '#' style comment to C way with '//' >>=20 >> v2 changes: >> - add new --metrics-file option >> - rebased on current perf/core expression bison/flex enhancements >>=20 >> Also available in: >> git://git=2Ekernel=2Eorg/pub/scm/linux/kernel/git/jolsa/perf=2Egit >> perf/metric >>=20 >> thanks, >> jirka >>=20 >>=20 >> --- >> Jiri Olsa (4): >> perf expr: Add parsing support for multiple expressions >> perf expr: Allow comments in custom metric file >> perf stat: Add --metrics-file option >> perf expr: Report line number with error >>=20 >> tools/perf/Documentation/perf-stat=2Etxt | 77 +++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> tools/perf/builtin-stat=2Ec | 7 +++++-- >> tools/perf/tests/expr=2Ec | 18 ++++++++++++++++++ >> tools/perf/util/expr=2Ec | 6 ++++++ >> tools/perf/util/expr=2Eh | 21 +++++++++++++++++++-- >> tools/perf/util/expr=2El | 34 +++++++++++++++++++++++= +++++++++++ >> tools/perf/util/expr=2Ey | 21 +++++++++++++++++---- >> tools/perf/util/metricgroup=2Ec | 70 +++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++------- >> tools/perf/util/metricgroup=2Eh | 3 ++- >> tools/perf/util/stat=2Eh | 1 + >> 10 files changed, 242 insertions(+), 16 deletions(-) >>=20 >> =2E >>=20 >