aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/trace-event-scripting.c
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2010-09-20 18:45:01 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-10-04 11:24:51 -0400
commit0f940cb7d970f4fd569bb5f9f49774422f2ccbee (patch)
tree9817e433fede031b46ec7640ac3449c63e15dc31 /tools/perf/util/trace-event-scripting.c
parentc569d3326bca6774f6c23f1dc91acad5400b6409 (diff)
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>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
-rw-r--r--tools/perf/util/trace-event-scripting.c4
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 7ea983acfaea..f7af2fca965d 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)
97 register_python_scripting(&python_scripting_unsupported_ops); 97 register_python_scripting(&python_scripting_unsupported_ops);
98} 98}
99#else 99#else
100struct scripting_ops python_scripting_ops; 100extern struct scripting_ops python_scripting_ops;
101 101
102void setup_python_scripting(void) 102void setup_python_scripting(void)
103{ 103{
@@ -158,7 +158,7 @@ void setup_perl_scripting(void)
158 register_perl_scripting(&perl_scripting_unsupported_ops); 158 register_perl_scripting(&perl_scripting_unsupported_ops);
159} 159}
160#else 160#else
161struct scripting_ops perl_scripting_ops; 161extern struct scripting_ops perl_scripting_ops;
162 162
163void setup_perl_scripting(void) 163void setup_perl_scripting(void)
164{ 164{