perf tools: Remove filter parameter of perf_event__preprocess_sample()
[deliverable/linux.git] / tools / perf / builtin-top.c
index f036af9b6f09f00e52debecafe09a1c930d3ad12..e37521fc715a7313df807380376c326ab5d3e6bd 100644 (file)
@@ -40,6 +40,7 @@
 #include "util/xyarray.h"
 #include "util/sort.h"
 #include "util/intlist.h"
+#include "arch/common.h"
 
 #include "util/debug.h"
 
@@ -102,7 +103,8 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
        /*
         * We can't annotate with just /proc/kallsyms
         */
-       if (map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS) {
+       if (map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS &&
+           !dso__is_kcore(map->dso)) {
                pr_err("Can't annotate %s: No vmlinux file was found in the "
                       "path\n", sym->name);
                sleep(1);
@@ -237,8 +239,6 @@ out_unlock:
        pthread_mutex_unlock(&notes->lock);
 }
 
-static const char              CONSOLE_CLEAR[] = "\e[H\e[2J";
-
 static struct hist_entry *perf_evsel__add_hist_entry(struct perf_evsel *evsel,
                                                     struct addr_location *al,
                                                     struct perf_sample *sample)
@@ -716,8 +716,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
        if (event->header.misc & PERF_RECORD_MISC_EXACT_IP)
                top->exact_samples++;
 
-       if (perf_event__preprocess_sample(event, machine, &al, sample,
-                                         symbol_filter) < 0 ||
+       if (perf_event__preprocess_sample(event, machine, &al, sample) < 0 ||
            al.filtered)
                return;
 
@@ -772,8 +771,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
                    sample->callchain) {
                        err = machine__resolve_callchain(machine, evsel,
                                                         al.thread, sample,
-                                                        &parent);
-
+                                                        &parent, &al);
                        if (err)
                                return;
                }
@@ -939,6 +937,14 @@ static int __cmd_top(struct perf_top *top)
        if (top->session == NULL)
                return -ENOMEM;
 
+       machines__set_symbol_filter(&top->session->machines, symbol_filter);
+
+       if (!objdump_path) {
+               ret = perf_session_env__lookup_objdump(&top->session->header.env);
+               if (ret)
+                       goto out_delete;
+       }
+
        ret = perf_top__setup_sample_type(top);
        if (ret)
                goto out_delete;
@@ -1102,6 +1108,9 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
        OPT_CALLBACK_DEFAULT('G', "call-graph", &top.record_opts,
                             "mode[,dump_size]", record_callchain_help,
                             &parse_callchain_opt, "fp"),
+       OPT_CALLBACK(0, "ignore-callees", NULL, "regex",
+                  "ignore callees of these functions in call graphs",
+                  report_parse_ignore_callees_opt),
        OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
                    "Show a column with the sum of periods"),
        OPT_STRING(0, "dsos", &symbol_conf.dso_list_str, "dso[,dso...]",
@@ -1114,6 +1123,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
                    "Interleave source code with assembly code (default)"),
        OPT_BOOLEAN(0, "asm-raw", &symbol_conf.annotate_asm_raw,
                    "Display raw encoding of assembly instructions (default)"),
+       OPT_STRING(0, "objdump", &objdump_path, "path",
+                   "objdump binary to use for disassembly and annotations"),
        OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
                   "Specify disassembler style (e.g. -M intel for intel syntax)"),
        OPT_STRING('u', "uid", &target->uid_str, "user", "user to profile"),
@@ -1130,8 +1141,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
        if (top.evlist == NULL)
                return -ENOMEM;
 
-       symbol_conf.exclude_other = false;
-
        argc = parse_options(argc, argv, options, top_usage, 0);
        if (argc)
                usage_with_options(top_usage, options);
This page took 0.026406 seconds and 5 git commands to generate.