mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -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
62aa0e177d
commit
4924734570
6 changed files with 38 additions and 0 deletions
|
|
@ -268,6 +268,12 @@ else
|
|||
ifneq ($(feature-dwarf), 1)
|
||||
msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
|
||||
NO_DWARF := 1
|
||||
else
|
||||
ifneq ($(feature-dwarf_getlocations), 1)
|
||||
msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
|
||||
else
|
||||
CFLAGS += -DHAVE_DWARF_GETLOCATIONS
|
||||
endif # dwarf_getlocations
|
||||
endif # Dwarf support
|
||||
endif # libelf support
|
||||
endif # NO_LIBELF
|
||||
|
|
|
|||
|
|
@ -959,6 +959,7 @@ int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_DWARF_GETLOCATIONS
|
||||
/**
|
||||
* die_get_var_innermost_scope - Get innermost scope range of given variable DIE
|
||||
* @sp_die: a subprogram DIE
|
||||
|
|
@ -1080,3 +1081,11 @@ int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf)
|
|||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
int die_get_var_range(Dwarf_Die *sp_die __maybe_unused,
|
||||
Dwarf_Die *vr_die __maybe_unused,
|
||||
struct strbuf *buf __maybe_unused)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue