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: <20191127232657.GL84886@tassilo.jf.intel.com>
Date:   Wed, 27 Nov 2019 15:26:57 -0800
From:   Andi Kleen <ak@...ux.intel.com>
To:     Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
Cc:     Andi Kleen <andi@...stfloor.org>, jolsa@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: Optimize perf stat for large number of events/cpus

On Wed, Nov 27, 2019 at 12:43:05PM -0300, Arnaldo Carvalho de Melo wrote:
> So, have you tried running 'perf test' after each cset is applied and
> built?

I ran it at the end, but there are quite a few fails out of the box,
so I missed that one thanks.

This patch fixes it. Let me know if I should submit it in a more
formal way.

---

Fix event times test case

Reported-by: Arnaldo
Signed-off-by: Andi Kleen <ak@...ux.intel.com>

diff --git a/tools/perf/lib/evsel.c b/tools/perf/lib/evsel.c
index 4c6485fc31b9..4dc06289f4c7 100644
--- a/tools/perf/lib/evsel.c
+++ b/tools/perf/lib/evsel.c
@@ -224,7 +224,7 @@ int perf_evsel__enable(struct perf_evsel *evsel)
 	int i;
 	int err = 0;
 
-	for (i = 0; i < evsel->cpus->nr && !err; i++)
+	for (i = 0; i < xyarray__max_x(evsel->fd) && !err; i++)
 		err = perf_evsel__run_ioctl(evsel, PERF_EVENT_IOC_ENABLE, NULL, i);
 	return err;
 }
@@ -239,7 +239,7 @@ int perf_evsel__disable(struct perf_evsel *evsel)
 	int i;
 	int err = 0;
 
-	for (i = 0; i < evsel->cpus->nr && !err; i++)
+	for (i = 0; i < xyarray__max_x(evsel->fd) && !err; i++)
 		err = perf_evsel__run_ioctl(evsel, PERF_EVENT_IOC_DISABLE, NULL, i);
 	return err;
 }
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 59b9b4f3fe34..0844e3e29fb0 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -1853,6 +1853,10 @@ int perf_evsel__open_per_cpu(struct evsel *evsel,
 			     struct perf_cpu_map *cpus,
 			     int cpu)
 {
+	if (cpu == -1)
+		return evsel__open_cpu(evsel, cpus, NULL, 0,
+					cpus ? cpus->nr : 1);
+
 	return evsel__open_cpu(evsel, cpus, NULL, cpu, cpu + 1);
 }
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ