mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexis Berlemont <alexis.berlemont@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Alexis Berlemont <alexis.berlemont@gmail.com>, jolsa@redhat.com
Subject: [PATCH v2 07/14] perf kbuild: remove legacy demangle-related build variables
Date: Thu, 23 Oct 2014 23:56:05 +0200	[thread overview]
Message-ID: <1414101372-14443-8-git-send-email-alexis.berlemont@gmail.com> (raw)
In-Reply-To: <1414101372-14443-1-git-send-email-alexis.berlemont@gmail.com>
In-Reply-To: <54216F39.9030902@suse.cz>

Remove NO_DEMANGLE (replaced by CONFIG_DEMANGLE)
Remove HAVE_LIBBFD_SUPPORT (replaced by CONFIG_LIBBFD)
Remove HAVE_CPLUS_DEMANGLE_SUPPORT (replaced by CONFIG_LIBIBERTY_ONLY)

Signed-off-by: Alexis Berlemont <alexis.berlemont@gmail.com>
---
 tools/perf/Kconfig                    | 36 +++++++++++++++++++++------
 tools/perf/config/Makefile            | 46 ++++++++++++++++++-----------------
 tools/perf/config/Makefile.fix-legacy |  4 ---
 tools/perf/util/srcline.c             |  8 +++---
 tools/perf/util/symbol.h              | 25 +++++++++++++------
 5 files changed, 75 insertions(+), 44 deletions(-)

diff --git a/tools/perf/Kconfig b/tools/perf/Kconfig
index eb59567..026ef67 100644
--- a/tools/perf/Kconfig
+++ b/tools/perf/Kconfig
@@ -225,6 +225,35 @@ config LIBPYTHON
         ---help---
 	  Libpython dependency needed by the perf script feature.
 
+config TIMERFD
+	bool "Timer via file descriptor"
+	default y
+        ---help---
+	  Timer via file descriptor
+
+config DEMANGLE
+	bool "Demangle symbols"
+	default y
+        ---help---
+	  Enable demangling so as to display human-readable
+	  symbols. This option is convenient with C++ programs.
+
+choice DEMANGLE_DEPS
+       prompt "Demangle dependency(ies)"
+       depends on DEMANGLE
+       default LIBBFD
+
+config LIBBFD
+	bool "BFD + libiberty libraries"
+        ---help---
+	  Binary File Descriptor and libiberty libraries
+
+config LIBIBERTY_ONLY
+	bool "Libiberty only"
+        ---help---
+	  Libiberty
+endchoice
+
 choice
 	prompt "Elf library"
 	default LIBELF
@@ -266,13 +295,6 @@ config NUMA
 	  The library libnuma offers facilities to configure NUMA
 	  policies supported by the linux kernel.
 
-config DEMANGLE
-	bool "Demangle symbols"
-	default y
-        ---help---
-	  Enable demangling so as to display human-readable
-	  symbols. This option is convenient with C++ programs.
-
 config BIONIC
 	bool "Bionic support"
 	default n
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 27b092c..ce3a726 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -573,33 +573,36 @@ ifeq ($(feature-libbfd), 1)
   endif
 endif
 
-ifdef NO_DEMANGLE
-  CFLAGS += -DNO_DEMANGLE
-else
-  ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
-    EXTLIBS += -liberty
-    CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
-  else
-    ifneq ($(feature-libbfd), 1)
-      ifneq ($(feature-liberty), 1)
-        ifneq ($(feature-liberty-z), 1)
-          # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
-          # or any of 'bfd iberty z' trinity
-          ifeq ($(feature-cplus-demangle), 1)
-            EXTLIBS += -liberty
-            CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
-          else
-            msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
-            CFLAGS += -DNO_DEMANGLE
-          endif
+ifdef CONFIG_LIBBFD
+  ifneq ($(feature-libbfd), 1)
+    # TODO: there might be an issue here: feature-liberty and
+    # feature-liberty-z cannot be set; they can be set only if
+    # feature-libbfd is set
+    ifneq ($(feature-liberty), 1)
+      ifneq ($(feature-liberty-z), 1)
+        # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
+        # or any of 'bfd iberty z' trinity
+        ifeq ($(feature-cplus-demangle), 1)
+          EXTLIBS += -liberty
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBBFD)
+          $(shell $(KCONFIG_SCRIPT) -e CONFIG_LIBIBERTY_ONLY)
+        else
+          msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+          $(shell $(KCONFIG_SCRIPT) -d CONFIG_DEMANGLE)
         endif
       endif
     endif
   endif
 endif
 
-ifneq ($(filter -lbfd,$(EXTLIBS)),)
-  CFLAGS += -DHAVE_LIBBFD_SUPPORT
+ifdef CONFIG_LIBIBERTY_ONLY
+  $(call feature_check,cplus-demangle)
+  ifeq ($(feature-cplus-demangle), 1)
+    EXTLIBS += -liberty
+  else
+    msg := $(warning No libiberty found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+    $(shell $(KCONFIG_SCRIPT) -d CONFIG_DEMANGLE)
+  endif
 endif
 
 ifndef NO_BACKTRACE
@@ -795,7 +798,6 @@ all:
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_LIBPERL)
 	$(call store,NO_LIBPYTHON)
-	$(call store,NO_DEMANGLE)
 	$(call store,NO_LIBELF)
 	$(call store,NO_LIBUNWIND)
 	$(call store,NO_BACKTRACE)
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index ca219e7..64dbb1a 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -9,10 +9,6 @@ ifndef CONFIG_LIBPYTHON
 NO_LIBPYTHON := 1
 endif
 
-ifndef CONFIG_DEMANGLE
-NO_DEMANGLE := 1
-endif
-
 ifndef CONFIG_LIBELF
 NO_LIBELF := 1
 endif
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index f3e4bc5..38df8f4 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -4,11 +4,13 @@
 
 #include <linux/kernel.h>
 
+#include "generated/autoconf.h"
+
 #include "util/dso.h"
 #include "util/util.h"
 #include "util/debug.h"
 
-#ifdef HAVE_LIBBFD_SUPPORT
+#ifdef CONFIG_LIBBFD
 
 /*
  * Implement addr2line using libbfd.
@@ -189,7 +191,7 @@ void dso__free_a2l(struct dso *dso)
 	dso->a2l = NULL;
 }
 
-#else /* HAVE_LIBBFD_SUPPORT */
+#else /* !CONFIG_LIBBFD */
 
 static int addr2line(const char *dso_name, unsigned long addr,
 		     char **file, unsigned int *line_nr,
@@ -242,7 +244,7 @@ void dso__free_a2l(struct dso *dso __maybe_unused)
 {
 }
 
-#endif /* HAVE_LIBBFD_SUPPORT */
+#endif /* CONFIG_LIBBFD */
 
 /*
  * Number of addr2line failures (without success) before disabling it for that
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index eb2c19b..7e3a003 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -1,6 +1,8 @@
 #ifndef __PERF_SYMBOL
 #define __PERF_SYMBOL 1
 
+#include "generated/autoconf.h"
+
 #include <linux/types.h>
 #include <stdbool.h>
 #include <stdint.h>
@@ -23,26 +25,33 @@
 
 #include "dso.h"
 
-#ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
+#ifdef CONFIG_DEMANGLE
+
+#ifdef CONFIG_LIBBFD
+
+#define PACKAGE 'perf'
+#include <bfd.h>
+
+#elif defined(CONFIG_LIBIBERTY_ONLY)
 extern char *cplus_demangle(const char *, int);
 
 static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i)
 {
 	return cplus_demangle(c, i);
 }
-#else
-#ifdef NO_DEMANGLE
+
+#else /* Unknown dependency */
+#error "Inconsistent demangling configuration"
+#endif
+
+#else /* !CONFIG_DEMANGLE */
 static inline char *bfd_demangle(void __maybe_unused *v,
 				 const char __maybe_unused *c,
 				 int __maybe_unused i)
 {
 	return NULL;
 }
-#else
-#define PACKAGE 'perf'
-#include <bfd.h>
-#endif
-#endif
+#endif /* CONFIG_DEMANGLE */
 
 /*
  * libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
-- 
2.1.1


  parent reply	other threads:[~2014-10-23 22:01 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 21:53 [PATCH 00/15] Kbuild for perf Alexis Berlemont
2014-09-22 21:53 ` [PATCH 01/15] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
2014-09-23 13:01   ` Michal Marek
2014-10-23 21:47     ` Alexis Berlemont
2014-10-23 21:55     ` [PATCH v2 00/14] Kbuild for perf Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 " Alexis Berlemont
2014-10-23 23:48         ` Arnaldo Carvalho de Melo
2014-10-24 12:39           ` Alexis Berlemont
2014-10-24 12:46             ` Arnaldo Carvalho de Melo
2014-10-25 22:20               ` [PATCH v4 " Alexis Berlemont
2014-10-27 22:37                 ` Jiri Olsa
2014-10-28 23:54                   ` Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 01/14] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 02/14] perf tools: Kbuild builtin source related fixies Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 03/14] perf tools: Kbuild " Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 04/14] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
2014-10-29  8:16                 ` Jiri Olsa
2014-10-29 23:05                   ` Alexis Berlemont
2014-10-31  8:34                     ` Jiri Olsa
2014-10-25 22:20               ` [PATCH v4 05/14] perf kbuild: remove Makefile.perf Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 06/14] perf kbuild: remove legacy tui/gui-related build variables Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 07/14] perf kbuild: remove legacy demangle-related " Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 08/14] perf kbuild: cross-compilation variables are now handled in Kconfig Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 09/14] perf kbuild: remove legacy misc build variables Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 10/14] perf kbuild: remove legacy libelf-related " Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 11/14] perf kbuild: remove legacy libdwarf-related " Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 12/14] perf kbuild: remove legacy script-related " Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 13/14] perf kbuild: final cosmetic changes Alexis Berlemont
2014-10-25 22:20               ` [PATCH v4 14/14] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 01/14] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 02/14] perf tools: Kbuild builtin source related fixies Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 03/14] perf tools: Kbuild " Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 04/14] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 05/14] perf kbuild: remove Makefile.perf Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 06/14] perf kbuild: remove legacy tui/gui-related build variables Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 07/14] perf kbuild: remove legacy demangle-related " Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 08/14] perf kbuild: cross-compilation variables are now handled in Kconfig Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 09/14] perf kbuild: remove legacy misc build variables Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 10/14] perf kbuild: remove legacy libelf-related " Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 11/14] perf kbuild: remove legacy libdwarf-related " Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 12/14] perf kbuild: remove legacy script-related " Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 13/14] perf kbuild: final cosmetic changes Alexis Berlemont
2014-10-23 22:28       ` [PATCH v3 14/14] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
2015-05-31 19:22         ` Ulf Magnusson
2014-10-23 21:55     ` [PATCH v2 01/14] kbuild: add support of custom paths for "auto.conf*" files Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 02/14] perf tools: Kbuild builtin source related fixies Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 03/14] perf tools: Kbuild " Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 04/14] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 05/14] perf kbuild: remove Makefile.perf Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 06/14] perf kbuild: remove legacy tui/gui-related build variables Alexis Berlemont
2014-10-23 21:56     ` Alexis Berlemont [this message]
2014-10-23 21:56     ` [PATCH v2 08/14] perf kbuild: cross-compilation variables are now handled in Kconfig Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 09/14] perf kbuild: remove legacy misc build variables Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 10/14] perf kbuild: remove legacy libelf-related " Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 11/14] perf kbuild: remove legacy libdwarf-related " Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 12/14] perf kbuild: remove legacy script-related " Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 13/14] perf kbuild: final cosmetic changes Alexis Berlemont
2014-10-23 21:56     ` [PATCH v2 14/14] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
2014-09-23 13:13   ` [PATCH 01/15] kbuild: add support of custom paths for "auto.conf*" files Michal Marek
2014-10-23 21:44     ` Alexis Berlemont
2014-09-22 21:53 ` [PATCH 02/15] perf tools: Kbuild builtin source related fixies Alexis Berlemont
2014-09-22 21:53 ` [PATCH 03/15] perf tools: Kbuild " Alexis Berlemont
2014-09-22 21:53 ` [PATCH 04/15] perf tools: Add kbuild support into Makefile.kbuild Alexis Berlemont
2014-09-22 21:53 ` [PATCH 05/15] perf kbuild: remove Makefile.perf Alexis Berlemont
2014-09-22 21:53 ` [PATCH 06/15] perf kbuild: remove legacy tui/gui-related build variables Alexis Berlemont
2014-09-22 21:53 ` [PATCH 07/15] perf kbuild: remove legacy demangle-related " Alexis Berlemont
2014-09-22 21:53 ` [PATCH 08/15] perf kbuild: cross-compilation variables are now handled in Kconfig Alexis Berlemont
2014-09-22 21:53 ` [PATCH 09/15] perf kbuild: remove legacy misc build variables Alexis Berlemont
2014-09-22 21:53 ` [PATCH 10/15] perf kbuild: remove legacy libelf-related " Alexis Berlemont
2014-09-22 21:53 ` [PATCH 11/15] perf kbuild: remove legacy libdwarf-related " Alexis Berlemont
2014-09-22 21:53 ` [PATCH 12/15] perf kbuild: remove legacy script-related " Alexis Berlemont
2014-09-22 21:53 ` [PATCH 13/15] perf kbuild: final cosmetic changes Alexis Berlemont
2014-09-22 21:53 ` [PATCH 14/15] perf kbuild: add generated Kconfig build-test cases Alexis Berlemont
2014-09-22 21:53 ` [PATCH 15/15] perf: replace _BSD_SOURCE macro by _DEFAULT_SOURCE Alexis Berlemont
2014-09-28 22:15   ` Aaro Koskinen
2014-10-23 21:52     ` Alexis Berlemont

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414101372-14443-8-git-send-email-alexis.berlemont@gmail.com \
    --to=alexis.berlemont@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®