diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-12-06 09:42:35 +0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-12-06 09:43:49 +0400 |
commit | d6c1c49de577fa292af2449817364b7d89b574d8 (patch) | |
tree | e97cf88a318f50eb23c18d790e8b0bcf7bb47169 /tools | |
parent | 9dde9dc0a81c7aeb863b35121d09011f09b4897c (diff) | |
parent | ddf6e0e50723b62ac76ed18eb53e9417c6eefba7 (diff) | |
download | linux-d6c1c49de577fa292af2449817364b7d89b574d8.tar.xz |
Merge branch 'perf/urgent' into perf/core
Merge reason: Add these cherry-picked commits so that future changes
on perf/core don't conflict.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evsel.c | 10 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 10 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 2 | ||||
-rw-r--r-- | tools/perf/util/session.c | 4 |
4 files changed, 14 insertions, 12 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index b38eaa34b28e..ee68d6944e61 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -34,6 +34,16 @@ int __perf_evsel__sample_size(u64 sample_type) return size; } +static void hists__init(struct hists *hists) +{ + memset(hists, 0, sizeof(*hists)); + hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT; + hists->entries_in = &hists->entries_in_array[0]; + hists->entries_collapsed = RB_ROOT; + hists->entries = RB_ROOT; + pthread_mutex_init(&hists->lock, NULL); +} + void perf_evsel__init(struct perf_evsel *evsel, struct perf_event_attr *attr, int idx) { diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index a36a3fa81ffb..abef2703cd24 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1211,13 +1211,3 @@ size_t hists__fprintf_nr_events(struct hists *hists, FILE *fp) return ret; } - -void hists__init(struct hists *hists) -{ - memset(hists, 0, sizeof(*hists)); - hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT; - hists->entries_in = &hists->entries_in_array[0]; - hists->entries_collapsed = RB_ROOT; - hists->entries = RB_ROOT; - pthread_mutex_init(&hists->lock, NULL); -} diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 6676d558b2a7..ff6f9d56ea41 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h @@ -63,8 +63,6 @@ struct hists { struct callchain_cursor callchain_cursor; }; -void hists__init(struct hists *hists); - struct hist_entry *__hists__add_entry(struct hists *self, struct addr_location *al, struct symbol *parent, u64 period); diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 7d159088c4ac..d9318d8a9ba1 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1377,6 +1377,10 @@ int perf_session__cpu_bitmap(struct perf_session *session, } map = cpu_map__new(cpu_list); + if (map == NULL) { + pr_err("Invalid cpu_list\n"); + return -1; + } for (i = 0; i < map->nr; i++) { int cpu = map->map[i]; |