diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-11-02 01:50:06 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-05 12:03:58 -0500 |
commit | 68d807586ba83d9cb77f12c8fb7c97ea438d34ad (patch) | |
tree | 15794b3d68f8770312c4e089ff50ece2b78318bc /tools/perf/ui | |
parent | 9783adf777a445a1e9d0db4857a3a896a9f42d4a (diff) |
perf report: Postpone objdump check until annotation requested
David reported that current perf report refused to run on a data file
captured from a different machine because of objdump.
Since the objdump tools won't be used unless annotation was requested,
checking its presence at init time doesn't make sense.
Reported-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Irina Tirdea <irina.tirdea@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1351835406-15208-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index c7d32edb8057..ccc4bd161420 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "../../util/pstack.h" | 11 | #include "../../util/pstack.h" |
12 | #include "../../util/sort.h" | 12 | #include "../../util/sort.h" |
13 | #include "../../util/util.h" | 13 | #include "../../util/util.h" |
14 | #include "../../arch/common.h" | ||
14 | 15 | ||
15 | #include "../browser.h" | 16 | #include "../browser.h" |
16 | #include "../helpline.h" | 17 | #include "../helpline.h" |
@@ -1137,7 +1138,8 @@ static inline bool is_report_browser(void *timer) | |||
1137 | static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | 1138 | static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, |
1138 | const char *helpline, const char *ev_name, | 1139 | const char *helpline, const char *ev_name, |
1139 | bool left_exits, | 1140 | bool left_exits, |
1140 | struct hist_browser_timer *hbt) | 1141 | struct hist_browser_timer *hbt, |
1142 | struct perf_session_env *env) | ||
1141 | { | 1143 | { |
1142 | struct hists *hists = &evsel->hists; | 1144 | struct hists *hists = &evsel->hists; |
1143 | struct hist_browser *browser = hist_browser__new(hists); | 1145 | struct hist_browser *browser = hist_browser__new(hists); |
@@ -1367,6 +1369,9 @@ retry_popup_menu: | |||
1367 | struct hist_entry *he; | 1369 | struct hist_entry *he; |
1368 | int err; | 1370 | int err; |
1369 | do_annotate: | 1371 | do_annotate: |
1372 | if (!objdump_path && perf_session_env__lookup_objdump(env)) | ||
1373 | continue; | ||
1374 | |||
1370 | he = hist_browser__selected_entry(browser); | 1375 | he = hist_browser__selected_entry(browser); |
1371 | if (he == NULL) | 1376 | if (he == NULL) |
1372 | continue; | 1377 | continue; |
@@ -1470,6 +1475,7 @@ struct perf_evsel_menu { | |||
1470 | struct ui_browser b; | 1475 | struct ui_browser b; |
1471 | struct perf_evsel *selection; | 1476 | struct perf_evsel *selection; |
1472 | bool lost_events, lost_events_warned; | 1477 | bool lost_events, lost_events_warned; |
1478 | struct perf_session_env *env; | ||
1473 | }; | 1479 | }; |
1474 | 1480 | ||
1475 | static void perf_evsel_menu__write(struct ui_browser *browser, | 1481 | static void perf_evsel_menu__write(struct ui_browser *browser, |
@@ -1551,7 +1557,8 @@ browse_hists: | |||
1551 | hbt->timer(hbt->arg); | 1557 | hbt->timer(hbt->arg); |
1552 | ev_name = perf_evsel__name(pos); | 1558 | ev_name = perf_evsel__name(pos); |
1553 | key = perf_evsel__hists_browse(pos, nr_events, help, | 1559 | key = perf_evsel__hists_browse(pos, nr_events, help, |
1554 | ev_name, true, hbt); | 1560 | ev_name, true, hbt, |
1561 | menu->env); | ||
1555 | ui_browser__show_title(&menu->b, title); | 1562 | ui_browser__show_title(&menu->b, title); |
1556 | switch (key) { | 1563 | switch (key) { |
1557 | case K_TAB: | 1564 | case K_TAB: |
@@ -1599,7 +1606,8 @@ out: | |||
1599 | 1606 | ||
1600 | static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, | 1607 | static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, |
1601 | const char *help, | 1608 | const char *help, |
1602 | struct hist_browser_timer *hbt) | 1609 | struct hist_browser_timer *hbt, |
1610 | struct perf_session_env *env) | ||
1603 | { | 1611 | { |
1604 | struct perf_evsel *pos; | 1612 | struct perf_evsel *pos; |
1605 | struct perf_evsel_menu menu = { | 1613 | struct perf_evsel_menu menu = { |
@@ -1611,6 +1619,7 @@ static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, | |||
1611 | .nr_entries = evlist->nr_entries, | 1619 | .nr_entries = evlist->nr_entries, |
1612 | .priv = evlist, | 1620 | .priv = evlist, |
1613 | }, | 1621 | }, |
1622 | .env = env, | ||
1614 | }; | 1623 | }; |
1615 | 1624 | ||
1616 | ui_helpline__push("Press ESC to exit"); | 1625 | ui_helpline__push("Press ESC to exit"); |
@@ -1627,15 +1636,16 @@ static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, | |||
1627 | } | 1636 | } |
1628 | 1637 | ||
1629 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, | 1638 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, |
1630 | struct hist_browser_timer *hbt) | 1639 | struct hist_browser_timer *hbt, |
1640 | struct perf_session_env *env) | ||
1631 | { | 1641 | { |
1632 | if (evlist->nr_entries == 1) { | 1642 | if (evlist->nr_entries == 1) { |
1633 | struct perf_evsel *first = list_entry(evlist->entries.next, | 1643 | struct perf_evsel *first = list_entry(evlist->entries.next, |
1634 | struct perf_evsel, node); | 1644 | struct perf_evsel, node); |
1635 | const char *ev_name = perf_evsel__name(first); | 1645 | const char *ev_name = perf_evsel__name(first); |
1636 | return perf_evsel__hists_browse(first, evlist->nr_entries, help, | 1646 | return perf_evsel__hists_browse(first, evlist->nr_entries, help, |
1637 | ev_name, false, hbt); | 1647 | ev_name, false, hbt, env); |
1638 | } | 1648 | } |
1639 | 1649 | ||
1640 | return __perf_evlist__tui_browse_hists(evlist, help, hbt); | 1650 | return __perf_evlist__tui_browse_hists(evlist, help, hbt, env); |
1641 | } | 1651 | } |