From 03dd4cb26d967f9588437b0fc9cc0e8353322bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Fri, 25 Mar 2016 03:53:42 -0300 Subject: Linux-libre 4.5-gnu --- tools/perf/builtin-annotate.c | 44 ++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'tools/perf/builtin-annotate.c') diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 2bf9b3fd9..cc5c1267c 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -21,7 +21,7 @@ #include "util/evsel.h" #include "util/annotate.h" #include "util/event.h" -#include "util/parse-options.h" +#include #include "util/parse-events.h" #include "util/thread.h" #include "util/sort.h" @@ -47,7 +47,7 @@ struct perf_annotate { }; static int perf_evsel__add_sample(struct perf_evsel *evsel, - struct perf_sample *sample __maybe_unused, + struct perf_sample *sample, struct addr_location *al, struct perf_annotate *ann) { @@ -72,7 +72,10 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel, return 0; } - he = __hists__add_entry(hists, al, NULL, NULL, NULL, 1, 1, 0, true); + sample->period = 1; + sample->weight = 1; + + he = __hists__add_entry(hists, al, NULL, NULL, NULL, sample, true); if (he == NULL) return -ENOMEM; @@ -343,18 +346,19 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused) return ret; argc = parse_options(argc, argv, options, annotate_usage, 0); + if (argc) { + /* + * Special case: if there's an argument left then assume that + * it's a symbol filter: + */ + if (argc > 1) + usage_with_options(annotate_usage, options); - if (annotate.use_stdio) - use_browser = 0; - else if (annotate.use_tui) - use_browser = 1; - else if (annotate.use_gtk) - use_browser = 2; + annotate.sym_hist_filter = argv[0]; + } file.path = input_name; - setup_browser(true); - annotate.session = perf_session__new(&file, false, &annotate.tool); if (annotate.session == NULL) return -1; @@ -366,19 +370,17 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused) if (ret < 0) goto out_delete; - if (setup_sorting() < 0) + if (setup_sorting(NULL) < 0) usage_with_options(annotate_usage, options); - if (argc) { - /* - * Special case: if there's an argument left then assume that - * it's a symbol filter: - */ - if (argc > 1) - usage_with_options(annotate_usage, options); + if (annotate.use_stdio) + use_browser = 0; + else if (annotate.use_tui) + use_browser = 1; + else if (annotate.use_gtk) + use_browser = 2; - annotate.sym_hist_filter = argv[0]; - } + setup_browser(true); ret = __cmd_annotate(&annotate); -- cgit v1.2.3