Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2261400pxb; Mon, 20 Sep 2021 16:59:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymgoIqeqEvDs3i/fIpwxGBkWNM/maGw6iG6G9dKNIjbkZfFkUX+fEBN0DYHrYK6EgVg6ds X-Received: by 2002:a50:9dcf:: with SMTP id l15mr19334962edk.128.1632182370331; Mon, 20 Sep 2021 16:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632182370; cv=none; d=google.com; s=arc-20160816; b=Sgar/H28kC0PhZlgKihSaL02cnGRg9m4q/DpgRBTEQLuGs9+mzB2rXghVjYOH3yKXr 1hXAZnZFswORn9LDMfHae3zzobQUX6Yi/MXlg86f093evbmMKlvi1HAyA7e3eqTlf6IQ heBNKc1TZEWqHQTYtSN5AuZpNEDPohGRb0XB0gsRIcNbMuLw2zYuqa43XSovwfxK9FqU AA7C0MN9RR131IeBDq7E365iRKugpr/CgEX1YAbRUOf2x2jnh++FdBrx0i2EopBU5NlK 4h17oV7aYHGekjwhRWYdUBW3QQwYkwOg9shD5mKtR5HpMWeoUNsnslyIbOSqg1sY/szT hR6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=/Akon72OSy6tadMFa1+VD9SvNtjKWfw/mtIBJM0HW8M=; b=OfHZD+5XAz74iON8t9le9ttOKEmYQZW7BNExMHRpafckXqXjqr5K5weH3YzYv7aGeD Gt3xbUzLnUH8k6zt9mV3wMqRurhWEwia9gOlOWZeyfjWwYLljy6u/pBJGr81U2l+E5CH 3ItIf4by9gQt4zDSW1hAvft3ZNfhpPAFK1DV6f21tf+H2R8Kr1B9sUPwgzorlWVgOykx TMlK9trj5uNla8XDjc8KxdRr+xH3ochmTXNtU/CjWM+6VKm1X1Br69kZtfmcrrjhHTnt pMFibHZuLG6G408oiPUh2hXSh26s04n9uS3GD46uSlNlbHlUh7S9W5KbgHgiiRFDYTiI l/KQ== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jx16si17467085ejc.537.2021.09.20.16.59.04; Mon, 20 Sep 2021 16:59:30 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239748AbhITNro (ORCPT + 99 others); Mon, 20 Sep 2021 09:47:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:45174 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236385AbhITNrn (ORCPT ); Mon, 20 Sep 2021 09:47:43 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10112"; a="223166976" X-IronPort-AV: E=Sophos;i="5.85,308,1624345200"; d="scan'208";a="223166976" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2021 06:46:16 -0700 X-IronPort-AV: E=Sophos;i="5.85,308,1624345200"; d="scan'208";a="701062486" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.252.131.200]) ([10.252.131.200]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2021 06:46:15 -0700 Subject: Re: [PATCH v8 0/8] 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 , linux-kernel@vger.kernel.org, Jin Yao , John Garry , Paul Clarke , kajoljain , linux-perf-users@vger.kernel.org Cc: Stephane Eranian , Sandeep Dasgupta References: <20210918063513.2356923-1-irogers@google.com> From: Andi Kleen Message-ID: <7307f6f3-74a8-ef3e-428b-fc294454e463@linux.intel.com> Date: Mon, 20 Sep 2021 06:46:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210918063513.2356923-1-irogers@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/17/2021 11:35 PM, 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. The series looks good to me. Reviewed-by: Andi Kleen -Andi