History

ftrace: scripts/recordmcount.pl support for ARM

Impact: extend scripts/recordmcount.pl to ARM Arm uses %progbits instead of @progbits and requires only 4 byte alignment. [ Thanks to Sam Ravnborg for mentioning that ARM uses %progbits ]

Jim Radford committed 17 years ago

Commit e58918a1 parent 3a3d04a1 file · +7 −1Browse files

Unified · Split

scripts/recordmcount.pl+7−1
@@ -136,6 +136,7 @@ my $function_regex; # Find the name of a function · 135 unmodified lines
136136 # (return offset and func name)
137137 my $mcount_regex; # Find the call site to mcount (return offset)
138138 my $alignment; # The .align value to use for $mcount_section
139+my $section_type; # Section header plus possible alignment command
139140
140141 if ($arch eq "x86") {
141142 if ($bits == 64) {
@@ -153,6 +154,7 @@ $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)"; · 11 unmodified lines
153154 $section_regex = "Disassembly of section\\s+(\\S+):";
154155 $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
155156 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
157+$section_type = '@progbits';
156158 $type = ".long";
157159
158160 if ($arch eq "x86_64") {
@@ -192,6 +194,10 @@ if ($arch eq "x86_64") { · 33 unmodified lines
192194 $type = ".quad";
193195 }
194196
197+} elsif ($arch eq "arm") {
198+ $alignment = 2;
199+ $section_type = '%progbits';
200+
195201 } else {
196202 die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
197203 }
@@ -312,7 +318,7 @@ sub update_funcs · 114 unmodified lines
312318 if (!$opened) {
313319 open(FILE, ">$mcount_s") || die "can't create $mcount_s\n";
314320 $opened = 1;
315− print FILE "\t.section $mcount_section,\"a\",\@progbits\n";
321+ print FILE "\t.section $mcount_section,\"a\",$section_type\n";
316322 print FILE "\t.align $alignment\n" if (defined($alignment));
317323 }
318324 printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset;