Skip to content

Commit 0f940cb

Browse files
Stephane Eranianacmel
authored andcommitted
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>
1 parent c569d33 commit 0f940cb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tools/perf/util/trace-event-scripting.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void setup_python_scripting(void)
9797
register_python_scripting(&python_scripting_unsupported_ops);
9898
}
9999
#else
100-
struct scripting_ops python_scripting_ops;
100+
extern struct scripting_ops python_scripting_ops;
101101

102102
void setup_python_scripting(void)
103103
{
@@ -158,7 +158,7 @@ void setup_perl_scripting(void)
158158
register_perl_scripting(&perl_scripting_unsupported_ops);
159159
}
160160
#else
161-
struct scripting_ops perl_scripting_ops;
161+
extern struct scripting_ops perl_scripting_ops;
162162

163163
void setup_perl_scripting(void)
164164
{

0 commit comments

Comments
 (0)