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]
Date:   Tue, 5 Mar 2019 17:28:54 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andi Kleen <ak@...ux.intel.com>
Cc:     Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>,
        Nageswara R Sastry <nasastry@...ibm.com>,
        Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Subject: Re: [PATCH 5/8] perf tools: Get precise_ip from the pmu config

On Tue, Mar 05, 2019 at 08:13:19AM -0800, Andi Kleen wrote:
> On Tue, Mar 05, 2019 at 04:25:33PM +0100, Jiri Olsa wrote:
> > Getting precise_ip field from the perf_pmu::max_precise
> > config read from sysfs. If it's not available falling
> > back to current detection function.
> 
> max_precise depends on the event.  This won't work for all
> events. For example only instructions and cycles support
> ppp

I'm getting  precise_ip=3 on mem-* events as well, that's why I
was fixing this.. now it's not working for any event

> 
> The previous method handled it by event.

how about we use empty template with just type/config
of the original event, like in the change below,
that way we eliminate unsupported features failing
the probing.. maybe we could use oldest attr version

also if precise_ip is event based, we shouldn't use the
caps/max_precise then

jirka


---
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index ed20f4379956..cee2f83feb89 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -233,8 +233,8 @@ void perf_evlist__set_leader(struct perf_evlist *evlist)
 void perf_event_attr__set_max_precise_ip(struct perf_event_attr *pattr)
 {
 	struct perf_event_attr attr = {
-		.type		= PERF_TYPE_HARDWARE,
-		.config		= PERF_COUNT_HW_CPU_CYCLES,
+		.type		= pattr->type,
+		.config		= pattr->config,
 		.exclude_kernel	= 1,
 		.precise_ip	= 3,
 	};

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ