Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf unwind: Separate local/remote libunwind config

CONFIG_LIBUNWIND/NO_LIBUNWIND are changed to CONFIG_LOCAL_LIBUNWIND/
NO_LOCAL_LIBUNWIND for retaining local unwind features. The new
CONFIG_LIBUNWIND stands for either local or remote or both unwind are
supported, and NO_LIBUNWIND means that neither local nor remote unwind
is supported.

LIBUNWIND_LIBS is eliminated in LDFLAGS if local libunwind is not
supported.

Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1464924803-22214-7-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

He Kuang and committed by
Arnaldo Carvalho de Melo
9d8e14d3 403cacb8

+20 -6
+1 -1
tools/perf/arch/arm/util/Build
··· 1 1 libperf-$(CONFIG_DWARF) += dwarf-regs.o 2 2 3 - libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o 3 + libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o 4 4 libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
+1 -1
tools/perf/arch/arm64/util/Build
··· 1 1 libperf-$(CONFIG_DWARF) += dwarf-regs.o 2 - libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o 2 + libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
+1 -1
tools/perf/arch/x86/util/Build
··· 8 8 libperf-$(CONFIG_DWARF) += dwarf-regs.o 9 9 libperf-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o 10 10 11 - libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o 11 + libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o 12 12 libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o 13 13 14 14 libperf-$(CONFIG_AUXTRACE) += auxtrace.o
+17 -3
tools/perf/config/Makefile
··· 353 353 endif 354 354 355 355 ifndef NO_LIBUNWIND 356 + have_libunwind := 356 357 ifneq ($(feature-libunwind), 1) 357 358 msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR); 359 + NO_LOCAL_LIBUNWIND := 1 360 + else 361 + have_libunwind := 1 362 + $(call detected,CONFIG_LOCAL_LIBUNWIND) 363 + endif 364 + 365 + ifneq ($(have_libunwind), 1) 358 366 NO_LIBUNWIND := 1 359 367 endif 368 + else 369 + NO_LOCAL_LIBUNWIND := 1 360 370 endif 361 371 362 372 ifndef NO_LIBBPF ··· 404 394 NO_DWARF_UNWIND := 1 405 395 endif 406 396 407 - ifndef NO_LIBUNWIND 397 + ifndef NO_LOCAL_LIBUNWIND 408 398 ifeq ($(ARCH),$(filter $(ARCH),arm arm64)) 409 399 $(call feature_check,libunwind-debug-frame) 410 400 ifneq ($(feature-libunwind-debug-frame), 1) ··· 415 405 # non-ARM has no dwarf_find_debug_frame() function: 416 406 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME 417 407 endif 418 - CFLAGS += -DHAVE_LIBUNWIND_SUPPORT 419 408 EXTLIBS += $(LIBUNWIND_LIBS) 409 + LDFLAGS += $(LIBUNWIND_LIBS) 410 + endif 411 + 412 + ifndef NO_LIBUNWIND 413 + CFLAGS += -DHAVE_LIBUNWIND_SUPPORT 420 414 CFLAGS += $(LIBUNWIND_CFLAGS) 421 - LDFLAGS += $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS) 415 + LDFLAGS += $(LIBUNWIND_LDFLAGS) 422 416 endif 423 417 424 418 ifndef NO_LIBAUDIT