linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] perf: Remove hardcoded include paths for elfutils
@ 2010-11-16 22:16 Robert Morell
  2010-11-17  2:11 ` Masami Hiramatsu
  2010-11-21 13:43 ` [tip:perf/core] perf tools: " tip-bot for Robert Morell
  0 siblings, 2 replies; 4+ messages in thread
From: Robert Morell @ 2010-11-16 22:16 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Masami Hiramatsu
  Cc: linux-kernel, Robert Morell

This change removes the use of hardcoded absolute
"/usr/include/elfutils" paths from the perf build.  The problem with
hardcoded paths is that it prevents them from being overridden by
$prefix or by -I in CFLAGS (e.g., for cross-compiling purposes).

Instead, just include the "elfutils/" subdirectory as a relative path
when files are needed from that directory.

Tested by building perf:
- Cross-compiled for ARM on x86_64
- Built natively on x86_64
- Built on x86_64 with /usr/include/elfutils moved to another location
  and manually included in CFLAGS

Signed-off-by: Robert Morell <rmorell@nvidia.com>
---
 tools/perf/Makefile            |    4 ++--
 tools/perf/feature-tests.mak   |    4 ++--
 tools/perf/util/probe-finder.h |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index d1db0f6..74b684d 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -507,7 +507,7 @@ PERFLIBS = $(LIB_FILE)
 -include config.mak
 
 ifndef NO_DWARF
-FLAGS_DWARF=$(ALL_CFLAGS) -I/usr/include/elfutils -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
+FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y)
 	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
@@ -554,7 +554,7 @@ ifndef NO_DWARF
 ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
 	msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
 else
-	BASIC_CFLAGS += -I/usr/include/elfutils -DDWARF_SUPPORT
+	BASIC_CFLAGS += -DDWARF_SUPPORT
 	EXTLIBS += -lelf -ldw
 	LIB_OBJS += $(OUTPUT)util/probe-finder.o
 endif # PERF_HAVE_DWARF_REGS
diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
index b253db6..b041ca6 100644
--- a/tools/perf/feature-tests.mak
+++ b/tools/perf/feature-tests.mak
@@ -9,8 +9,8 @@ endef
 ifndef NO_DWARF
 define SOURCE_DWARF
 #include <dwarf.h>
-#include <libdw.h>
-#include <version.h>
+#include <elfutils/libdw.h>
+#include <elfutils/version.h>
 #ifndef _ELFUTILS_PREREQ
 #error
 #endif
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index bba69d4..beaefc3 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -34,9 +34,9 @@ extern int find_available_vars_at(int fd, struct perf_probe_event *pev,
 				  bool externs);
 
 #include <dwarf.h>
-#include <libdw.h>
-#include <libdwfl.h>
-#include <version.h>
+#include <elfutils/libdw.h>
+#include <elfutils/libdwfl.h>
+#include <elfutils/version.h>
 
 struct probe_finder {
 	struct perf_probe_event	*pev;		/* Target probe event */
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] perf: Remove hardcoded include paths for elfutils
  2010-11-16 22:16 [PATCH RESEND] perf: Remove hardcoded include paths for elfutils Robert Morell
@ 2010-11-17  2:11 ` Masami Hiramatsu
  2010-11-19 18:44   ` Arnaldo Carvalho de Melo
  2010-11-21 13:43 ` [tip:perf/core] perf tools: " tip-bot for Robert Morell
  1 sibling, 1 reply; 4+ messages in thread
From: Masami Hiramatsu @ 2010-11-17  2:11 UTC (permalink / raw)
  To: Robert Morell
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, linux-kernel

(2010/11/17 7:16), Robert Morell wrote:
> This change removes the use of hardcoded absolute
> "/usr/include/elfutils" paths from the perf build.  The problem with
> hardcoded paths is that it prevents them from being overridden by
> $prefix or by -I in CFLAGS (e.g., for cross-compiling purposes).
> 
> Instead, just include the "elfutils/" subdirectory as a relative path
> when files are needed from that directory.

Looks good to me, Thanks!

> 
> Tested by building perf:
> - Cross-compiled for ARM on x86_64
> - Built natively on x86_64
> - Built on x86_64 with /usr/include/elfutils moved to another location
>   and manually included in CFLAGS
> 
> Signed-off-by: Robert Morell <rmorell@nvidia.com>

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

> ---
>  tools/perf/Makefile            |    4 ++--
>  tools/perf/feature-tests.mak   |    4 ++--
>  tools/perf/util/probe-finder.h |    6 +++---
>  3 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index d1db0f6..74b684d 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -507,7 +507,7 @@ PERFLIBS = $(LIB_FILE)
>  -include config.mak
>  
>  ifndef NO_DWARF
> -FLAGS_DWARF=$(ALL_CFLAGS) -I/usr/include/elfutils -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
> +FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
>  ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y)
>  	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
> @@ -554,7 +554,7 @@ ifndef NO_DWARF
>  ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
>  	msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
>  else
> -	BASIC_CFLAGS += -I/usr/include/elfutils -DDWARF_SUPPORT
> +	BASIC_CFLAGS += -DDWARF_SUPPORT
>  	EXTLIBS += -lelf -ldw
>  	LIB_OBJS += $(OUTPUT)util/probe-finder.o
>  endif # PERF_HAVE_DWARF_REGS
> diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
> index b253db6..b041ca6 100644
> --- a/tools/perf/feature-tests.mak
> +++ b/tools/perf/feature-tests.mak
> @@ -9,8 +9,8 @@ endef
>  ifndef NO_DWARF
>  define SOURCE_DWARF
>  #include <dwarf.h>
> -#include <libdw.h>
> -#include <version.h>
> +#include <elfutils/libdw.h>
> +#include <elfutils/version.h>
>  #ifndef _ELFUTILS_PREREQ
>  #error
>  #endif
> diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
> index bba69d4..beaefc3 100644
> --- a/tools/perf/util/probe-finder.h
> +++ b/tools/perf/util/probe-finder.h
> @@ -34,9 +34,9 @@ extern int find_available_vars_at(int fd, struct perf_probe_event *pev,
>  				  bool externs);
>  
>  #include <dwarf.h>
> -#include <libdw.h>
> -#include <libdwfl.h>
> -#include <version.h>
> +#include <elfutils/libdw.h>
> +#include <elfutils/libdwfl.h>
> +#include <elfutils/version.h>
>  
>  struct probe_finder {
>  	struct perf_probe_event	*pev;		/* Target probe event */


-- 
Masami HIRAMATSU
2nd Dept. Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] perf: Remove hardcoded include paths for elfutils
  2010-11-17  2:11 ` Masami Hiramatsu
@ 2010-11-19 18:44   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-11-19 18:44 UTC (permalink / raw)
  To: Robert Morell
  Cc: Masami Hiramatsu, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	linux-kernel

Em Wed, Nov 17, 2010 at 11:11:15AM +0900, Masami Hiramatsu escreveu:
> (2010/11/17 7:16), Robert Morell wrote:
> > This change removes the use of hardcoded absolute
> > "/usr/include/elfutils" paths from the perf build.  The problem with
> > hardcoded paths is that it prevents them from being overridden by
> > $prefix or by -I in CFLAGS (e.g., for cross-compiling purposes).
> > 
> > Instead, just include the "elfutils/" subdirectory as a relative path
> > when files are needed from that directory.
> 
> Looks good to me, Thanks!
> 
> > 
> > Tested by building perf:
> > - Cross-compiled for ARM on x86_64
> > - Built natively on x86_64
> > - Built on x86_64 with /usr/include/elfutils moved to another location
> >   and manually included in CFLAGS
> > 
> > Signed-off-by: Robert Morell <rmorell@nvidia.com>
> 
> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Thanks, applied,

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:perf/core] perf tools: Remove hardcoded include paths for elfutils
  2010-11-16 22:16 [PATCH RESEND] perf: Remove hardcoded include paths for elfutils Robert Morell
  2010-11-17  2:11 ` Masami Hiramatsu
@ 2010-11-21 13:43 ` tip-bot for Robert Morell
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Robert Morell @ 2010-11-21 13:43 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra,
	masami.hiramatsu.pt, tglx, rmorell, mingo

Commit-ID:  a71123977eb3c72dd5a8bac723b13faf9cdd2828
Gitweb:     http://git.kernel.org/tip/a71123977eb3c72dd5a8bac723b13faf9cdd2828
Author:     Robert Morell <rmorell@nvidia.com>
AuthorDate: Tue, 16 Nov 2010 14:16:33 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 19 Nov 2010 16:38:04 -0200

perf tools: Remove hardcoded include paths for elfutils

This change removes the use of hardcoded absolute "/usr/include/elfutils" paths
from the perf build.  The problem with hardcoded paths is that it prevents them
from being overridden by $prefix or by -I in CFLAGS (e.g., for cross-compiling
purposes).

Instead, just include the "elfutils/" subdirectory as a relative path when
files are needed from that directory.

Tested by building perf:
- Cross-compiled for ARM on x86_64
- Built natively on x86_64
- Built on x86_64 with /usr/include/elfutils moved to another location
  and manually included in CFLAGS

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
LKML-Reference: <1289945793-31441-1-git-send-email-rmorell@nvidia.com>
Signed-off-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile            |    4 ++--
 tools/perf/feature-tests.mak   |    4 ++--
 tools/perf/util/probe-finder.h |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index d1db0f6..74b684d 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -507,7 +507,7 @@ PERFLIBS = $(LIB_FILE)
 -include config.mak
 
 ifndef NO_DWARF
-FLAGS_DWARF=$(ALL_CFLAGS) -I/usr/include/elfutils -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
+FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y)
 	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
@@ -554,7 +554,7 @@ ifndef NO_DWARF
 ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
 	msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
 else
-	BASIC_CFLAGS += -I/usr/include/elfutils -DDWARF_SUPPORT
+	BASIC_CFLAGS += -DDWARF_SUPPORT
 	EXTLIBS += -lelf -ldw
 	LIB_OBJS += $(OUTPUT)util/probe-finder.o
 endif # PERF_HAVE_DWARF_REGS
diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
index b253db6..b041ca6 100644
--- a/tools/perf/feature-tests.mak
+++ b/tools/perf/feature-tests.mak
@@ -9,8 +9,8 @@ endef
 ifndef NO_DWARF
 define SOURCE_DWARF
 #include <dwarf.h>
-#include <libdw.h>
-#include <version.h>
+#include <elfutils/libdw.h>
+#include <elfutils/version.h>
 #ifndef _ELFUTILS_PREREQ
 #error
 #endif
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index bba69d4..beaefc3 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -34,9 +34,9 @@ extern int find_available_vars_at(int fd, struct perf_probe_event *pev,
 				  bool externs);
 
 #include <dwarf.h>
-#include <libdw.h>
-#include <libdwfl.h>
-#include <version.h>
+#include <elfutils/libdw.h>
+#include <elfutils/libdwfl.h>
+#include <elfutils/version.h>
 
 struct probe_finder {
 	struct perf_probe_event	*pev;		/* Target probe event */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-21 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-16 22:16 [PATCH RESEND] perf: Remove hardcoded include paths for elfutils Robert Morell
2010-11-17  2:11 ` Masami Hiramatsu
2010-11-19 18:44   ` Arnaldo Carvalho de Melo
2010-11-21 13:43 ` [tip:perf/core] perf tools: " tip-bot for Robert Morell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).