perf report: Postpone objdump check until annotation requested
[platform/adaptation/renesas_rcar/renesas_kernel.git] / tools / perf / builtin-top.c
index e434a16..c9ff395 100644 (file)
@@ -26,6 +26,7 @@
 #include "util/color.h"
 #include "util/evlist.h"
 #include "util/evsel.h"
+#include "util/machine.h"
 #include "util/session.h"
 #include "util/symbol.h"
 #include "util/thread.h"
@@ -316,7 +317,7 @@ static void perf_top__print_sym_table(struct perf_top *top)
        hists__output_recalc_col_len(&top->sym_evsel->hists,
                                     top->winsize.ws_row - 3);
        putchar('\n');
-       hists__fprintf(&top->sym_evsel->hists, NULL, false, false,
+       hists__fprintf(&top->sym_evsel->hists, false,
                       top->winsize.ws_row - 4 - printed, win_width, stdout);
 }
 
@@ -581,6 +582,11 @@ static void *display_thread_tui(void *arg)
        struct perf_evsel *pos;
        struct perf_top *top = arg;
        const char *help = "For a higher level overview, try: perf top --sort comm,dso";
+       struct hist_browser_timer hbt = {
+               .timer          = perf_top__sort_new_samples,
+               .arg            = top,
+               .refresh        = top->delay_secs,
+       };
 
        perf_top__sort_new_samples(top);
 
@@ -592,9 +598,8 @@ static void *display_thread_tui(void *arg)
        list_for_each_entry(pos, &top->evlist->entries, node)
                pos->hists.uid_filter_str = top->target.uid_str;
 
-       perf_evlist__tui_browse_hists(top->evlist, help,
-                                     perf_top__sort_new_samples,
-                                     top, top->delay_secs);
+       perf_evlist__tui_browse_hists(top->evlist, help, &hbt,
+                                     &top->session->header.env);
 
        exit_browser(0);
        exit(0);
@@ -871,7 +876,7 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
                                                   &sample, machine);
                } else if (event->header.type < PERF_RECORD_MAX) {
                        hists__inc_nr_events(&evsel->hists, event->header.type);
-                       perf_event__process(&top->tool, event, &sample, machine);
+                       machine__process_event(machine, event);
                } else
                        ++session->hists.stats.nr_unknown_events;
        }
@@ -976,6 +981,10 @@ try_again:
                                ui__error("Too many events are opened.\n"
                                            "Try again after reducing the number of events\n");
                                goto out_err;
+                       } else if ((err == EOPNOTSUPP) && (attr->precise_ip)) {
+                               ui__error("\'precise\' request may not be supported. "
+                                         "Try removing 'p' modifier\n");
+                               goto out_err;
                        }
 
                        ui__error("The sys_perf_event_open() syscall "
@@ -1159,11 +1168,6 @@ setup:
        return 0;
 }
 
-static const char * const top_usage[] = {
-       "perf top [<options>]",
-       NULL
-};
-
 int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
 {
        struct perf_evsel *pos;
@@ -1250,6 +1254,10 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
        OPT_STRING('u', "uid", &top.target.uid_str, "user", "user to profile"),
        OPT_END()
        };
+       const char * const top_usage[] = {
+               "perf top [<options>]",
+               NULL
+       };
 
        top.evlist = perf_evlist__new(NULL, NULL);
        if (top.evlist == NULL)