Message ID | 20230524221831.1741381-28-irogers@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86DA0C7EE23 for <linux-arm-kernel@archiver.kernel.org>; Wed, 24 May 2023 22:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eCL82dDnNdsyoR/pnTM4JO4/DA7WHokvVPCnMVvXprI=; b=dThhtAbDU33gEk uIpVDR/FXi4MYkEHln6LDUPvRXLuBSGkVtmTOoqTD60moOxAw7Lyy5e+E+lsPruxdg/k/wMiRzvLQ Tr7svj7lXb+NIR2H2fpkyPz3H74IejRuYiF0NU55/y9+ouEhpAZjtzTn2OhrlIBcYc0AWqv3PkLzC f5UsRxlykpDCwcvYLA6BqEc3g02AyZR58o8+ncYqMeIwgi3+B1esGpDF1/nPl7xeEiXaDp1PBxx0g 0wpL76wWKqh423wOKRw1+wLnfLTFSQw5sTUinIbhktaIXKDPxrzPE9H3mehSZTTiOZ8YiL9Qvw5N0 4zOX6NXzN116Xh+P9Q4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1xAg-00Epbe-0L; Wed, 24 May 2023 22:41:30 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1xAX-00EpVB-2Q for linux-arm-kernel@bombadil.infradead.org; Wed, 24 May 2023 22:41:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=d/uSoOkKrLV2P01KOT7/05nAwNtg1NZmOZIVSrGqD1k=; b=eOqGlgAcJz6s/sOWS8Mt687mnc iRjjqVxUlyO9IKsAemG9sk47FpwAAo7rTqz4VRrkL09OrYrR06JnhXHzrNuDHp48jhYB1IkccRfmR a0k/r+w+cpT3S6YZbGm89ijN9RElnHGV5IazlMQdZA7lmL7cwL9TFwrnJgmvr3BFE90zloVguthEV 7dWsi9E6KsVcREEXLE/U3GA0EIAkJNA8sB/2c85tjuesGYNuSFZlikmw98DdXJNoGaQ0W9SEbNToE q2AwYAG8DPIGZ30NkCE84f3vJAKAua91+Ko/9fsCDwWJ5woFnUSH+ArE3FXh6Rmt2piXC7YCGgLsE NjRF7EUw==; Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1wpX-0056cF-2j for linux-arm-kernel@lists.infradead.org; Wed, 24 May 2023 22:20:13 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-56552a72cfbso29697457b3.3 for <linux-arm-kernel@lists.infradead.org>; Wed, 24 May 2023 15:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684966777; x=1687558777; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=d/uSoOkKrLV2P01KOT7/05nAwNtg1NZmOZIVSrGqD1k=; b=AnKvdlUdQjQEEAq6HeZq7zmB6gXv01G0cNNgNxVh13Iy+L8MK0uM/sSyX8zOpVJzzj LtvtAjrsF6ZUkNcumXtEBBqhAtaTXivZg5uh9HUG3ggoCvT1KBDP5u6fGhM2uPhybH+0 IRPtuFglOvFjuOWq6/CbvzlITCjdA4TyXBPz19kXSoq7VcI4CYMwdBQxFdBnjnbjoL6P LxSPLWqi5o7mHIUqLRxbYbRi/kTwfvbWyjhyeaTnIYhge/LAYfV6+KLEKMuPY3zpQM0A 43v2qjCsMWYwXQDEQ08GdcQRHh9y9JvpJizhR5eGNt/mVktDaKoGL7OMDri5nQHfF3mJ WXgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684966777; x=1687558777; h=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=d/uSoOkKrLV2P01KOT7/05nAwNtg1NZmOZIVSrGqD1k=; b=klnP2SVGpyNFzQtixE+6S1MuvtXoaxU9jQ/ScugwvXF4MK57O5Ae8jnJ9LRCek5PZn LhFonnxo8yfdLWlHW8XGR5IZFE0ornIzFLW2/CJfpjbL82kQYvaD6r9V0GZAeZy7vJSb uzykRn2bGJDtfkHVtTVPNuvBIR/qEgHX/M1qh3eylzjR/3wi3LV58xD6RtEkY4RSqF4b LKtS/NvMZBSs0wa3UQKCeywr5+72hRgbagkgl8l8uUPJdPNo3zVxHbP9xtn7beEWHPtU hOuDTIr5YPEVWKN7hiPk5eS2wyCPdfPIzvTZ05ilLxMCFizWPFh4x6uaxfupKfbKSvBi psow== X-Gm-Message-State: AC+VfDzFUibW+JBELZgTdguad7mh2VAam90tRntK85sXpjaZSewH/5T5 qUu6jfnXdg/171TN9IbM1lWqLOIwSVoT X-Google-Smtp-Source: ACHHUZ7sEtK0LR8WwQQK9cpyIqNh6Pc7ybEP8C6sxaWdG4+eXpOeGFVug3xou45ngKes3xW1FpxdzJYoO/4m X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:7aa7:3d2d:76ae:8e96]) (user=irogers job=sendgmr) by 2002:a81:441b:0:b0:55d:9484:f153 with SMTP id r27-20020a81441b000000b0055d9484f153mr11963093ywa.7.1684966777192; Wed, 24 May 2023 15:19:37 -0700 (PDT) Date: Wed, 24 May 2023 15:18:23 -0700 In-Reply-To: <20230524221831.1741381-1-irogers@google.com> Message-Id: <20230524221831.1741381-28-irogers@google.com> Mime-Version: 1.0 References: <20230524221831.1741381-1-irogers@google.com> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog Subject: [PATCH v3 27/35] perf x86 mem: minor refactor to is_mem_loads_aux_event From: Ian Rogers <irogers@google.com> To: Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, John Garry <john.g.garry@oracle.com>, Will Deacon <will@kernel.org>, James Clark <james.clark@arm.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Kajol Jain <kjain@linux.ibm.com>, Jing Zhang <renyu.zj@linux.alibaba.com>, Kan Liang <kan.liang@linux.intel.com>, Zhengjun Xing <zhengjun.xing@linux.intel.com>, Ravi Bangoria <ravi.bangoria@amd.com>, Madhavan Srinivasan <maddy@linux.ibm.com>, Athira Rajeev <atrajeev@linux.vnet.ibm.com>, Ming Wang <wangming01@loongson.cn>, Huacai Chen <chenhuacai@kernel.org>, Sandipan Das <sandipan.das@amd.com>, Dmitrii Dolgov <9erthalion6@gmail.com>, Sean Christopherson <seanjc@google.com>, Ali Saidi <alisaidi@amazon.com>, Rob Herring <robh@kernel.org>, Thomas Richter <tmricht@linux.ibm.com>, Kang Minchul <tegongkang@gmail.com>, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230524_232011_615130_CD6C6E56 X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
PMU refactoring and improvements
|
expand
|
diff --git a/tools/perf/arch/x86/util/mem-events.c b/tools/perf/arch/x86/util/mem-events.c index f683ac702247..02d65e446f46 100644 --- a/tools/perf/arch/x86/util/mem-events.c +++ b/tools/perf/arch/x86/util/mem-events.c @@ -55,13 +55,13 @@ struct perf_mem_event *perf_mem_events__ptr(int i) bool is_mem_loads_aux_event(struct evsel *leader) { - if (perf_pmu__find("cpu")) { - if (!pmu_have_event("cpu", "mem-loads-aux")) - return false; - } else if (perf_pmu__find("cpu_core")) { - if (!pmu_have_event("cpu_core", "mem-loads-aux")) - return false; - } + struct perf_pmu *pmu = perf_pmu__find("cpu"); + + if (!pmu) + pmu = perf_pmu__find("cpu_core"); + + if (pmu && !pmu_have_event(pmu->name, "mem-loads-aux")) + return false; return leader->core.attr.config == MEM_LOADS_AUX; }