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] [day] [month] [year] [list]
Message-ID: <tip-17a2634bcb88e52bd637fdaa47d7ff0bddb0188f@git.kernel.org>
Date:	Wed, 8 Jun 2016 01:38:25 -0700
From:	tip-bot for Andi Kleen <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	hpa@...or.com, linux-kernel@...r.kernel.org, ak@...ux.intel.com,
	acme@...hat.com, tglx@...utronix.de, mingo@...nel.org,
	jolsa@...nel.org
Subject: [tip:perf/core] perf test: Ignore .scale and other special files

Commit-ID:  17a2634bcb88e52bd637fdaa47d7ff0bddb0188f
Gitweb:     http://git.kernel.org/tip/17a2634bcb88e52bd637fdaa47d7ff0bddb0188f
Author:     Andi Kleen <ak@...ux.intel.com>
AuthorDate: Mon, 6 Jun 2016 07:36:06 -0700
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 6 Jun 2016 12:11:14 -0300

perf test: Ignore .scale and other special files

'perf test' tries to parse all entries in /sys/devices/cpu/events/.
Ignore the special entries like '.scale', which cannot be directly
parsed as an event. This patch assumes all files containing a '.' are
special and can be ignored.

Reported-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Link: http://lkml.kernel.org/r/1465223766-29902-1-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/tests/parse-events.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 7865f68..b2a2c74 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1783,8 +1783,8 @@ static int test_pmu_events(void)
 		struct evlist_test e;
 		char name[MAX_NAME];
 
-		if (!strcmp(ent->d_name, ".") ||
-		    !strcmp(ent->d_name, ".."))
+		/* Names containing . are special and cannot be used directly */
+		if (strchr(ent->d_name, '.'))
 			continue;
 
 		snprintf(name, MAX_NAME, "cpu/event=%s/u", ent->d_name);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ