From patchwork Sun Mar 12 02:15:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 68242 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp538060wrd; Sat, 11 Mar 2023 18:17:54 -0800 (PST) X-Google-Smtp-Source: AK7set8VPfEx+dPT+hT/iBinzVRkHY4jT1QANGbZN8qSrE3mnIqMcbyaTZz4Anobuguiw9+Suw2Z X-Received: by 2002:a17:902:ab8e:b0:19d:1a9c:34dd with SMTP id f14-20020a170902ab8e00b0019d1a9c34ddmr23472809plr.17.1678587473947; Sat, 11 Mar 2023 18:17:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678587473; cv=none; d=google.com; s=arc-20160816; b=O1ztLp/nZ2sqyYHga6qsTEmklzcoUeNWhNWJOnrIR4/6LWEojQIhB1vmvRPQ910Xi9 0iYyBGbmP4KLkMs6zj2Z3UpEaLfth/G1+WK2F5hKSCl2GBWucEZtsrCX8HrgIWzUB8ns kUzZtWg7Nc9FZvTCYDUGucJnqlPbPBMGYzmF09EqYcaCbh0Q1mEDJbEygn4xCccGmfRM IuoHdY785pF11tVXqssg7FK9swcPihW6nJJzWsdDmz7VEtoM0Nj1n6E7hi6gOS/vCX7T igj5rghHxekHVALLPXwzolOLOKOQEeSHwVSKCaoRWfxLpH0frw/c3xGlv6gfIYnYag9o QE2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=BT/x/3Eyz2BuEqpSdLzkRqcNHW14bzsOIxfh6FRlfxo=; b=KnCEgSDOiO0qDzWSCado514IKEB+wyFBD9KLs+SfTlX/m7/io6c6BbHLVgqsLeJMgr 3P9gnYHxX4Rm346E4Gw6QAL/XGgrYhSXYr/s6VaqoblsDlN3ZR9jPspbgDEY/wYMnn26 t0CwBQOg3tv9thMiKRGfEvA2WDdXD1Q6RAD0qT06wqraB+mH0TC0Yrx8E0stg7pdqIZf NCcb78LlnOVFPC/iXxZtSzojFmpj3fLgNt4Nr7B5cjhpPv86N/aIbvJ0YK7o8QkdGCju 6guw8LFHa161NE+4dDRdZ3C8/hKWZ6yPgz/ntv9aCBfTk8V2/OMFiPGKX2+YvDDg37od P15Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=lHkf3zlh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x37-20020a631725000000b004cc67cfc92bsi3266430pgl.97.2023.03.11.18.17.39; Sat, 11 Mar 2023 18:17:53 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20210112 header.b=lHkf3zlh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbjCLCQf (ORCPT + 99 others); Sat, 11 Mar 2023 21:16:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjCLCQe (ORCPT ); Sat, 11 Mar 2023 21:16:34 -0500 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0FB546143 for ; Sat, 11 Mar 2023 18:16:18 -0800 (PST) Received: by mail-pf1-x44a.google.com with SMTP id y35-20020a056a00182300b005e8e2c6afe2so4890315pfa.12 for ; Sat, 11 Mar 2023 18:16:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1678587378; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=BT/x/3Eyz2BuEqpSdLzkRqcNHW14bzsOIxfh6FRlfxo=; b=lHkf3zlh1pVGSdM1GC3AxnylNDGWw4m4GJlJE4wRPSdCCUFN3He51cJPy0m5AyZ/zv /SzbVozvJfQqUfitexmgUsgWBFu/tkgmcX9cwlr0C6zKLYgTD7CUdX/9kFuEu8xRfD6R VJ6Jh2D0oe3Fhe67mGw5s3OOOHYfh8AsbdG0Y0kRrclYNzMovnQVtBqNXwD2Iv3gKZrY btWan+zTRIHcpSja+4FLQ3WkvJUYnWBExNjhJMbU5/XAOyZySYxySxWh0uVHd2Yut+VL 6VvsruF/H1OzxW6rUp15I4kVz8EWLI9P6ijhJqbYhapqB4RPKk89sA8NKJOlPW3vPnqx HSaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678587378; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BT/x/3Eyz2BuEqpSdLzkRqcNHW14bzsOIxfh6FRlfxo=; b=ce9RkvA2K4/nQ6rSN0JViz69vPdJOXW9fLBoKf78/cX6D47Gk0LWxwG8Oho8lsBHcF BEeUJZaQIOoKK/7jmOhYviFOEnpRZ+kwo1ZmxlsCt2z7UCujf9aurEsuqUxS6cVI+SKA qThZv6D2i3grbDDc+W7qJYomLFOruFNWsQAsL45QpXZG7gwNb0d3sfFNLaCv/HoOoqZt bTsU43Z1Fa8pgCW/rgyFJCLAa35IvgK2xVjg0FReIcdfASROGGIGxy278oarIGihd8ba i679BMR1koDu2B4CiCrbBJBXjma0NVhVvwirmNQoTqTNE/gBASZPBYTaIRtunPNyJSZq ZuCA== X-Gm-Message-State: AO0yUKVx5hID8rwNJGEJSP7mZl/5fC4rXQSbvku0xw04eyyqnRI876iS MR8UfhU5AXFAS2a6MmqNAdDjkkusP80r X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:b42b:2e07:afb:877e]) (user=irogers job=sendgmr) by 2002:a17:90b:46cf:b0:23b:517d:beca with SMTP id jx15-20020a17090b46cf00b0023b517dbecamr315230pjb.0.1678587378274; Sat, 11 Mar 2023 18:16:18 -0800 (PST) Date: Sat, 11 Mar 2023 18:15:35 -0800 In-Reply-To: <20230312021543.3060328-1-irogers@google.com> Message-Id: <20230312021543.3060328-4-irogers@google.com> Mime-Version: 1.0 References: <20230312021543.3060328-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Subject: [PATCH v5 03/11] perf pmu: Earlier PMU auxtrace initialization From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Mark Rutland , Adrian Hunter , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kan Liang , Zhengjun Xing , Ravi Bangoria , "Steinar H. Gunderson" , Kim Phillips , Florian Fischer , James Clark , Suzuki Poulouse , Sean Christopherson , Leo Yan , John Garry , Kajol Jain , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760126539435062569?= X-GMAIL-MSGID: =?utf-8?q?1760126539435062569?= This allows event parsing to use the evsel__is_aux_event function, which is important when determining event grouping. Suggested-by: Adrian Hunter Acked-by: Adrian Hunter Signed-off-by: Ian Rogers --- tools/perf/arch/x86/util/auxtrace.c | 4 ---- tools/perf/arch/x86/util/pmu.c | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/arch/x86/util/auxtrace.c b/tools/perf/arch/x86/util/auxtrace.c index 3da506e13f49..330d03216b0e 100644 --- a/tools/perf/arch/x86/util/auxtrace.c +++ b/tools/perf/arch/x86/util/auxtrace.c @@ -26,11 +26,7 @@ struct auxtrace_record *auxtrace_record__init_intel(struct evlist *evlist, bool found_bts = false; intel_pt_pmu = perf_pmu__find(INTEL_PT_PMU_NAME); - if (intel_pt_pmu) - intel_pt_pmu->auxtrace = true; intel_bts_pmu = perf_pmu__find(INTEL_BTS_PMU_NAME); - if (intel_bts_pmu) - intel_bts_pmu->auxtrace = true; evlist__for_each_entry(evlist, evsel) { if (intel_pt_pmu && evsel->core.attr.type == intel_pt_pmu->type) diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c index 358340b34243..f73b80dcd8bd 100644 --- a/tools/perf/arch/x86/util/pmu.c +++ b/tools/perf/arch/x86/util/pmu.c @@ -27,10 +27,14 @@ static bool cached_list; struct perf_event_attr *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused) { #ifdef HAVE_AUXTRACE_SUPPORT - if (!strcmp(pmu->name, INTEL_PT_PMU_NAME)) + if (!strcmp(pmu->name, INTEL_PT_PMU_NAME)) { + pmu->auxtrace = true; return intel_pt_pmu_default_config(pmu); - if (!strcmp(pmu->name, INTEL_BTS_PMU_NAME)) + } + if (!strcmp(pmu->name, INTEL_BTS_PMU_NAME)) { + pmu->auxtrace = true; pmu->selectable = true; + } #endif return NULL; }