From: Masami Hiramatsu Date: Sat, 17 Oct 2009 00:07:52 +0000 (-0400) Subject: perf: Check libdwarf APIs for perf probe X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4c20194c2de151bca14224ae384b47abf7636a95;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git perf: Check libdwarf APIs for perf probe Check libdwarf APIs for perf probe in tools/perf/Makefile. Since dwarf_get_ranges() has been added from libdwarf 20081231 (and it's the newest function used in probe-finder.c), this just checks whether the function is defined. Signed-off-by: Masami Hiramatsu Cc: Frederic Weisbecker Cc: Arnaldo Carvalho de Melo Cc: Steven Rostedt Cc: Paul Mackerras Cc: Peter Zijlstra LKML-Reference: <20091017000752.16556.92051.stgit@dhcp-100-2-132.bos.redhat.com> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 52b1f438e71a..03c27b9068aa 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -420,8 +420,8 @@ ifneq ($(shell sh -c "(echo '\#include '; echo 'int main(void) { Elf * msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel); endif -ifneq ($(shell sh -c "(echo '\#include '; echo '\#include '; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) - msg := $(warning No libdwarf.h found, disables dwarf support. Please install libdwarf-dev/libdwarf-devel); +ifneq ($(shell sh -c "(echo '\#include '; echo '\#include '; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) + msg := $(warning No libdwarf.h found or old libdwarf.h found, disables dwarf support. Please install libdwarf-dev/libdwarf-devel >= 20081231); BASIC_CFLAGS += -DNO_LIBDWARF else EXTLIBS += -lelf -ldwarf