mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Vinson Lee <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
d8e28654f2
commit
bd0419e2a5
6 changed files with 38 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ endef
|
|||
FEATURE_TESTS_BASIC := \
|
||||
backtrace \
|
||||
dwarf \
|
||||
dwarf_getlocations \
|
||||
fortify-source \
|
||||
sync-compare-and-swap \
|
||||
glibc \
|
||||
|
|
@ -78,6 +79,7 @@ endif
|
|||
|
||||
FEATURE_DISPLAY ?= \
|
||||
dwarf \
|
||||
dwarf_getlocations \
|
||||
glibc \
|
||||
gtk2 \
|
||||
libaudit \
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ FILES= \
|
|||
test-backtrace.bin \
|
||||
test-bionic.bin \
|
||||
test-dwarf.bin \
|
||||
test-dwarf_getlocations.bin \
|
||||
test-fortify-source.bin \
|
||||
test-sync-compare-and-swap.bin \
|
||||
test-glibc.bin \
|
||||
|
|
@ -82,6 +83,9 @@ endif
|
|||
$(OUTPUT)test-dwarf.bin:
|
||||
$(BUILD) $(DWARFLIBS)
|
||||
|
||||
$(OUTPUT)test-dwarf_getlocations.bin:
|
||||
$(BUILD) $(DWARFLIBS)
|
||||
|
||||
$(OUTPUT)test-libelf-mmap.bin:
|
||||
$(BUILD) -lelf
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@
|
|||
# include "test-dwarf.c"
|
||||
#undef main
|
||||
|
||||
#define main main_test_dwarf_getlocations
|
||||
# include "test-dwarf_getlocations.c"
|
||||
#undef main
|
||||
|
||||
#define main main_test_libelf_getphdrnum
|
||||
# include "test-libelf-getphdrnum.c"
|
||||
#undef main
|
||||
|
|
@ -143,6 +147,7 @@ int main(int argc, char *argv[])
|
|||
main_test_libelf_mmap();
|
||||
main_test_glibc();
|
||||
main_test_dwarf();
|
||||
main_test_dwarf_getlocations();
|
||||
main_test_libelf_getphdrnum();
|
||||
main_test_libunwind();
|
||||
main_test_libaudit();
|
||||
|
|
|
|||
12
tools/build/feature/test-dwarf_getlocations.c
Normal file
12
tools/build/feature/test-dwarf_getlocations.c
Normal file
|
|
@ -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);
|
||||
}
|
||||
Loading…
Reference in a new issue