diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-04-05 11:33:41 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-05-12 11:26:59 -0300 |
commit | 4924734570a073049450b11f7c59ce5992b03343 (patch) | |
tree | 7fbf3af95e3702b0dca4a0cb213f2ebbba44671f /tools/build/feature/test-dwarf_getlocations.c | |
parent | perf dwarf: Guard !x86_64 definitions under #ifdef else clause (diff) | |
download | linux-dev-4924734570a073049450b11f7c59ce5992b03343.tar.xz linux-dev-4924734570a073049450b11f7c59ce5992b03343.zip |
perf probe: Check if dwarf_getlocations() is available
If not, tell the user that:
config/Makefile:273: Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157
And return -ENOTSUPP in die_get_var_range(), failing features that
need it, like the one pointed out above.
This fixes the build on older systems, such as Ubuntu 12.04.5.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Vinson Lee <vlee@freedesktop.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-9l7luqkq4gfnx7vrklkq4obs@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/build/feature/test-dwarf_getlocations.c')
-rw-r--r-- | tools/build/feature/test-dwarf_getlocations.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/build/feature/test-dwarf_getlocations.c b/tools/build/feature/test-dwarf_getlocations.c new file mode 100644 index 000000000000..70162699dd43 --- /dev/null +++ b/tools/build/feature/test-dwarf_getlocations.c @@ -0,0 +1,12 @@ +#include <stdlib.h> +#include <elfutils/libdw.h> + +int main(void) +{ + Dwarf_Addr base, start, end; + Dwarf_Attribute attr; + Dwarf_Op *op; + size_t nops; + ptrdiff_t offset = 0; + return (int)dwarf_getlocations(&attr, offset, &base, &start, &end, &op, &nops); +} |