diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-07-27 11:01:06 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-07-27 11:01:06 +0200 |
commit | e4b3e0694bbc0350251e22abc215a7ff506f9162 (patch) | |
tree | cf7db39821a1e7f7db736019888fec03285fb81c /tools/lib | |
parent | 37e13a1ebe32c4fbfbdb5413f42eb6e71d8b28a4 (diff) | |
parent | 203d8a4aa6edf2c19206316d439ec5dae52ce581 (diff) | |
download | op-kernel-dev-e4b3e0694bbc0350251e22abc215a7ff506f9162.zip op-kernel-dev-e4b3e0694bbc0350251e22abc215a7ff506f9162.tar.gz |
Merge tag 'perf-urgent-for-mingo-20160726' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
- Fix obtaining the 'start' address for a kernel module on s390, where
.text doesn't coincide with the start of the module as reported in
/proc/modules (Song Shan Gong)
- Use official ELF e_machine value for BPF objects generated via perf + LLVM
when specifying BPF scriptlet in 'perf record/trace --event' (Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/bpf/libbpf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 32e6b6b..b699aea 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -37,6 +37,10 @@ #include "libbpf.h" #include "bpf.h" +#ifndef EM_BPF +#define EM_BPF 247 +#endif + #define __printf(a, b) __attribute__((format(printf, a, b))) __printf(1, 2) @@ -439,7 +443,8 @@ static int bpf_object__elf_init(struct bpf_object *obj) } ep = &obj->efile.ehdr; - if ((ep->e_type != ET_REL) || (ep->e_machine != 0)) { + /* Old LLVM set e_machine to EM_NONE */ + if ((ep->e_type != ET_REL) || (ep->e_machine && (ep->e_machine != EM_BPF))) { pr_warning("%s is not an eBPF object file\n", obj->path); err = -LIBBPF_ERRNO__FORMAT; |