linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/2] perf/urgent fixes
@ 2011-03-30  2:29 Arnaldo Carvalho de Melo
  2011-03-30  2:29 ` [PATCH 1/2] perf symbols: Properly align symbol_conf.priv_size Arnaldo Carvalho de Melo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-03-30  2:29 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David S . Miller,
	Frederic Weisbecker, Paul Mackerras, Peter Zijlstra,
	Robert Richter, Stephane Eranian, Arnaldo Carvalho de Melo

Hi Ingo,

        Please consider pulling from:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/urgent

Regards,

- Arnaldo

David S. Miller (1):
  perf symbols: Properly align symbol_conf.priv_size

Robert Richter (1):
  perf tools: Fix NO_NEWT=1 python build error

 tools/perf/Makefile      |    8 ++++++--
 tools/perf/util/setup.py |    7 ++++++-
 tools/perf/util/symbol.c |    2 ++
 3 files changed, 14 insertions(+), 3 deletions(-)


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

* [PATCH 1/2] perf symbols: Properly align symbol_conf.priv_size
  2011-03-30  2:29 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2011-03-30  2:29 ` Arnaldo Carvalho de Melo
  2011-03-30  2:29 ` [PATCH 2/2] perf tools: Fix NO_NEWT=1 python build error Arnaldo Carvalho de Melo
  2011-03-30  7:06 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-03-30  2:29 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, David S. Miller, Ingo Molnar, Paul Mackerras,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: David S. Miller <davem@davemloft.net>

If symbol_conf.priv_size is not a multiple of "sizeof(u64)" we'll bus
error on sparc64 in symbol__new because the "struct symbol *" pointer
is computed by adding symbol_conf.priv_size to the memory allocated.

We cannot isolate the fix to symbol__new and symbol__delete since the
private area is computed by subtracting the priv_size value from a
"struct symbol" pointer, so then the private area can still be
potentially unaligned.

So, simply align the symbol_conf.priv_size value in symbol__init()

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20110328.175849.112593455.davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 8f73907..f06c10f 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -2406,6 +2406,8 @@ int symbol__init(void)
 	if (symbol_conf.initialized)
 		return 0;
 
+	symbol_conf.priv_size = ALIGN(symbol_conf.priv_size, sizeof(u64));
+
 	elf_version(EV_CURRENT);
 	if (symbol_conf.sort_by_name)
 		symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) -
-- 
1.6.2.5


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

* [PATCH 2/2] perf tools: Fix NO_NEWT=1 python build error
  2011-03-30  2:29 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
  2011-03-30  2:29 ` [PATCH 1/2] perf symbols: Properly align symbol_conf.priv_size Arnaldo Carvalho de Melo
@ 2011-03-30  2:29 ` Arnaldo Carvalho de Melo
  2011-03-30  7:06 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-03-30  2:29 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Robert Richter, Frederic Weisbecker, Ingo Molnar,
	Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo

From: Robert Richter <robert.richter@amd.com>

Fix the following build error:

     GEN python/perf.so
 In file included from util/evsel.h:10,
                  from util/python.c:6:
 util/hist.h:106:18: error: newt.h: No such file or directory
 error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
 make: *** [python/perf.so] Error 1

by passing BASIC_CFLAGS to setup.py. BASIC_CFLAGS variable contains
the -DNO_NEWT_SUPPORT switch which prevents building python c
extension with newt.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <20110329180236.GA19366@erda.amd.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile      |    8 ++++++--
 tools/perf/util/setup.py |    7 ++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 158c30e..207dee5 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -165,8 +165,12 @@ grep-libs = $(filter -l%,$(1))
 strip-libs = $(filter-out -l%,$(1))
 
 $(OUTPUT)python/perf.so: $(PYRF_OBJS)
-	$(QUIET_GEN)python util/setup.py --quiet  build_ext --build-lib='$(OUTPUT)python' \
-						--build-temp='$(OUTPUT)python/temp'
+	$(QUIET_GEN)( \
+		export CFLAGS="$(BASIC_CFLAGS)"; \
+		python util/setup.py --quiet  build_ext --build-lib='$(OUTPUT)python' \
+			--build-temp='$(OUTPUT)python/temp' \
+	)
+
 #
 # No Perl scripts right now:
 #
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index e24ffad..bbc982f 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -1,13 +1,18 @@
 #!/usr/bin/python2
 
 from distutils.core import setup, Extension
+from os import getenv
+
+cflags = ['-fno-strict-aliasing', '-Wno-write-strings']
+cflags += getenv('CFLAGS', '').split()
 
 perf = Extension('perf',
 		  sources = ['util/python.c', 'util/ctype.c', 'util/evlist.c',
 			     'util/evsel.c', 'util/cpumap.c', 'util/thread_map.c',
 			     'util/util.c', 'util/xyarray.c', 'util/cgroup.c'],
 		  include_dirs = ['util/include'],
-		  extra_compile_args = ['-fno-strict-aliasing', '-Wno-write-strings'])
+		  extra_compile_args = cflags,
+                 )
 
 setup(name='perf',
       version='0.1',
-- 
1.6.2.5


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

* Re: [GIT PULL 0/2] perf/urgent fixes
  2011-03-30  2:29 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
  2011-03-30  2:29 ` [PATCH 1/2] perf symbols: Properly align symbol_conf.priv_size Arnaldo Carvalho de Melo
  2011-03-30  2:29 ` [PATCH 2/2] perf tools: Fix NO_NEWT=1 python build error Arnaldo Carvalho de Melo
@ 2011-03-30  7:06 ` Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2011-03-30  7:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, David S . Miller, Frederic Weisbecker,
	Paul Mackerras, Peter Zijlstra, Robert Richter, Stephane Eranian,
	Arnaldo Carvalho de Melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
>         Please consider pulling from:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/urgent
> 
> Regards,
> 
> - Arnaldo
> 
> David S. Miller (1):
>   perf symbols: Properly align symbol_conf.priv_size
> 
> Robert Richter (1):
>   perf tools: Fix NO_NEWT=1 python build error
> 
>  tools/perf/Makefile      |    8 ++++++--
>  tools/perf/util/setup.py |    7 ++++++-
>  tools/perf/util/symbol.c |    2 ++
>  3 files changed, 14 insertions(+), 3 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

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

end of thread, other threads:[~2011-03-30  7:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-30  2:29 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
2011-03-30  2:29 ` [PATCH 1/2] perf symbols: Properly align symbol_conf.priv_size Arnaldo Carvalho de Melo
2011-03-30  2:29 ` [PATCH 2/2] perf tools: Fix NO_NEWT=1 python build error Arnaldo Carvalho de Melo
2011-03-30  7:06 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar

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).