Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1279721rwd; Thu, 1 Jun 2023 13:07:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4aAWBWLSZhv/kw2G3kExosApkaRa9G2UKMge5WT6TIzEh2hfQwnJq37wmPcNJlnAiPcQdH X-Received: by 2002:a17:90a:5982:b0:255:38ed:9dcd with SMTP id l2-20020a17090a598200b0025538ed9dcdmr414264pji.0.1685650038894; Thu, 01 Jun 2023 13:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685650038; cv=none; d=google.com; s=arc-20160816; b=Qlzvwv0+9smuGNTeTo/TSQZ9wV/1KQxejOLrA1JSaSRANL+j+1/jXJqYbnNllFA2SA z8np+faaI7sEa61DrLq7+NftZofv6MEeOc8dnr9+E5zGfkU4X8ba3BtniEno6YoCy0Fr WGCNZpewma7t1Bj4wciFZo42pf/8hWkkzZOWVw/8AsPZVhqG8BxOw/OAi8zbpzKbYiJM +LNmrP2GqtuYohx7hQHjGeKQC/rgGhVrykkFOfd8ZGPAMWLRKMoFb774a9dI5rULLmoL 0yQuIZNQAIOzfFReWXYhH8hJ+6iJ7g66Qv1OCs0R2a3465pnBxzpFGCRepn4OF6QIY6H UeFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=/rynURaP+K45caE8ocJ4nnG4PZXOs1+5JcrEuL744U4=; b=uda0lxzJyCXZQ9UDplMXhkoibX90W99KBq2dK0CeTYJBkOO3VQCp/MSGLkdQsHhCSC ozT8UaO2/erMVKY2aUEpVbaALP8IzwOh0JcUtjkphz7QNzEvo0dwKkujUznpdVT/ktTx /7ztEA0W5J42gNqXg7gh6tplFEUYhz98s7sCEk5wUyCQxTOMoflJPkyef80j4fdzC7aw BHgkjSt4NNvM67iKsgGsq2Bpsro1e4lHFXw1Q8LM9vE+1r8RSQqn1yKvsI7xjZqsuPth r06OxvB/tzESnimLDZUgnLi3NIHjIo62CL2hmWNj9nUi1rZoaIsnHQOnfv4D2isXQ/sQ v4jA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j69-20020a638048000000b0052c8234a858si3392236pgd.168.2023.06.01.13.07.06; Thu, 01 Jun 2023 13:07:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbjFAUEp convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Jun 2023 16:04:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjFAUEo (ORCPT ); Thu, 1 Jun 2023 16:04:44 -0400 Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D116133; Thu, 1 Jun 2023 13:04:43 -0700 (PDT) Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-ba8cd61ee2dso3866019276.1; Thu, 01 Jun 2023 13:04:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685649882; x=1688241882; h=content-transfer-encoding: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=FguUd56ef6WXjLNVVs6lDvHHxF9RVKCHVqjpWMTKE2A=; b=EZaICIueclHV0AI0ZDPo73aQJ5qM+53q4VtvMby9s6W1dbFZCtXQHG/XBchBrZAReQ BpyBq1H7yxNIe7xlVFaDo8+MH+WfvJigLu5pPP3Ju6cQbxSx18qiyc6zuPI5LTLOSZIZ t3dNWxG3BwG3UVRcc/h6NSDMPb+n6Rd7yYmZ4jTHeR9n9S7O+0s8zkJmLqqBEZPuKh2T CHmT8FnpmkTs4dfGC8EiVjthiY6LhHmAr2rIBRSr+u4Zp+g7fMm2xuJS+lpHpogWsKCm tmjGwoVFrNwwT9M/4hyazDmJtEj8RDtaUpJfkpvuafJm+rWFsVGWI78RiLC8Tp4hsxk7 D68g== X-Gm-Message-State: AC+VfDy60aYdv49z2EARBa9hHg0z7w43PX58BAVqTauCWg+YPDx676Pl a6TPoF0Z7Kpd37jjFEjtf+dbH4o726dO5m5RZsI= X-Received: by 2002:a25:69c5:0:b0:b8f:3990:636d with SMTP id e188-20020a2569c5000000b00b8f3990636dmr1144526ybc.23.1685649882238; Thu, 01 Jun 2023 13:04:42 -0700 (PDT) MIME-Version: 1.0 References: <20230601023644.587584-1-irogers@google.com> In-Reply-To: <20230601023644.587584-1-irogers@google.com> From: Namhyung Kim Date: Thu, 1 Jun 2023 13:04:30 -0700 Message-ID: Subject: Re: [PATCH v1 1/2] perf pmu: Only warn about unsupported configs once To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , Rob Herring , Zhengjun Xing , James Clark , Suzuki Poulouse , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 31, 2023 at 7:36 PM Ian Rogers wrote: > > Avoid scanning format list for each event parsed. Maybe it's better to change the subject that it's about format.. Other than that, Acked-by: Namhyung Kim Thanks, Namhyung > > Signed-off-by: Ian Rogers > --- > tools/perf/util/pmu.c | 5 +++++ > tools/perf/util/pmu.h | 5 +++++ > 2 files changed, 10 insertions(+) > > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > index 0520aa9fe991..204ce3f02e63 100644 > --- a/tools/perf/util/pmu.c > +++ b/tools/perf/util/pmu.c > @@ -934,6 +934,11 @@ void perf_pmu__warn_invalid_formats(struct perf_pmu *pmu) > { > struct perf_pmu_format *format; > > + if (pmu->formats_checked) > + return; > + > + pmu->formats_checked = true; > + > /* fake pmu doesn't have format list */ > if (pmu == &perf_pmu__fake) > return; > diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h > index 287f593b15c7..7a1535dc1f12 100644 > --- a/tools/perf/util/pmu.h > +++ b/tools/perf/util/pmu.h > @@ -76,6 +76,11 @@ struct perf_pmu { > * specific code. > */ > bool auxtrace; > + /** > + * @formats_checked: Only check PMU's formats are valid for > + * perf_event_attr once. > + */ > + bool formats_checked; > /** > * @max_precise: Number of levels of :ppp precision supported by the > * PMU, read from > -- > 2.41.0.rc0.172.g3f132b7071-goog >