]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - tools/perf/builtin-top.c
perf annotate: Pass perf_evsel instead of just evsel->idx
[mirror_ubuntu-eoan-kernel.git] / tools / perf / builtin-top.c
index c11b46b411d51844d05efba711f242838ddbb2d5..bc71e899096da47be460699f13cf76bbd59a6895 100644 (file)
@@ -188,7 +188,7 @@ static void ui__warn_map_erange(struct map *map, struct symbol *sym, u64 ip)
 static void perf_top__record_precise_ip(struct perf_top *top,
                                        struct hist_entry *he,
                                        struct perf_sample *sample,
-                                       int counter, u64 ip)
+                                       struct perf_evsel *evsel, u64 ip)
 {
        struct annotation *notes;
        struct symbol *sym = he->ms.sym;
@@ -204,7 +204,7 @@ static void perf_top__record_precise_ip(struct perf_top *top,
        if (pthread_mutex_trylock(&notes->lock))
                return;
 
-       err = hist_entry__inc_addr_samples(he, sample, counter, ip);
+       err = hist_entry__inc_addr_samples(he, sample, evsel, ip);
 
        pthread_mutex_unlock(&notes->lock);
 
@@ -691,7 +691,7 @@ static int hist_iter__top_callback(struct hist_entry_iter *iter,
        struct perf_evsel *evsel = iter->evsel;
 
        if (perf_hpp_list.sym && single)
-               perf_top__record_precise_ip(top, he, iter->sample, evsel->idx, al->addr);
+               perf_top__record_precise_ip(top, he, iter->sample, evsel, al->addr);
 
        hist__account_cycles(iter->sample->branch_stack, al, iter->sample,
                     !(top->record_opts.branch_stack & PERF_SAMPLE_BRANCH_ANY));
@@ -742,7 +742,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
 "Kernel address maps (/proc/{kallsyms,modules}) are restricted.\n\n"
 "Check /proc/sys/kernel/kptr_restrict.\n\n"
 "Kernel%s samples will not be resolved.\n",
-                         al.map && dso__has_symbols(al.map->dso, MAP__FUNCTION) ?
+                         al.map && map__has_symbols(al.map) ?
                          " modules" : "");
                        if (use_browser <= 0)
                                sleep(5);
@@ -764,8 +764,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
                 * invalid --vmlinux ;-)
                 */
                if (!machine->kptr_restrict_warned && !top->vmlinux_warned &&
-                   __map__is_kernel(al.map) &&
-                   dso__has_symbols(al.map->dso, MAP__FUNCTION)) {
+                   __map__is_kernel(al.map) && map__has_symbols(al.map)) {
                        if (symbol_conf.vmlinux_name) {
                                char serr[256];
                                dso__strerror_load(al.map->dso, serr, sizeof(serr));
@@ -1265,7 +1264,7 @@ int cmd_top(int argc, const char **argv)
                        .proc_map_timeout    = 500,
                        .overwrite      = 1,
                },
-               .max_stack           = sysctl_perf_event_max_stack,
+               .max_stack           = sysctl__max_stack(),
                .sym_pcnt_filter     = 5,
                .nr_threads_synthesize = UINT_MAX,
        };