diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /tools/perf/builtin-annotate.c | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r-- | tools/perf/builtin-annotate.c | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 4087ab1..5ebd0c3 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -28,10 +28,8 @@ #include "util/hist.h" #include "util/session.h" #include "util/tool.h" -#include "util/data.h" #include "arch/common.h" -#include <dlfcn.h> #include <linux/bitmap.h> struct perf_annotate { @@ -65,7 +63,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel, return 0; } - he = __hists__add_entry(&evsel->hists, al, NULL, NULL, NULL, 1, 1, 0); + he = __hists__add_entry(&evsel->hists, al, NULL, 1, 1); if (he == NULL) return -ENOMEM; @@ -118,11 +116,11 @@ static int hist_entry__tty_annotate(struct hist_entry *he, ann->print_line, ann->full_paths, 0, 0); } -static void hists__find_annotations(struct hists *hists, +static void hists__find_annotations(struct hists *self, struct perf_evsel *evsel, struct perf_annotate *ann) { - struct rb_node *nd = rb_first(&hists->entries), *next; + struct rb_node *nd = rb_first(&self->entries), *next; int key = K_RIGHT; while (nd) { @@ -144,18 +142,8 @@ find_next: if (use_browser == 2) { int ret; - int (*annotate)(struct hist_entry *he, - struct perf_evsel *evsel, - struct hist_browser_timer *hbt); - - annotate = dlsym(perf_gtk_handle, - "hist_entry__gtk_annotate"); - if (annotate == NULL) { - ui__error("GTK browser not found!\n"); - return; - } - ret = annotate(he, evsel, NULL); + ret = hist_entry__gtk_annotate(he, evsel, NULL); if (!ret || !ann->skip_missing) return; @@ -200,13 +188,9 @@ static int __cmd_annotate(struct perf_annotate *ann) struct perf_session *session; struct perf_evsel *pos; u64 total_nr_samples; - struct perf_data_file file = { - .path = input_name, - .mode = PERF_DATA_MODE_READ, - .force = ann->force, - }; - session = perf_session__new(&file, false, &ann->tool); + session = perf_session__new(input_name, O_RDONLY, + ann->force, false, &ann->tool); if (session == NULL) return -ENOMEM; @@ -247,7 +231,7 @@ static int __cmd_annotate(struct perf_annotate *ann) if (nr_samples > 0) { total_nr_samples += nr_samples; - hists__collapse_resort(hists, NULL); + hists__collapse_resort(hists); hists__output_resort(hists); if (symbol_conf.event_group && @@ -259,21 +243,12 @@ static int __cmd_annotate(struct perf_annotate *ann) } if (total_nr_samples == 0) { - ui__error("The %s file has no samples!\n", file.path); + ui__error("The %s file has no samples!\n", session->filename); goto out_delete; } - if (use_browser == 2) { - void (*show_annotations)(void); - - show_annotations = dlsym(perf_gtk_handle, - "perf_gtk__show_annotations"); - if (show_annotations == NULL) { - ui__error("GTK browser not found!\n"); - goto out_delete; - } - show_annotations(); - } + if (use_browser == 2) + perf_gtk__show_annotations(); out_delete: /* |