summaryrefslogtreecommitdiff
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-06-26 08:38:11 (GMT)
committerIngo Molnar <mingo@kernel.org>2015-06-26 08:38:11 (GMT)
commit6eedf416429a32e0216f61b8b690d25577b2b91e (patch)
treecdd0474142283a269c2e05e31128d382418fab28 /tools/perf/util/parse-events.c
parentdf0d0da426d03fb7e6567feb38a48b1e0dd1891e (diff)
parenta22e99cd74a31dee4b5241bd60a256c629c808da (diff)
downloadlinux-6eedf416429a32e0216f61b8b690d25577b2b91e.tar.xz
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core improvements and refactorings from Arnaldo Carvalho de Melo: Infrastructure changes: - Reference count the cpu_map and thread_map classes. (Jiri Olsa) - Set evsel->{cpus,threads} from the evlist, if not set, allowing the generalization of some 'perf stat' functions that previously were accessing private static evlist variable. (Jiri Olsa) - Delete an unnecessary check before the calling free_event_desc() (Markus Elfring) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r--tools/perf/util/parse-events.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 2a4d1ec..09f8d23 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -17,6 +17,7 @@
#include "parse-events-flex.h"
#include "pmu.h"
#include "thread_map.h"
+#include "cpumap.h"
#include "asm/bug.h"
#define MAX_NAME_LEN 100
@@ -285,7 +286,9 @@ __add_event(struct list_head *list, int *idx,
if (!evsel)
return NULL;
- evsel->cpus = cpus;
+ if (cpus)
+ evsel->cpus = cpu_map__get(cpus);
+
if (name)
evsel->name = strdup(name);
list_add_tail(&evsel->node, list);