Browse Source

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@redhat.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/1465223766-29902-1-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Andi Kleen 9 years ago
parent
commit
17a2634bcb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tools/perf/tests/parse-events.c

+ 2 - 2
tools/perf/tests/parse-events.c

@@ -1783,8 +1783,8 @@ static int test_pmu_events(void)
 		struct evlist_test e;
 		struct evlist_test e;
 		char name[MAX_NAME];
 		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;
 			continue;
 
 
 		snprintf(name, MAX_NAME, "cpu/event=%s/u", ent->d_name);
 		snprintf(name, MAX_NAME, "cpu/event=%s/u", ent->d_name);