perf report: Print the map table just after samples for which no map was found
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 9 Mar 2010 18:58:17 +0000 (15:58 -0300)
committerIngo Molnar <mingo@elte.hu>
Wed, 10 Mar 2010 12:53:52 +0000 (13:53 +0100)
If -vv is used just the map table will be printed, -vvv will
print the symbol table too, with it we can see that we have a
bug where some samples are not being resolved to a map when we
get them in the perf.data stream, but after we have it all
processed, we can find the right map, some reordering probably
is happening.

Upcoming patches will provide ways to ask for most PERF_SAMPLE_
conditional samples to be taken for !PERF_RECORD_SAMPLE events
too, then we'll be able to ask for PERF_SAMPLE_TIME and
PERF_SAMPLE_CPU to help diagnose this.

Signed-off-by: Arnaldo Carvalho de Melo <acme@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: <1268161097-17761-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/util/hist.c
tools/perf/util/thread.c
tools/perf/util/thread.h

index 73ebb6fb34ac17ee3eb33dada1fb886bbbf8f1c8..bdcfd6190b217d88c2d8530fb8400f442c62d96d 100644 (file)
@@ -655,6 +655,11 @@ print_entries:
                }
                ret += hist_entry__fprintf(h, pair, show_displacement,
                                           displacement, fp, session_total);
+               if (h->map == NULL && verbose > 1) {
+                       __map_groups__fprintf_maps(&h->thread->mg,
+                                                  MAP__FUNCTION, fp);
+                       fprintf(fp, "%.10s end\n", graph_dotted_line);
+               }
        }
 
        free(rem_sq_bracket);
index 9024fa1ff5c226dc77d864ccb49e07dddda35118..fa968312ee7d5c5044e6e186394f1b6d14ca05ab 100644 (file)
@@ -79,8 +79,8 @@ int thread__comm_len(struct thread *self)
        return self->comm_len;
 }
 
-static size_t __map_groups__fprintf_maps(struct map_groups *self,
-                                        enum map_type type, FILE *fp)
+size_t __map_groups__fprintf_maps(struct map_groups *self,
+                                 enum map_type type, FILE *fp)
 {
        size_t printed = fprintf(fp, "%s:\n", map_type__name[type]);
        struct rb_node *nd;
@@ -89,7 +89,7 @@ static size_t __map_groups__fprintf_maps(struct map_groups *self,
                struct map *pos = rb_entry(nd, struct map, rb_node);
                printed += fprintf(fp, "Map:");
                printed += map__fprintf(pos, fp);
-               if (verbose > 1) {
+               if (verbose > 2) {
                        printed += dso__fprintf(pos->dso, type, fp);
                        printed += fprintf(fp, "--\n");
                }
index 0a28f39de545f5810893fe44b87af0f895000037..dcf70303e58ee3a98675ad156d46658e67d1d1ec 100644 (file)
@@ -10,6 +10,9 @@ struct map_groups {
        struct list_head        removed_maps[MAP__NR_TYPES];
 };
 
+size_t __map_groups__fprintf_maps(struct map_groups *self,
+                                 enum map_type type, FILE *fp);
+
 struct thread {
        struct rb_node          rb_node;
        struct map_groups       mg;