perf tools: Fix generation of pmu list
authorRobert Richter <robert.richter@amd.com>
Thu, 14 Jun 2012 20:38:37 +0000 (22:38 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 29 Jun 2012 16:31:27 +0000 (13:31 -0300)
commit9bc8f9fe2c6e3778202c76ef85ef291567c00cb8
tree26c483617ef9bbb10d352347df0d7fe1b80a0b20
parent287e74aa3db097469bdca401f33f00ef20dc710d
perf tools: Fix generation of pmu list

The internal pmu list was never used. With each perf_pmu__find() call
the pmu structure was created new by parsing sysfs. Beside this it
caused memory leaks. We now keep all pmus by adding them to the list.

Also, pmu_lookup() should return pmus that do not expose the format
specifier in sysfs.

We need a valid internal pmu list in a later patch to iterate over all
pmus that exist in the system.

Signed-off-by: Robert Richter <robert.richter@amd.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1339706321-8802-3-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/pmu.c