diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-11 11:50:36 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-12 01:42:09 -0500 |
commit | 9958e1f0aee632c3665162c9c93cf8fde8006a94 (patch) | |
tree | ffd81c34d3ca8044c3fe0d670dc1786113624bbb /tools/perf/util/event.c | |
parent | 58e9f94138c1d9c47f6a63632ca7a78fc6dcc15f (diff) |
perf symbols: Rename kthreads to kmaps, using another abstraction for it
Using a struct thread instance just to hold the kernel space maps
(vmlinux + modules) is overkill and confuses people trying to
understand the perf symbols abstractions.
The kernel maps are really present in all threads, i.e. the kernel
is a library, not a separate thread.
So introduce the 'map_groups' abstraction and use it for the kernel
maps, now in the kmaps global variable.
It, in turn, will move, together with the threads list to the
perf_file abstraction, so that we can support multiple perf_file
instances, needed by perf diff.
Brainstormed-with: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260550239-5372-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r-- | tools/perf/util/event.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 4dcecafa85dc..ba0de90cd3d4 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -254,13 +254,14 @@ void thread__find_addr_location(struct thread *self, u8 cpumode, | |||
254 | struct addr_location *al, | 254 | struct addr_location *al, |
255 | symbol_filter_t filter) | 255 | symbol_filter_t filter) |
256 | { | 256 | { |
257 | struct thread *thread = al->thread = self; | 257 | struct map_groups *mg = &self->mg; |
258 | 258 | ||
259 | al->thread = self; | ||
259 | al->addr = addr; | 260 | al->addr = addr; |
260 | 261 | ||
261 | if (cpumode & PERF_RECORD_MISC_KERNEL) { | 262 | if (cpumode & PERF_RECORD_MISC_KERNEL) { |
262 | al->level = 'k'; | 263 | al->level = 'k'; |
263 | thread = kthread; | 264 | mg = kmaps; |
264 | } else if (cpumode & PERF_RECORD_MISC_USER) | 265 | } else if (cpumode & PERF_RECORD_MISC_USER) |
265 | al->level = '.'; | 266 | al->level = '.'; |
266 | else { | 267 | else { |
@@ -270,7 +271,7 @@ void thread__find_addr_location(struct thread *self, u8 cpumode, | |||
270 | return; | 271 | return; |
271 | } | 272 | } |
272 | try_again: | 273 | try_again: |
273 | al->map = thread__find_map(thread, type, al->addr); | 274 | al->map = map_groups__find(mg, type, al->addr); |
274 | if (al->map == NULL) { | 275 | if (al->map == NULL) { |
275 | /* | 276 | /* |
276 | * If this is outside of all known maps, and is a negative | 277 | * If this is outside of all known maps, and is a negative |
@@ -281,8 +282,8 @@ try_again: | |||
281 | * "[vdso]" dso, but for now lets use the old trick of looking | 282 | * "[vdso]" dso, but for now lets use the old trick of looking |
282 | * in the whole kernel symbol list. | 283 | * in the whole kernel symbol list. |
283 | */ | 284 | */ |
284 | if ((long long)al->addr < 0 && thread != kthread) { | 285 | if ((long long)al->addr < 0 && mg != kmaps) { |
285 | thread = kthread; | 286 | mg = kmaps; |
286 | goto try_again; | 287 | goto try_again; |
287 | } | 288 | } |
288 | al->sym = NULL; | 289 | al->sym = NULL; |