]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge branch 'linus' into perfcounters/urgent
authorIngo Molnar <mingo@elte.hu>
Wed, 1 Jul 2009 07:56:10 +0000 (09:56 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 1 Jul 2009 07:56:26 +0000 (09:56 +0200)
Merge reason: this branch was on a .30-ish base before, update
              it to an almost-.31-rc2 upstream base to pick up fixes.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/Makefile
tools/perf/builtin-report.c
tools/perf/builtin-top.c

index 9c6d0ae3708e04b6fa2a6bcf40dfede08a5eaa2e..f572c90f610ea6de4aede137f3fc3863f5b21602 100644 (file)
@@ -381,12 +381,6 @@ ifndef CC_LD_DYNPATH
        endif
 endif
 
-ifdef ZLIB_PATH
-       BASIC_CFLAGS += -I$(ZLIB_PATH)/include
-       EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
-endif
-EXTLIBS += -lz
-
 ifdef NEEDS_SOCKET
        EXTLIBS += -lsocket
 endif
index 135b7837e6bf3de20575d8c28bf0ee63037aab9e..3f5d8ea05ff09866a1480e588cee9426768e3fa5 100644 (file)
@@ -121,6 +121,7 @@ typedef union event_union {
 static LIST_HEAD(dsos);
 static struct dso *kernel_dso;
 static struct dso *vdso;
+static struct dso *hypervisor_dso;
 
 static void dsos__add(struct dso *dso)
 {
@@ -202,6 +203,11 @@ static int load_kernel(void)
 
        dsos__add(vdso);
 
+       hypervisor_dso = dso__new("[hypervisor]", 0);
+       if (!hypervisor_dso)
+               return -1;
+       dsos__add(hypervisor_dso);
+
        return err;
 }
 
@@ -640,7 +646,8 @@ sort__sym_print(FILE *fp, struct hist_entry *self)
 
        if (self->sym) {
                ret += fprintf(fp, "[%c] %s",
-                       self->dso == kernel_dso ? 'k' : '.', self->sym->name);
+                       self->dso == kernel_dso ? 'k' :
+                       self->dso == hypervisor_dso ? 'h' : '.', self->sym->name);
        } else {
                ret += fprintf(fp, "%#016llx", (u64)self->ip);
        }
@@ -963,6 +970,9 @@ hist_entry__add(struct thread *thread, struct map *map, struct dso *dso,
                        }
 
                        switch (context) {
+                       case PERF_CONTEXT_HV:
+                               dso = hypervisor_dso;
+                               break;
                        case PERF_CONTEXT_KERNEL:
                                dso = kernel_dso;
                                break;
@@ -1213,6 +1223,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
        struct map *map = NULL;
        void *more_data = event->ip.__more_data;
        struct ip_callchain *chain = NULL;
+       int cpumode;
 
        if (sample_type & PERF_SAMPLE_PERIOD) {
                period = *(u64 *)more_data;
@@ -1256,7 +1267,9 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
        if (comm_list && !strlist__has_entry(comm_list, thread->comm))
                return 0;
 
-       if (event->header.misc & PERF_EVENT_MISC_KERNEL) {
+       cpumode = event->header.misc & PERF_EVENT_MISC_CPUMODE_MASK;
+
+       if (cpumode == PERF_EVENT_MISC_KERNEL) {
                show = SHOW_KERNEL;
                level = 'k';
 
@@ -1264,7 +1277,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
 
                dprintf(" ...... dso: %s\n", dso->name);
 
-       } else if (event->header.misc & PERF_EVENT_MISC_USER) {
+       } else if (cpumode == PERF_EVENT_MISC_USER) {
 
                show = SHOW_USER;
                level = '.';
@@ -1272,6 +1285,9 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
        } else {
                show = SHOW_HV;
                level = 'H';
+
+               dso = hypervisor_dso;
+
                dprintf(" ...... dso: [hypervisor]\n");
        }
 
index cf0d21f1ae10e8917809519942b010cdf8d6d64a..0506cd6e04cce267b9cc33bea3906d80b50e6f63 100644 (file)
@@ -286,11 +286,31 @@ static void *display_thread(void *arg)
        return NULL;
 }
 
+/* Tag samples to be skipped. */
+char *skip_symbols[] = {
+       "default_idle",
+       "cpu_idle",
+       "enter_idle",
+       "exit_idle",
+       "mwait_idle",
+       "ppc64_runlatch_off",
+       "pseries_dedicated_idle_sleep",
+       NULL
+};
+
 static int symbol_filter(struct dso *self, struct symbol *sym)
 {
        static int filter_match;
        struct sym_entry *syme;
        const char *name = sym->name;
+       int i;
+
+       /*
+        * ppc64 uses function descriptors and appends a '.' to the
+        * start of every instruction address. Remove it.
+        */
+       if (name[0] == '.')
+               name++;
 
        if (!strcmp(name, "_text") ||
            !strcmp(name, "_etext") ||
@@ -302,13 +322,12 @@ static int symbol_filter(struct dso *self, struct symbol *sym)
                return 1;
 
        syme = dso__sym_priv(self, sym);
-       /* Tag samples to be skipped. */
-       if (!strcmp("default_idle", name) ||
-           !strcmp("cpu_idle", name) ||
-           !strcmp("enter_idle", name) ||
-           !strcmp("exit_idle", name) ||
-           !strcmp("mwait_idle", name))
-               syme->skip = 1;
+       for (i = 0; skip_symbols[i]; i++) {
+               if (!strcmp(skip_symbols[i], name)) {
+                       syme->skip = 1;
+                       break;
+               }
+       }
 
        if (filter_match == 1) {
                filter_end = sym->start;
@@ -675,7 +694,7 @@ static const struct option options[] = {
                            "put the counters into a counter group"),
        OPT_STRING('s', "sym-filter", &sym_filter, "pattern",
                    "only display symbols matchig this pattern"),
-       OPT_BOOLEAN('z', "zero", &group,
+       OPT_BOOLEAN('z', "zero", &zero,
                    "zero history across updates"),
        OPT_INTEGER('F', "freq", &freq,
                    "profile at this frequency"),