Skip to content

Commit

Permalink
tracing: Extend recordmcount to better support Blackfin mcount
Browse files Browse the repository at this point in the history
The mcount call on Blackfin systems includes some stack manipulation
around the actual call site, so extend the build time perl script to
support this.  This way we can avoid doing the calculation at runtime.

Signed-off-by: Mike Frysinger <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
vapier authored and rostedt committed Aug 12, 2010
1 parent 18fab91 commit 465c6cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/recordmcount.pl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
my $function_regex; # Find the name of a function
# (return offset and func name)
my $mcount_regex; # Find the call site to mcount (return offset)
my $mcount_adjust; # Address adjustment to mcount offset
my $alignment; # The .align value to use for $mcount_section
my $section_type; # Section header plus possible alignment command
my $can_use_local = 0; # If we can use local function references
Expand Down Expand Up @@ -213,6 +214,7 @@ sub check_objcopy
$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
$section_type = '@progbits';
$mcount_adjust = 0;
$type = ".long";

if ($arch eq "x86_64") {
Expand Down Expand Up @@ -351,6 +353,9 @@ sub check_objcopy
} elsif ($arch eq "microblaze") {
# Microblaze calls '_mcount' instead of plain 'mcount'.
$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
} elsif ($arch eq "blackfin") {
$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$";
$mcount_adjust = -4;
} else {
die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
}
Expand Down Expand Up @@ -511,7 +516,7 @@ sub update_funcs
}
# is this a call site to mcount? If so, record it to print later
if ($text_found && /$mcount_regex/) {
push(@offsets, hex $1);
push(@offsets, (hex $1) + $mcount_adjust);
}
}

Expand Down

0 comments on commit 465c6cc

Please sign in to comment.