Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp765602pxb; Wed, 29 Sep 2021 09:13:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzET95QxmvQG4GG5jIi5xYu7QhkMbeFn4GlMK2hA7J9xaQ94X071ocjmrjUXUq6Vu+ccvK X-Received: by 2002:a17:90a:dc81:: with SMTP id j1mr765115pjv.155.1632932023474; Wed, 29 Sep 2021 09:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632932023; cv=none; d=google.com; s=arc-20160816; b=iVfSWT+R/eewk6lPXNj65uyp4dBVjHlSKwrCpUShrR7prftVieXuDz02mZDhiHZS8c 9fj2S5I0tgi8CCmmck4QJ5N6OnL27G1CAblpUkzIKD4cG8wsGxKGjhHtX/Ko2/sVlLzN DH/R3Lm6Ht+aax6+Nop2POfcfnJlxrv9jS7r3ojrIOVYFi/FHm/P7l/tLDrCI68OPvvu Iub1BAVJhYDLjhXxVgZggv3Bf0xoE5s05VeHG3hBTwnRKGRtz9lxQYETpSHQZRk9n5tw wdY3QaZFJhy3EA9XM6AotFy4Ghr3yVPO1lt+/4Ly/27copn8KZ4AMtHZWbsBJLmDPOLb a7Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ACUKWINJ+b06A5Dd/rYTKUJ9Y6q0KbWlxJSrgmw5wHA=; b=ChZuiQrpNzpIJ+2h3u9OyzU+y9hSliNjlIX7YyaF0Lc6mmNcE4QoEAxlmep09Ne3KK t0TvDJn4QRnD3xisGOmNa3xG594OPLI3JNqWpplQ4BwBhEJSC3rrPf3JjjC7Gy7p1Ibs 7bBtKA3qyvb9HxnWkTSfjpVNZpHMRsbJHsr5r/koF29d5G9sCrwsrc2V4REnNNh/cGna AUeyyMgtvz1gAJbtV0anS8hnagSurnlxfUNfpliOc9ynqfLRYnHhiDF1Iw4GljncS++t 6l1fdhseal0JEzCqR1ZjwVWlgwOzzi6GKezo55xHDekuASEZGkzxmILKaNHa3GhCJjX5 WnhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="MOc/3VdQ"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si2213347pjs.65.2021.09.29.09.13.29; Wed, 29 Sep 2021 09:13:43 -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; dkim=pass header.i=@google.com header.s=20210112 header.b="MOc/3VdQ"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345666AbhI2QMj (ORCPT + 99 others); Wed, 29 Sep 2021 12:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345723AbhI2QMd (ORCPT ); Wed, 29 Sep 2021 12:12:33 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EB33C0617A9 for ; Wed, 29 Sep 2021 09:09:39 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id q205so3799763iod.8 for ; Wed, 29 Sep 2021 09:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ACUKWINJ+b06A5Dd/rYTKUJ9Y6q0KbWlxJSrgmw5wHA=; b=MOc/3VdQCP9UfKju2Uqc1gSeyJTWl8zXipu0hevSto3yALhXsOmo+pY1Hb2lYDPKDp qc832qgrr8pNocPHOPEDOQAG+MSlbU/YHGvL7N0/vq6KM8nbs+lcJyP8vvDCg8vG/5YP lA8Gd2GAa3dgO1+Ved/3ni8ZSXdSYQWkfx7I+QkBF1s1SoOJFxgT1fGkb6RIZJEi47uJ C3gGTMH/fZAqgE+P8iJ72fjZIDvozOXpAuH/bXEJdK9jKQNXjKSfPa3tUgNQ4EBTC6BS jWj+ogFJoD2S2uN/1D6BiAqR4Dpit1IPt48nBqrGUC3XEivutYWFWaMSRhemhz54VRle 5Nzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ACUKWINJ+b06A5Dd/rYTKUJ9Y6q0KbWlxJSrgmw5wHA=; b=aI+TFljL3pWIfl0JMbCJdxkF/M1YvVtKpmdWxgF46A0hgFd11IOMeTt4V0VzJmBZlC DbDOLqJ/7V8m/D65Ygi8yt+SQn8vCPbQyl54L67glyKa+4NpuzJoO31zH8Wk8AVryDH+ 0j0XAGCacLeFO1G4vkk808Qm6DnnRjGSDnmrCyYpbdoXOsvUCv/gIpgV5nWGCLrAFIWu SOULJJ/ztIKyZrsDKwMSZcjbUfwkAJ06daMFQnUUxO2yN4AK35POAw3IAY12tcasjTie E7ohnvJmpF5UmrkmNBswmhcQt1j2afbPV7kIFCE9O28ua+jm2kNnaKtyvSJ17/7moM2x 579A== X-Gm-Message-State: AOAM533rQen+6+JILru/o3hjPrnsqldLztzRIhrC/wFrx9HeZ+8QKok1 Z59IrgxZ4dIuxc0KPfeE8V76B46PEMcIhu9e3zQM1Q== X-Received: by 2002:a5d:9d8e:: with SMTP id ay14mr439562iob.32.1632931778709; Wed, 29 Sep 2021 09:09:38 -0700 (PDT) MIME-Version: 1.0 References: <20210923074616.674826-1-irogers@google.com> <00eb6280-fad0-66c4-b957-a4d27dffd0da@huawei.com> In-Reply-To: <00eb6280-fad0-66c4-b957-a4d27dffd0da@huawei.com> From: Ian Rogers Date: Wed, 29 Sep 2021 09:09:24 -0700 Message-ID: Subject: Re: [PATCH v9 00/13] Don't compute events that won't be used in a metric. To: John Garry Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org, Andi Kleen , Jin Yao , Paul Clarke , kajoljain , linux-perf-users@vger.kernel.org, Stephane Eranian , Sandeep Dasgupta Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2021 at 8:16 AM John Garry wrote: > > 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 Awesome, much thanks Jiri, John, Andi for the reviews and testing! Ian