diff options
Diffstat (limited to 'tools/perf/ui/browsers/hists.c')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 52c03fbbba17..04a229aa5c0f 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include "../util.h" | 17 | #include "../util.h" |
18 | #include "../ui.h" | 18 | #include "../ui.h" |
19 | #include "map.h" | 19 | #include "map.h" |
20 | #include "annotate.h" | ||
20 | 21 | ||
21 | struct hist_browser { | 22 | struct hist_browser { |
22 | struct ui_browser b; | 23 | struct ui_browser b; |
@@ -1593,13 +1594,18 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
1593 | bi->to.sym->name) > 0) | 1594 | bi->to.sym->name) > 0) |
1594 | annotate_t = nr_options++; | 1595 | annotate_t = nr_options++; |
1595 | } else { | 1596 | } else { |
1596 | |||
1597 | if (browser->selection != NULL && | 1597 | if (browser->selection != NULL && |
1598 | browser->selection->sym != NULL && | 1598 | browser->selection->sym != NULL && |
1599 | !browser->selection->map->dso->annotate_warned && | 1599 | !browser->selection->map->dso->annotate_warned) { |
1600 | asprintf(&options[nr_options], "Annotate %s", | 1600 | struct annotation *notes; |
1601 | browser->selection->sym->name) > 0) | 1601 | |
1602 | annotate = nr_options++; | 1602 | notes = symbol__annotation(browser->selection->sym); |
1603 | |||
1604 | if (notes->src && | ||
1605 | asprintf(&options[nr_options], "Annotate %s", | ||
1606 | browser->selection->sym->name) > 0) | ||
1607 | annotate = nr_options++; | ||
1608 | } | ||
1603 | } | 1609 | } |
1604 | 1610 | ||
1605 | if (thread != NULL && | 1611 | if (thread != NULL && |
@@ -1656,6 +1662,7 @@ retry_popup_menu: | |||
1656 | 1662 | ||
1657 | if (choice == annotate || choice == annotate_t || choice == annotate_f) { | 1663 | if (choice == annotate || choice == annotate_t || choice == annotate_f) { |
1658 | struct hist_entry *he; | 1664 | struct hist_entry *he; |
1665 | struct annotation *notes; | ||
1659 | int err; | 1666 | int err; |
1660 | do_annotate: | 1667 | do_annotate: |
1661 | if (!objdump_path && perf_session_env__lookup_objdump(env)) | 1668 | if (!objdump_path && perf_session_env__lookup_objdump(env)) |
@@ -1679,6 +1686,10 @@ do_annotate: | |||
1679 | he->ms.map = he->branch_info->to.map; | 1686 | he->ms.map = he->branch_info->to.map; |
1680 | } | 1687 | } |
1681 | 1688 | ||
1689 | notes = symbol__annotation(he->ms.sym); | ||
1690 | if (!notes->src) | ||
1691 | continue; | ||
1692 | |||
1682 | /* | 1693 | /* |
1683 | * Don't let this be freed, say, by hists__decay_entry. | 1694 | * Don't let this be freed, say, by hists__decay_entry. |
1684 | */ | 1695 | */ |