diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-04 06:16:58 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-11-16 07:02:26 -0500 |
| commit | 0e2a5f10fb550835e199a3b56a80ed88232188e9 (patch) | |
| tree | 576df20527a565f7f1a23447ebe6289b05975321 /tools | |
| parent | 4a1dba72384193753e44e15d9d05a50be6587271 (diff) | |
perf python: Fix undefined symbol problem
Recently we made perf_evsel__init call hists__init, which broke the perf
python binding:
[root@emilia linux]# ./tools/perf/python/twatch.py
Traceback (most recent call last):
File "./tools/perf/python/twatch.py", line 16, in <module>
import perf
ImportError: /home/acme/git/build/perf/python/perf.so: undefined symbol: hists__init
Fix it by moving the hists__init function to its only caller, evsel.c.
This way we avoid dragging in other parts of tools/perf/util/ to the
perf python binding.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-5nffmdt5mu6ozxgj54oi4qon@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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 |
3 files changed, 10 insertions, 12 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index e42626422587..d7915d4e77cb 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) | |||
| 34 | return size; | 34 | return size; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | static void hists__init(struct hists *hists) | ||
| 38 | { | ||
| 39 | memset(hists, 0, sizeof(*hists)); | ||
| 40 | hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT; | ||
| 41 | hists->entries_in = &hists->entries_in_array[0]; | ||
| 42 | hists->entries_collapsed = RB_ROOT; | ||
| 43 | hists->entries = RB_ROOT; | ||
| 44 | pthread_mutex_init(&hists->lock, NULL); | ||
| 45 | } | ||
| 46 | |||
| 37 | void perf_evsel__init(struct perf_evsel *evsel, | 47 | void perf_evsel__init(struct perf_evsel *evsel, |
| 38 | struct perf_event_attr *attr, int idx) | 48 | struct perf_event_attr *attr, int idx) |
| 39 | { | 49 | { |
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) | |||
| 1211 | 1211 | ||
| 1212 | return ret; | 1212 | return ret; |
| 1213 | } | 1213 | } |
| 1214 | |||
| 1215 | void hists__init(struct hists *hists) | ||
| 1216 | { | ||
| 1217 | memset(hists, 0, sizeof(*hists)); | ||
| 1218 | hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT; | ||
| 1219 | hists->entries_in = &hists->entries_in_array[0]; | ||
| 1220 | hists->entries_collapsed = RB_ROOT; | ||
| 1221 | hists->entries = RB_ROOT; | ||
| 1222 | pthread_mutex_init(&hists->lock, NULL); | ||
| 1223 | } | ||
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index c86c1d27bd1e..89289c8e935e 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
| @@ -63,8 +63,6 @@ struct hists { | |||
| 63 | struct callchain_cursor callchain_cursor; | 63 | struct callchain_cursor callchain_cursor; |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | void hists__init(struct hists *hists); | ||
| 67 | |||
| 68 | struct hist_entry *__hists__add_entry(struct hists *self, | 66 | struct hist_entry *__hists__add_entry(struct hists *self, |
| 69 | struct addr_location *al, | 67 | struct addr_location *al, |
| 70 | struct symbol *parent, u64 period); | 68 | struct symbol *parent, u64 period); |
