mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@amd.com>
To: <acme@kernel.org>, <namhyung@kernel.org>
Cc: <ravi.bangoria@amd.com>, <kan.liang@linux.intel.com>,
	<jolsa@kernel.org>, <irogers@google.com>, <peterz@infradead.org>,
	<rrichter@amd.com>, <mingo@redhat.com>, <mark.rutland@arm.com>,
	<tglx@linutronix.de>, <bp@alien8.de>, <james.clark@arm.com>,
	<leo.yan@linaro.org>, <ak@linux.intel.com>, <eranian@google.com>,
	<like.xu.linux@gmail.com>, <x86@kernel.org>,
	<linux-perf-users@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <sandipan.das@amd.com>,
	<ananth.narayan@amd.com>, <kim.phillips@amd.com>,
	<santosh.shukla@amd.com>
Subject: Re: [PATCH v5 1/8] perf record ibs: Warn about sampling period skew
Date: Fri, 3 Jun 2022 10:42:23 +0530	[thread overview]
Message-ID: <20220603051223.4272-1-ravi.bangoria@amd.com> (raw)
In-Reply-To: <CAM9d7ch2dtTjhSt9i96yr4JLEWy7EgNArRvSURE4h5gLL6=7EQ@mail.gmail.com>

>> +       if (ibs_fetch_pmu && ibs_fetch_pmu->type == evsel_pmu->type) {
>> +               if (attr->config & (1ULL << 59)) {
> 
> It'd be nice if we used a macro or something instead of the
> magic number.
> 
>> +                       ibs_l3miss_warn();
>> +                       warned_once = 1;
>> +               }
>> +       } else if (ibs_op_pmu && ibs_op_pmu->type == evsel_pmu->type) {
>> +               if (attr->config & (1ULL << 16)) {
> 
> Ditto.

Thanks for the review, Namhyung.

Arnaldo, Would you be able to squash below trivial patch into original
patch? Please let me know if you want me to respin the series instead.

---><---

From 352228ee010b0782410e233233377d9484ea51bd Mon Sep 17 00:00:00 2001
From: Ravi Bangoria <ravi.bangoria@amd.com>
Date: Fri, 3 Jun 2022 10:19:01 +0530
Subject: [PATCH] perf record ibs: Define macros for IBS L3MissOnly bits

Instead of magic numbers use macros for IBS L3MissOnly bits.

Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
---
 tools/perf/arch/x86/util/evsel.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/arch/x86/util/evsel.c b/tools/perf/arch/x86/util/evsel.c
index fceb904902ab..53763e583804 100644
--- a/tools/perf/arch/x86/util/evsel.c
+++ b/tools/perf/arch/x86/util/evsel.c
@@ -7,6 +7,9 @@
 #include "linux/string.h"
 #include "util/debug.h"
 
+#define IBS_FETCH_L3MISSONLY	(1ULL << 59)
+#define IBS_OP_L3MISSONLY	(1ULL << 16)
+
 void arch_evsel__set_sample_weight(struct evsel *evsel)
 {
 	evsel__set_sample_bit(evsel, WEIGHT_STRUCT);
@@ -98,12 +101,12 @@ void arch__post_evsel_config(struct evsel *evsel, struct perf_event_attr *attr)
 	ibs_op_pmu = perf_pmu__find("ibs_op");
 
 	if (ibs_fetch_pmu && ibs_fetch_pmu->type == evsel_pmu->type) {
-		if (attr->config & (1ULL << 59)) {
+		if (attr->config & IBS_FETCH_L3MISSONLY) {
 			ibs_l3miss_warn();
 			warned_once = 1;
 		}
 	} else if (ibs_op_pmu && ibs_op_pmu->type == evsel_pmu->type) {
-		if (attr->config & (1ULL << 16)) {
+		if (attr->config & IBS_OP_L3MISSONLY) {
 			ibs_l3miss_warn();
 			warned_once = 1;
 		}
-- 
2.31.1


  reply	other threads:[~2022-06-03  5:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01  3:26 [PATCH v5 0/8] perf/amd: Zen4 IBS extensions support (tool changes) Ravi Bangoria
2022-06-01  3:26 ` [PATCH v5 1/8] perf record ibs: Warn about sampling period skew Ravi Bangoria
2022-06-02 20:30   ` Namhyung Kim
2022-06-03  5:12     ` Ravi Bangoria [this message]
2022-06-03  5:28       ` Ravi Bangoria
2022-06-03 19:25         ` Arnaldo Carvalho de Melo
2022-06-01  3:26 ` [PATCH v5 2/8] perf tool: Parse pmu caps sysfs only once Ravi Bangoria
2022-06-01 13:35   ` Liang, Kan
2022-06-01 13:51     ` Ravi Bangoria
2022-06-01 13:55       ` Liang, Kan
2022-06-01  3:26 ` [PATCH v5 3/8] perf headers: Pass "cpu" pmu name while printing caps Ravi Bangoria
2022-06-01 13:35   ` Liang, Kan
2022-06-01  3:26 ` [PATCH v5 4/8] perf headers: Store pmu caps in an array of strings Ravi Bangoria
2022-06-01 13:36   ` Liang, Kan
2022-06-02 21:37   ` Namhyung Kim
2022-06-03  5:20     ` Ravi Bangoria
2022-06-01  3:26 ` [PATCH v5 5/8] perf headers: Record non-cpu pmu capabilities Ravi Bangoria
2022-06-01 13:37   ` Liang, Kan
2022-06-01 13:58     ` Liang, Kan
2022-06-01  3:26 ` [PATCH v5 6/8] perf/x86/ibs: Add new IBS register bits into header Ravi Bangoria
2022-06-02 21:48   ` Namhyung Kim
2022-06-03  5:24     ` Ravi Bangoria
2022-06-01  3:26 ` [PATCH v5 7/8] perf tool ibs: Sync amd ibs header file Ravi Bangoria
2022-06-01  3:26 ` [PATCH v5 8/8] perf script ibs: Support new IBS bits in raw trace dump Ravi Bangoria
2022-06-01 14:04 ` [PATCH v5 0/8] perf/amd: Zen4 IBS extensions support (tool changes) Liang, Kan
2022-06-01 14:10   ` Ravi Bangoria

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220603051223.4272-1-ravi.bangoria@amd.com \
    --to=ravi.bangoria@amd.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=ananth.narayan@amd.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=kim.phillips@amd.com \
    --cc=leo.yan@linaro.org \
    --cc=like.xu.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rrichter@amd.com \
    --cc=sandipan.das@amd.com \
    --cc=santosh.shukla@amd.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®