All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Revert "perf: hard-code NO_LIBPERL/NO_LIBPYTHON"
  2012-07-03 18:07 [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates tom.zanussi
@ 2012-07-03 18:07 ` tom.zanussi
  2012-07-03 18:07 ` [PATCH 2/4] perf: use pkg-config instead of python-config tom.zanussi
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: tom.zanussi @ 2012-07-03 18:07 UTC (permalink / raw)
  To: yocto, bruce.ashfield

From: Tom Zanussi <tom.zanussi@intel.com>

This reverts commit 7c35c402e5bc2df6907b8f5d8a495dd6937a1b50.

LIBPERL and LIBPYTHON can now be enabled using the 'perf-scripting'
feature.
---
 tools/perf/Makefile |   87 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 85 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index bb1b364..92271d3 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -539,14 +539,97 @@ else
 	endif
 endif
 
-BASIC_CFLAGS += -DNO_LIBPERL
-BASIC_CFLAGS += -DNO_LIBPYTHON
+ifdef NO_LIBPERL
+	BASIC_CFLAGS += -DNO_LIBPERL
+else
+       PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
+       PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
+       PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
+	PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
+	FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
+
+	ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED)),y)
+		BASIC_CFLAGS += -DNO_LIBPERL
+	else
+               ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
+               EXTLIBS += $(PERL_EMBED_LIBADD)
+		LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
+		LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
+	endif
+endif
+
+disable-python = $(eval $(disable-python_code))
+define disable-python_code
+  BASIC_CFLAGS += -DNO_LIBPYTHON
+  $(if $(1),$(warning No $(1) was found))
+  $(warning Python support won't be built)
+endef
 
 override PYTHON := \
   $(call get-executable-or-default,PYTHON,python)
 
 ifndef PYTHON
   $(call disable-python,python interpreter)
+  python-clean :=
+else
+
+  PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+
+  # python extension build directories
+  PYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/
+  PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
+  PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/
+  export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
+
+  python-clean := rm -rf $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so
+
+  ifdef NO_LIBPYTHON
+    $(call disable-python)
+  else
+
+    override PYTHON_CONFIG := \
+      $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
+
+    ifndef PYTHON_CONFIG
+      $(call disable-python,python-config tool)
+    else
+
+      PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
+
+      PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
+      PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
+      PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
+      PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
+      FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
+
+      ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
+        $(call disable-python,Python.h (for Python 2.x))
+      else
+
+        ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED)),y)
+          $(warning Python 3 is not yet supported; please set)
+          $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
+          $(warning If you also have Python 2 installed, then)
+          $(warning try something like:)
+          $(warning $(and ,))
+          $(warning $(and ,)  make PYTHON=python2)
+          $(warning $(and ,))
+          $(warning Otherwise, disable Python support entirely:)
+          $(warning $(and ,))
+          $(warning $(and ,)  make NO_LIBPYTHON=1)
+          $(warning $(and ,))
+          $(error   $(and ,))
+        else
+          ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
+          EXTLIBS += $(PYTHON_EMBED_LIBADD)
+          LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
+          LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
+          LANG_BINDINGS += $(OUTPUT)python/perf.so
+        endif
+
+      endif
+    endif
+  endif
 endif
 
 ifdef NO_DEMANGLE
-- 
1.7.0.4



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

* [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates
@ 2012-07-03 18:07 tom.zanussi
  2012-07-03 18:07 ` [PATCH 1/4] Revert "perf: hard-code NO_LIBPERL/NO_LIBPYTHON" tom.zanussi
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: tom.zanussi @ 2012-07-03 18:07 UTC (permalink / raw)
  To: yocto, bruce.ashfield

From: Tom Zanussi <tom.zanussi@intel.com>

This patchset comprises the kernel side of the modifications needed to
enable the Perl and Python bindings for perf scripting.

Please pull into linux-yocto-3.4 standard/base.

Thanks,

Tom

The following changes since commit a8291fa6f723b0182d2b7033b5d59f412ba7cf72:
  Bruce Ashfield (1):
        yaffs2: update to 2012-05-29 development head

are available in the git repository at:

  git://git.yoctoproject.org/linux-yocto-2.6.37-contrib.git tzanussi/3.4-perf-scripting-standard-base
  http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-2.6.37-contrib/log/?h=tzanussi/3.4-perf-scripting-standard-base

Tom Zanussi (4):
  Revert "perf: hard-code NO_LIBPERL/NO_LIBPYTHON"
  perf: use pkg-config instead of python-config
  perf: add 'libperl not found' warning
  perf: change --root to --prefix for python install

 tools/perf/Makefile |   90 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 87 insertions(+), 3 deletions(-)



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

* [PATCH 2/4] perf: use pkg-config instead of python-config
  2012-07-03 18:07 [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates tom.zanussi
  2012-07-03 18:07 ` [PATCH 1/4] Revert "perf: hard-code NO_LIBPERL/NO_LIBPYTHON" tom.zanussi
@ 2012-07-03 18:07 ` tom.zanussi
  2012-07-03 18:07 ` [PATCH 3/4] perf: add 'libperl not found' warning tom.zanussi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: tom.zanussi @ 2012-07-03 18:07 UTC (permalink / raw)
  To: yocto, bruce.ashfield

From: Tom Zanussi <tom.zanussi@intel.com>

Python has build flags available via pkg-config, use those at
build-time instead.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
 tools/perf/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 92271d3..35425ab 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -596,10 +596,10 @@ else
 
       PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
 
-      PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
+      PYTHON_EMBED_LDOPTS := $(shell pkg-config --libs python 2>/dev/null)
       PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
       PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
-      PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
+      PYTHON_EMBED_CCOPTS := $(shell pkg-config --cflags python 2>/dev/null)
       FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
 
       ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
-- 
1.7.0.4



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

* [PATCH 3/4] perf: add 'libperl not found' warning
  2012-07-03 18:07 [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates tom.zanussi
  2012-07-03 18:07 ` [PATCH 1/4] Revert "perf: hard-code NO_LIBPERL/NO_LIBPYTHON" tom.zanussi
  2012-07-03 18:07 ` [PATCH 2/4] perf: use pkg-config instead of python-config tom.zanussi
@ 2012-07-03 18:07 ` tom.zanussi
  2012-07-03 18:07 ` [PATCH 4/4] perf: change --root to --prefix for python install tom.zanussi
  2012-07-03 19:05 ` [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates Bruce Ashfield
  4 siblings, 0 replies; 7+ messages in thread
From: tom.zanussi @ 2012-07-03 18:07 UTC (permalink / raw)
  To: yocto, bruce.ashfield

From: Tom Zanussi <tom.zanussi@intel.com>

If libperl isn't found, display a message to that effect along with
some hints on how to fix it.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
 tools/perf/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 35425ab..f966313 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -549,6 +549,7 @@ else
 	FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
 
 	ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED)),y)
+		msg := $(warning libperl not found, disables Perl scripting support. Please install libperl-dev or perl-devel);
 		BASIC_CFLAGS += -DNO_LIBPERL
 	else
                ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
-- 
1.7.0.4



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

* [PATCH 4/4] perf: change --root to --prefix for python install
  2012-07-03 18:07 [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates tom.zanussi
                   ` (2 preceding siblings ...)
  2012-07-03 18:07 ` [PATCH 3/4] perf: add 'libperl not found' warning tom.zanussi
@ 2012-07-03 18:07 ` tom.zanussi
  2012-07-03 19:05 ` [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates Bruce Ashfield
  4 siblings, 0 replies; 7+ messages in thread
From: tom.zanussi @ 2012-07-03 18:07 UTC (permalink / raw)
  To: yocto, bruce.ashfield

From: Tom Zanussi <tom.zanussi@intel.com>

Otherwise we get the sysroot path appended to the build path, not what
we want.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
 tools/perf/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index f966313..15ec207 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -954,7 +954,7 @@ install: all
 	$(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'
 
 install-python_ext:
-	$(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
+	$(PYTHON_WORD) util/setup.py --quiet install --prefix='$(DESTDIR_SQ)/usr'
 
 install-doc:
 	$(MAKE) -C Documentation install
-- 
1.7.0.4



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

* Re: [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates
  2012-07-03 18:07 [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates tom.zanussi
                   ` (3 preceding siblings ...)
  2012-07-03 18:07 ` [PATCH 4/4] perf: change --root to --prefix for python install tom.zanussi
@ 2012-07-03 19:05 ` Bruce Ashfield
  2012-07-03 19:10   ` Tom Zanussi
  4 siblings, 1 reply; 7+ messages in thread
From: Bruce Ashfield @ 2012-07-03 19:05 UTC (permalink / raw)
  To: tom.zanussi; +Cc: yocto

On 12-07-03 02:07 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi<tom.zanussi@intel.com>
>
> This patchset comprises the kernel side of the modifications needed to
> enable the Perl and Python bindings for perf scripting.

Looks good to me, I'm happy to finally revert the no_perl patch :)
I assume that you verified everything happily builds with and
without the perf-scripting being available ?

Cheers,

Bruce



>
> Please pull into linux-yocto-3.4 standard/base.
>
> Thanks,
>
> Tom
>
> The following changes since commit a8291fa6f723b0182d2b7033b5d59f412ba7cf72:
>    Bruce Ashfield (1):
>          yaffs2: update to 2012-05-29 development head
>
> are available in the git repository at:
>
>    git://git.yoctoproject.org/linux-yocto-2.6.37-contrib.git tzanussi/3.4-perf-scripting-standard-base
>    http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-2.6.37-contrib/log/?h=tzanussi/3.4-perf-scripting-standard-base
>
> Tom Zanussi (4):
>    Revert "perf: hard-code NO_LIBPERL/NO_LIBPYTHON"
>    perf: use pkg-config instead of python-config
>    perf: add 'libperl not found' warning
>    perf: change --root to --prefix for python install
>
>   tools/perf/Makefile |   90 +++++++++++++++++++++++++++++++++++++++++++++++++--
>   1 files changed, 87 insertions(+), 3 deletions(-)
>



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

* Re: [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates
  2012-07-03 19:05 ` [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates Bruce Ashfield
@ 2012-07-03 19:10   ` Tom Zanussi
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Zanussi @ 2012-07-03 19:10 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: yocto

On Tue, 2012-07-03 at 15:05 -0400, Bruce Ashfield wrote:
> On 12-07-03 02:07 PM, tom.zanussi@intel.com wrote:
> > From: Tom Zanussi<tom.zanussi@intel.com>
> >
> > This patchset comprises the kernel side of the modifications needed to
> > enable the Perl and Python bindings for perf scripting.
> 
> Looks good to me, I'm happy to finally revert the no_perl patch :)
> I assume that you verified everything happily builds with and
> without the perf-scripting being available ?
> 

Yeah, I built and run-tested several different machines with and without
perf-scripting and perf-tui and didn't see any problems...

Tom

> Cheers,
> 
> Bruce
> 
> 
> 
> >
> > Please pull into linux-yocto-3.4 standard/base.
> >
> > Thanks,
> >
> > Tom
> >
> > The following changes since commit a8291fa6f723b0182d2b7033b5d59f412ba7cf72:
> >    Bruce Ashfield (1):
> >          yaffs2: update to 2012-05-29 development head
> >
> > are available in the git repository at:
> >
> >    git://git.yoctoproject.org/linux-yocto-2.6.37-contrib.git tzanussi/3.4-perf-scripting-standard-base
> >    http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-2.6.37-contrib/log/?h=tzanussi/3.4-perf-scripting-standard-base
> >
> > Tom Zanussi (4):
> >    Revert "perf: hard-code NO_LIBPERL/NO_LIBPYTHON"
> >    perf: use pkg-config instead of python-config
> >    perf: add 'libperl not found' warning
> >    perf: change --root to --prefix for python install
> >
> >   tools/perf/Makefile |   90 +++++++++++++++++++++++++++++++++++++++++++++++++--
> >   1 files changed, 87 insertions(+), 3 deletions(-)
> >
> 




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

end of thread, other threads:[~2012-07-03 19:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-03 18:07 [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates tom.zanussi
2012-07-03 18:07 ` [PATCH 1/4] Revert "perf: hard-code NO_LIBPERL/NO_LIBPYTHON" tom.zanussi
2012-07-03 18:07 ` [PATCH 2/4] perf: use pkg-config instead of python-config tom.zanussi
2012-07-03 18:07 ` [PATCH 3/4] perf: add 'libperl not found' warning tom.zanussi
2012-07-03 18:07 ` [PATCH 4/4] perf: change --root to --prefix for python install tom.zanussi
2012-07-03 19:05 ` [PATCH 0/4] linux-yocto-3.4/standard/base: perf scripting updates Bruce Ashfield
2012-07-03 19:10   ` Tom Zanussi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.