Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp720264pxb; Wed, 29 Sep 2021 08:20:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDCaZ4pNF/qb36CNxralBz+xt0z+6zDk7SJ2YcjVJrlj6FLxWHZIUB1Gjk/FTjWHksI8ux X-Received: by 2002:a50:e145:: with SMTP id i5mr570332edl.16.1632928837370; Wed, 29 Sep 2021 08:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632928837; cv=none; d=google.com; s=arc-20160816; b=TDqzH76+Wt3H6aTWhYFRTAOdG5Koj6kxy8BUNxL3QyRBTvCBvx/t+f17GO2O8b14yE juJWtzBwvbGnWssaRqEIJqaiEelhLjGyhhAU9z8859EQL0j5lSdQ8y3Vkp6ojPGAc2x2 MDtFkzgUrfygxQrg71YRKjjv0jweFaZvnh6nGlUKab5z/ScrvPxNeM5fxoxyLxyPb8Dj 5UHUJ2HMwoxsJi+p7usobp3OeoHTmKdWpc0trpGXjboxj8Q3jr7V10Joz4sTUyXmWA4M xBchMeK//uxSrshYuKDjOs57Qhp/SDDbgzIcqV7yZaqZGbmAWmTX/5XKkiouRZm1F6Ej YErQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=3tHMmdGKaB9vXaeO9vg5kRFdA1IrxJzqam782xQxIDE=; b=r8XZEI5Y/0JXHg4UDfuOAibeflfqmAUZx++fsqjabTgWOfTGq8Om+pJSgXg42iWp0J diWdk/YYT7xzwM0INiFIyU4rnmIbWZ8VEzG7IVa0fO9hCeyS3s4emzmPVLkAM5rJ+KV/ q7YqEkYn3YgWKn8a1sXSgZa/JGMydmXH2jIjJXnuFv8phNAg1O9I4nzbviTGex3ygk7m HptESmjXpcwcuWfWGPBNvJBoNPIMTDMvGFVxgWysmKFVTDWkYBLvSMtvTVGmhN5AyNgQ lbW6X+vL/sVLF0nF/oaJXjRDEpe3O4Ps1C4YgBCbl6i1n5M37LABmfxsPasv+75ME/0t kViQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o14si180123edr.422.2021.09.29.08.20.11; Wed, 29 Sep 2021 08:20:37 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345085AbhI2PRu (ORCPT + 99 others); Wed, 29 Sep 2021 11:17:50 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3891 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345079AbhI2PRt (ORCPT ); Wed, 29 Sep 2021 11:17:49 -0400 Received: from fraeml712-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4HKKdR1LCKz67Ntj; Wed, 29 Sep 2021 23:13:31 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml712-chm.china.huawei.com (10.206.15.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 29 Sep 2021 17:16:06 +0200 Received: from [10.47.26.77] (10.47.26.77) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 29 Sep 2021 16:16:05 +0100 Subject: Re: [PATCH v9 00/13] Don't compute events that won't be used in a metric. To: Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , "Namhyung Kim" , , Andi Kleen , Jin Yao , Paul Clarke , kajoljain , CC: Stephane Eranian , Sandeep Dasgupta References: <20210923074616.674826-1-irogers@google.com> From: John Garry Message-ID: <00eb6280-fad0-66c4-b957-a4d27dffd0da@huawei.com> Date: Wed, 29 Sep 2021 16:19:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20210923074616.674826-1-irogers@google.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.26.77] X-ClientProxiedBy: lhreml714-chm.china.huawei.com (10.201.108.65) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/09/2021 08:46, Ian Rogers wrote: > For a metric like: > EVENT1 if #smt_on else EVENT2 > > currently EVENT1 and EVENT2 will be measured and then when the metric > is reported EVENT1 or EVENT2 will be printed depending on the value > from smt_on() during the expr parsing. Computing both events is > unnecessary and can lead to multiplexing as discussed in this thread: > https://lore.kernel.org/lkml/20201110100346.2527031-1-irogers@google.com/ > > This change modifies expression parsing so that constants are > considered when building the set of ids (events) and only events not > contributing to a constant value are measured. Based on some testing on my arm64 platform, no regression seen, so: Tested-by: John Garry