aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-03-16 16:41:52 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-03-16 16:41:52 -0400
commit0ba332f70a555548430ef3cf459b5240df0ffbd5 (patch)
tree078ea66d4a685c12511ace67e7cdce13f3b382e6 /tools
parent107eb964d8c04417e8bce9e9ec2ed61d9261aec6 (diff)
perf hists browser: Simplify symbol annotation menu setup
No need to repeat some tests, skip annotation instead. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-6h6igrb81u4e6rwfmx7dv47n@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/ui/browsers/hists.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 49eddeb81458..f69371b7f49b 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1612,19 +1612,22 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1612 if (!sort__has_sym) 1612 if (!sort__has_sym)
1613 goto add_exit_option; 1613 goto add_exit_option;
1614 1614
1615 if (browser->selection == NULL)
1616 goto skip_annotation;
1617
1615 if (sort__mode == SORT_MODE__BRANCH) { 1618 if (sort__mode == SORT_MODE__BRANCH) {
1616 bi = browser->he_selection->branch_info; 1619 bi = browser->he_selection->branch_info;
1617 if (browser->selection != NULL && 1620
1618 bi && 1621 if (bi == NULL)
1619 bi->from.sym != NULL && 1622 goto skip_annotation;
1623
1624 if (bi->from.sym != NULL &&
1620 !bi->from.map->dso->annotate_warned && 1625 !bi->from.map->dso->annotate_warned &&
1621 asprintf(&options[nr_options], "Annotate %s", 1626 asprintf(&options[nr_options], "Annotate %s",
1622 bi->from.sym->name) > 0) 1627 bi->from.sym->name) > 0)
1623 annotate_f = nr_options++; 1628 annotate_f = nr_options++;
1624 1629
1625 if (browser->selection != NULL && 1630 if (bi->to.sym != NULL &&
1626 bi &&
1627 bi->to.sym != NULL &&
1628 !bi->to.map->dso->annotate_warned && 1631 !bi->to.map->dso->annotate_warned &&
1629 (bi->to.sym != bi->from.sym || 1632 (bi->to.sym != bi->from.sym ||
1630 bi->to.map->dso != bi->from.map->dso) && 1633 bi->to.map->dso != bi->from.map->dso) &&
@@ -1632,8 +1635,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1632 bi->to.sym->name) > 0) 1635 bi->to.sym->name) > 0)
1633 annotate_t = nr_options++; 1636 annotate_t = nr_options++;
1634 } else { 1637 } else {
1635 if (browser->selection != NULL && 1638 if (browser->selection->sym != NULL &&
1636 browser->selection->sym != NULL &&
1637 !browser->selection->map->dso->annotate_warned) { 1639 !browser->selection->map->dso->annotate_warned) {
1638 struct annotation *notes; 1640 struct annotation *notes;
1639 1641
@@ -1645,7 +1647,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1645 annotate = nr_options++; 1647 annotate = nr_options++;
1646 } 1648 }
1647 } 1649 }
1648 1650skip_annotation:
1649 if (thread != NULL && 1651 if (thread != NULL &&
1650 asprintf(&options[nr_options], "Zoom %s %s(%d) thread", 1652 asprintf(&options[nr_options], "Zoom %s %s(%d) thread",
1651 (browser->hists->thread_filter ? "out of" : "into"), 1653 (browser->hists->thread_filter ? "out of" : "into"),