aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-11-09 12:27:15 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-11-09 14:23:21 -0500
commit32ae1efd9d40645601cd4e09fa83a2711dd1ad6d (patch)
treebfe73fa1fb41d7d72ce593829cf36d88518de5e5 /tools/perf
parent2ba34aaa6db8b61cf1fa14132f885ba6bc7c9ae0 (diff)
perf annotate: Don't try to follow jump target on PLT symbols
The perf annotate browser on TUI can identify a jump target for a selected instruction. It assumes that the jump target is within the function but it's not the case of PLT symbols which have offset out of the function as a target. Since it caused a segmentation fault, do not try to follow jump target on the PLT symbols. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1352482044-3443-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/ui/browsers/annotate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 3eff17f703f3..5dab3ca96980 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -188,6 +188,12 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
188 struct disasm_line *cursor = ab->selection, *target; 188 struct disasm_line *cursor = ab->selection, *target;
189 struct browser_disasm_line *btarget, *bcursor; 189 struct browser_disasm_line *btarget, *bcursor;
190 unsigned int from, to; 190 unsigned int from, to;
191 struct map_symbol *ms = ab->b.priv;
192 struct symbol *sym = ms->sym;
193
194 /* PLT symbols contain external offsets */
195 if (strstr(sym->name, "@plt"))
196 return;
191 197
192 if (!cursor || !cursor->ins || !ins__is_jump(cursor->ins) || 198 if (!cursor || !cursor->ins || !ins__is_jump(cursor->ins) ||
193 !disasm_line__has_offset(cursor)) 199 !disasm_line__has_offset(cursor))
@@ -771,6 +777,12 @@ static void annotate_browser__mark_jump_targets(struct annotate_browser *browser
771 size_t size) 777 size_t size)
772{ 778{
773 u64 offset; 779 u64 offset;
780 struct map_symbol *ms = browser->b.priv;
781 struct symbol *sym = ms->sym;
782
783 /* PLT symbols contain external offsets */
784 if (strstr(sym->name, "@plt"))
785 return;
774 786
775 for (offset = 0; offset < size; ++offset) { 787 for (offset = 0; offset < size; ++offset) {
776 struct disasm_line *dl = browser->offsets[offset], *dlt; 788 struct disasm_line *dl = browser->offsets[offset], *dlt;