lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220603051223.4272-1-ravi.bangoria@amd.com>
Date:   Fri, 3 Jun 2022 10:42:23 +0530
From:   Ravi Bangoria <ravi.bangoria@....com>
To:     <acme@...nel.org>, <namhyung@...nel.org>
CC:     <ravi.bangoria@....com>, <kan.liang@...ux.intel.com>,
        <jolsa@...nel.org>, <irogers@...gle.com>, <peterz@...radead.org>,
        <rrichter@....com>, <mingo@...hat.com>, <mark.rutland@....com>,
        <tglx@...utronix.de>, <bp@...en8.de>, <james.clark@....com>,
        <leo.yan@...aro.org>, <ak@...ux.intel.com>, <eranian@...gle.com>,
        <like.xu.linux@...il.com>, <x86@...nel.org>,
        <linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <sandipan.das@....com>, <ananth.narayan@....com>,
        <kim.phillips@....com>, <santosh.shukla@....com>
Subject: Re: [PATCH v5 1/8] perf record ibs: Warn about sampling period skew

>> +       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@....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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ