Skip to content

Commit

Permalink
perf trace scripting: Fix extern struct definitions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Robert Richter <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Stephane Eranian <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
Stephane Eranian authored and acmel committed Oct 4, 2010
1 parent c569d33 commit 0f940cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/perf/util/trace-event-scripting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 0f940cb

Please sign in to comment.