Commit e58918ab9d4cd375f6d842e6d88cf4d7a55cbfcc

Authored by Jim Radford
Committed by Ingo Molnar
1 parent 3a3d04aed0

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 ]

Signed-off-by: Jim Radford <radford@galvanix.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff

scripts/recordmcount.pl
... ... @@ -136,6 +136,7 @@
136 136 # (return offset and func name)
137 137 my $mcount_regex; # Find the call site to mcount (return offset)
138 138 my $alignment; # The .align value to use for $mcount_section
  139 +my $section_type; # Section header plus possible alignment command
139 140  
140 141 if ($arch eq "x86") {
141 142 if ($bits == 64) {
... ... @@ -153,6 +154,7 @@
153 154 $section_regex = "Disassembly of section\\s+(\\S+):";
154 155 $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
155 156 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
  157 +$section_type = '@progbits';
156 158 $type = ".long";
157 159  
158 160 if ($arch eq "x86_64") {
... ... @@ -192,6 +194,10 @@
192 194 $type = ".quad";
193 195 }
194 196  
  197 +} elsif ($arch eq "arm") {
  198 + $alignment = 2;
  199 + $section_type = '%progbits';
  200 +
195 201 } else {
196 202 die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
197 203 }
... ... @@ -312,7 +318,7 @@
312 318 if (!$opened) {
313 319 open(FILE, ">$mcount_s") || die "can't create $mcount_s\n";
314 320 $opened = 1;
315   - print FILE "\t.section $mcount_section,\"a\",\@progbits\n";
  321 + print FILE "\t.section $mcount_section,\"a\",$section_type\n";
316 322 print FILE "\t.align $alignment\n" if (defined($alignment));
317 323 }
318 324 printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset;