]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - tools/perf/util/event.c
Merge commit 'v2.6.33' into perf/core
[net-next-2.6.git] / tools / perf / util / event.c
index 966d207a15096a7bc435fb2a8ed9d2335d469de8..705ec63548b4e66d6502eecf7b3a24a38ec81f8c 100644 (file)
@@ -227,7 +227,12 @@ static int find_symbol_cb(void *arg, const char *name, char type, u64 start)
 {
        struct process_symbol_args *args = arg;
 
-       if (!symbol_type__is_a(type, MAP__FUNCTION) || strcmp(name, args->name))
+       /*
+        * Must be a function or at least an alias, as in PARISC64, where "_text" is
+        * an 'A' to the same address as "_stext".
+        */
+       if (!(symbol_type__is_a(type, MAP__FUNCTION) ||
+             type == 'A') || strcmp(name, args->name))
                return 0;
 
        args->start = start;
@@ -368,13 +373,18 @@ int event__process_mmap(event_t *self, struct perf_session *session)
                        if (kernel == NULL)
                                goto out_problem;
 
-                       if (__map_groups__create_kernel_maps(&session->kmaps,
-                                                            session->vmlinux_maps,
-                                                            kernel) < 0)
+                       kernel->kernel = 1;
+                       if (__perf_session__create_kernel_maps(session, kernel) < 0)
                                goto out_problem;
 
                        session->vmlinux_maps[MAP__FUNCTION]->start = self->mmap.start;
                        session->vmlinux_maps[MAP__FUNCTION]->end   = self->mmap.start + self->mmap.len;
+                       /*
+                        * Be a bit paranoid here, some perf.data file came with
+                        * a zero sized synthesized MMAP event for the kernel.
+                        */
+                       if (session->vmlinux_maps[MAP__FUNCTION]->end == 0)
+                               session->vmlinux_maps[MAP__FUNCTION]->end = ~0UL;
 
                        perf_session__set_kallsyms_ref_reloc_sym(session, symbol_name,
                                                                 self->mmap.pgoff);
@@ -432,10 +442,10 @@ void thread__find_addr_map(struct thread *self,
        al->thread = self;
        al->addr = addr;
 
-       if (cpumode & PERF_RECORD_MISC_KERNEL) {
+       if (cpumode == PERF_RECORD_MISC_KERNEL) {
                al->level = 'k';
                mg = &session->kmaps;
-       } else if (cpumode & PERF_RECORD_MISC_USER)
+       } else if (cpumode == PERF_RECORD_MISC_USER)
                al->level = '.';
        else {
                al->level = 'H';
@@ -470,7 +480,7 @@ void thread__find_addr_location(struct thread *self,
 {
        thread__find_addr_map(self, session, cpumode, type, addr, al);
        if (al->map != NULL)
-               al->sym = map__find_symbol(al->map, session, al->addr, filter);
+               al->sym = map__find_symbol(al->map, al->addr, filter);
        else
                al->sym = NULL;
 }