diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2008-10-23 09:32:57 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-23 09:58:19 -0400 |
commit | dce9d18adde74b8e36b9e4a8a49ddf066bad0b3b (patch) | |
tree | 0d1a5fc1690808ed8184fd64798a65cc5c656585 /scripts/recordmcount.pl | |
parent | 6ae2a0765ab764da11cc305058ee5333810228f4 (diff) |
ftrace: handle generic arch calls
The recordmcount script requires that the actual arch is passed in.
This works well when ARCH=i386 or ARCH=x86_64 but does not handle the
case of ARCH=x86.
This patch adds a parameter to the function to pass in the number of
bits of the architecture. So that it can determine if x86 should be
run for x86_64 or i386 archs.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'scripts/recordmcount.pl')
-rwxr-xr-x | scripts/recordmcount.pl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index f56d760bd589..c1c618cd96f6 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -106,7 +106,8 @@ if ($#ARGV < 6) { | |||
106 | exit(1); | 106 | exit(1); |
107 | } | 107 | } |
108 | 108 | ||
109 | my ($arch, $objdump, $objcopy, $cc, $ld, $nm, $rm, $mv, $inputfile) = @ARGV; | 109 | my ($arch, $bits, $objdump, $objcopy, $cc, |
110 | $ld, $nm, $rm, $mv, $inputfile) = @ARGV; | ||
110 | 111 | ||
111 | $objdump = "objdump" if ((length $objdump) == 0); | 112 | $objdump = "objdump" if ((length $objdump) == 0); |
112 | $objcopy = "objcopy" if ((length $objcopy) == 0); | 113 | $objcopy = "objcopy" if ((length $objcopy) == 0); |
@@ -129,6 +130,14 @@ my $function_regex; # Find the name of a function | |||
129 | # (return offset and func name) | 130 | # (return offset and func name) |
130 | my $mcount_regex; # Find the call site to mcount (return offset) | 131 | my $mcount_regex; # Find the call site to mcount (return offset) |
131 | 132 | ||
133 | if ($arch eq "x86") { | ||
134 | if ($bits == 64) { | ||
135 | $arch = "x86_64"; | ||
136 | } else { | ||
137 | $arch = "i386"; | ||
138 | } | ||
139 | } | ||
140 | |||
132 | if ($arch eq "x86_64") { | 141 | if ($arch eq "x86_64") { |
133 | $section_regex = "Disassembly of section"; | 142 | $section_regex = "Disassembly of section"; |
134 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | 143 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; |