LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: fix extern struct definitions
@ 2010-09-20 22:45 Stephane Eranian
  2010-10-04 18:02 ` Arnaldo Carvalho de Melo
  2010-10-05 12:13 ` [tip:perf/core] perf trace scripting: Fix " tip-bot for Stephane Eranian
  0 siblings, 2 replies; 3+ messages in thread
From: Stephane Eranian @ 2010-09-20 22:45 UTC (permalink / raw
  To: linux-kernel
  Cc: peterz, mingo, paulus, davem, fweisbec, perfmon2-devel, eranian,
	eranian, robert.richter, acme

Both python_scripting_ops and perl_scripting_ops have two global definitions.
One in trace-event-scripting.c and one in their respective scripting-engine
modules.

The issue is that depending on the linker order one definition or the other
is chosen. One is uninitialized (bss), while the other is initialized. If
the uninitialized version is chosen, then perf does not function properly.

This patch fixes this by adding the extern prefix to the definitions in
trace-event-scripting.c. 

Signed-off-by: Stephane Eranian <eranian@google.com>

diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 7ea983a..f7af2fc 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -97,7 +97,7 @@ void setup_python_scripting(void)
 	register_python_scripting(&python_scripting_unsupported_ops);
 }
 #else
-struct scripting_ops python_scripting_ops;
+extern struct scripting_ops python_scripting_ops;
 
 void setup_python_scripting(void)
 {
@@ -158,7 +158,7 @@ void setup_perl_scripting(void)
 	register_perl_scripting(&perl_scripting_unsupported_ops);
 }
 #else
-struct scripting_ops perl_scripting_ops;
+extern struct scripting_ops perl_scripting_ops;
 
 void setup_perl_scripting(void)
 {

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

* Re: [PATCH] perf: fix extern struct definitions
  2010-09-20 22:45 [PATCH] perf: fix extern struct definitions Stephane Eranian
@ 2010-10-04 18:02 ` Arnaldo Carvalho de Melo
  2010-10-05 12:13 ` [tip:perf/core] perf trace scripting: Fix " tip-bot for Stephane Eranian
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-10-04 18:02 UTC (permalink / raw
  To: Stephane Eranian
  Cc: linux-kernel, peterz, mingo, paulus, davem, fweisbec,
	perfmon2-devel, eranian, robert.richter

Em Tue, Sep 21, 2010 at 12:45:01AM +0200, Stephane Eranian escreveu:
> Both python_scripting_ops and perl_scripting_ops have two global definitions.
> One in trace-event-scripting.c and one in their respective scripting-engine
> modules.
> 
> The issue is that depending on the linker order one definition or the other
> is chosen. One is uninitialized (bss), while the other is initialized. If
> the uninitialized version is chosen, then perf does not function properly.
> 
> This patch fixes this by adding the extern prefix to the definitions in
> trace-event-scripting.c. 
> 
> Signed-off-by: Stephane Eranian <eranian@google.com>

Thanks, applying to perf/urgent,

- Arnaldo

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

* [tip:perf/core] perf trace scripting: Fix extern struct definitions
  2010-09-20 22:45 [PATCH] perf: fix extern struct definitions Stephane Eranian
  2010-10-04 18:02 ` Arnaldo Carvalho de Melo
@ 2010-10-05 12:13 ` tip-bot for Stephane Eranian
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Stephane Eranian @ 2010-10-05 12:13 UTC (permalink / raw
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, eranian, hpa, mingo, peterz, davem,
	robert.richter, fweisbec, tglx, mingo

Commit-ID:  0f940cb7d970f4fd569bb5f9f49774422f2ccbee
Gitweb:     http://git.kernel.org/tip/0f940cb7d970f4fd569bb5f9f49774422f2ccbee
Author:     Stephane Eranian <eranian@google.com>
AuthorDate: Tue, 21 Sep 2010 00:45:01 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 4 Oct 2010 12:24:51 -0300

perf trace scripting: Fix extern struct definitions

Both python_scripting_ops and perl_scripting_ops have two global definitions.
One in trace-event-scripting.c and one in their respective scripting-engine
modules.

The issue is that depending on the linker order one definition or the other
is chosen. One is uninitialized (bss), while the other is initialized. If
the uninitialized version is chosen, then perf does not function properly.

This patch fixes this by adding the extern prefix to the definitions in
trace-event-scripting.c.

Cc: David S. Miller <davem@davemloft.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <robert.richter@amd.com>
LKML-Reference: <4c97e41a.078fd80a.7a8b.3cc9@mx.google.com>
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/trace-event-scripting.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 7ea983a..f7af2fc 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -97,7 +97,7 @@ void setup_python_scripting(void)
 	register_python_scripting(&python_scripting_unsupported_ops);
 }
 #else
-struct scripting_ops python_scripting_ops;
+extern struct scripting_ops python_scripting_ops;
 
 void setup_python_scripting(void)
 {
@@ -158,7 +158,7 @@ void setup_perl_scripting(void)
 	register_perl_scripting(&perl_scripting_unsupported_ops);
 }
 #else
-struct scripting_ops perl_scripting_ops;
+extern struct scripting_ops perl_scripting_ops;
 
 void setup_perl_scripting(void)
 {

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

end of thread, other threads:[~2010-10-05 12:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20 22:45 [PATCH] perf: fix extern struct definitions Stephane Eranian
2010-10-04 18:02 ` Arnaldo Carvalho de Melo
2010-10-05 12:13 ` [tip:perf/core] perf trace scripting: Fix " tip-bot for Stephane Eranian

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 read-only IMAP folder(s) and NNTP newsgroup(s).