diff options
| -rw-r--r-- | tools/perf/arch/powerpc/util/sym-handling.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c index 1030a6e504bb..39dbe512b9fc 100644 --- a/tools/perf/arch/powerpc/util/sym-handling.c +++ b/tools/perf/arch/powerpc/util/sym-handling.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include "symbol.h" | 10 | #include "symbol.h" |
| 11 | #include "map.h" | 11 | #include "map.h" |
| 12 | #include "probe-event.h" | 12 | #include "probe-event.h" |
| 13 | #include "probe-file.h" | ||
| 13 | 14 | ||
| 14 | #ifdef HAVE_LIBELF_SUPPORT | 15 | #ifdef HAVE_LIBELF_SUPPORT |
| 15 | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) | 16 | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) |
| @@ -79,13 +80,18 @@ void arch__fix_tev_from_maps(struct perf_probe_event *pev, | |||
| 79 | * However, if the user specifies an offset, we fall back to using the | 80 | * However, if the user specifies an offset, we fall back to using the |
| 80 | * GEP since all userspace applications (objdump/readelf) show function | 81 | * GEP since all userspace applications (objdump/readelf) show function |
| 81 | * disassembly with offsets from the GEP. | 82 | * disassembly with offsets from the GEP. |
| 82 | * | ||
| 83 | * In addition, we shouldn't specify an offset for kretprobes. | ||
| 84 | */ | 83 | */ |
| 85 | if (pev->point.offset || (!pev->uprobes && pev->point.retprobe) || | 84 | if (pev->point.offset || !map || !sym) |
| 86 | !map || !sym) | ||
| 87 | return; | 85 | return; |
| 88 | 86 | ||
| 87 | /* For kretprobes, add an offset only if the kernel supports it */ | ||
| 88 | if (!pev->uprobes && pev->point.retprobe) { | ||
| 89 | #ifdef HAVE_LIBELF_SUPPORT | ||
| 90 | if (!kretprobe_offset_is_supported()) | ||
| 91 | #endif | ||
| 92 | return; | ||
| 93 | } | ||
| 94 | |||
| 89 | lep_offset = PPC64_LOCAL_ENTRY_OFFSET(sym->arch_sym); | 95 | lep_offset = PPC64_LOCAL_ENTRY_OFFSET(sym->arch_sym); |
| 90 | 96 | ||
| 91 | if (map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS) | 97 | if (map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS) |
