Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andi Kleen and committed by
Arnaldo Carvalho de Melo
17a2634b 40f20e50

+2 -2
+2 -2
tools/perf/tests/parse-events.c
··· 1783 1783 struct evlist_test e; 1784 1784 char name[MAX_NAME]; 1785 1785 1786 - if (!strcmp(ent->d_name, ".") || 1787 - !strcmp(ent->d_name, "..")) 1786 + /* Names containing . are special and cannot be used directly */ 1787 + if (strchr(ent->d_name, '.')) 1788 1788 continue; 1789 1789 1790 1790 snprintf(name, MAX_NAME, "cpu/event=%s/u", ent->d_name);