diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-11-20 15:07:34 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-23 05:37:25 -0500 |
commit | c204f7264c7de85aecd3638dc8fe07aba6d1fff5 (patch) | |
tree | cd982d0e5057548c2d881b32355c7da815865b5c /scripts | |
parent | 42e007d0400155fbc12c5344c808889e6ae33d32 (diff) |
ftrace: create default variables for archs in recordmcount.pl
Impact: cleanup of recordmcount.pl
Now that more architectures are being ported to the MCOUNT_RECORD
method, there is no reason to have each declare their own arch
specific variable if most of them share the same value. This patch
creates a set of default values for the arch specific variables
based off of i386.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/recordmcount.pl | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 7ec032e3c3fa..c5c58ac90c04 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -145,10 +145,17 @@ if ($arch eq "x86") { | |||
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | # | ||
149 | # We base the defaults off of i386, the other archs may | ||
150 | # feel free to change them in the below if statements. | ||
151 | # | ||
152 | $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)"; | ||
153 | $section_regex = "Disassembly of section\\s+(\\S+):"; | ||
154 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | ||
155 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; | ||
156 | $type = ".long"; | ||
157 | |||
148 | if ($arch eq "x86_64") { | 158 | if ($arch eq "x86_64") { |
149 | $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)"; | ||
150 | $section_regex = "Disassembly of section\\s+(\\S+):"; | ||
151 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | ||
152 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; | 159 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; |
153 | $type = ".quad"; | 160 | $type = ".quad"; |
154 | $alignment = 8; | 161 | $alignment = 8; |
@@ -160,11 +167,6 @@ if ($arch eq "x86_64") { | |||
160 | $cc .= " -m64"; | 167 | $cc .= " -m64"; |
161 | 168 | ||
162 | } elsif ($arch eq "i386") { | 169 | } elsif ($arch eq "i386") { |
163 | $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)"; | ||
164 | $section_regex = "Disassembly of section\\s+(\\S+):"; | ||
165 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | ||
166 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; | ||
167 | $type = ".long"; | ||
168 | $alignment = 4; | 170 | $alignment = 4; |
169 | 171 | ||
170 | # force flags for this arch | 172 | # force flags for this arch |
@@ -174,11 +176,6 @@ if ($arch eq "x86_64") { | |||
174 | $cc .= " -m32"; | 176 | $cc .= " -m32"; |
175 | 177 | ||
176 | } elsif ($arch eq "sh") { | 178 | } elsif ($arch eq "sh") { |
177 | $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)"; | ||
178 | $section_regex = "Disassembly of section\\s+(\\S+):"; | ||
179 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | ||
180 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; | ||
181 | $type = ".long"; | ||
182 | 179 | ||
183 | # force flags for this arch | 180 | # force flags for this arch |
184 | $ld .= " -m shlelf_linux"; | 181 | $ld .= " -m shlelf_linux"; |
@@ -187,13 +184,11 @@ if ($arch eq "x86_64") { | |||
187 | 184 | ||
188 | } elsif ($arch eq "powerpc") { | 185 | } elsif ($arch eq "powerpc") { |
189 | $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; | 186 | $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; |
190 | $section_regex = "Disassembly of section\\s+(\\S+):"; | ||
191 | $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?.*?)>:"; | 187 | $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?.*?)>:"; |
192 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$"; | 188 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$"; |
189 | |||
193 | if ($bits == 64) { | 190 | if ($bits == 64) { |
194 | $type = ".quad"; | 191 | $type = ".quad"; |
195 | } else { | ||
196 | $type = ".long"; | ||
197 | } | 192 | } |
198 | 193 | ||
199 | } else { | 194 | } else { |