Skip to content

Commit

Permalink
tracing: Move conditional into update_funcs() in recordmcount.pl
Browse files Browse the repository at this point in the history
Move all the condition validations into the function update_funcs().
Also update_funcs should not die if $ref_func is undefined for there may be
more than one valid section in an object file.

Signed-off-by: Li Hong <lihong.hi@gmail.com>
LKML-Reference: <20091028050703.GG30758@uhli>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
swanli authored and rostedt committed Oct 29, 2009
1 parent 306dcf4 commit 6092858
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/recordmcount.pl
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,7 @@ sub check_objcopy
#
sub update_funcs
{
return if ($#offsets < 0);

defined($ref_func) || die "No function to reference";
return unless ($ref_func and @offsets);

# A section only had a weak function, to represent it.
# Unfortunately, a weak function may be overwritten by another
Expand Down Expand Up @@ -425,7 +423,7 @@ sub update_funcs
$read_function = 0;
}
# print out any recorded offsets
update_funcs() if (defined($ref_func));
update_funcs();

# reset all markers and arrays
$text_found = 0;
Expand Down Expand Up @@ -462,7 +460,7 @@ sub update_funcs
}

# dump out anymore offsets that may have been found
update_funcs() if (defined($ref_func));
update_funcs();

# If we did not find any mcount callers, we are done (do nothing).
if (!$opened) {
Expand Down

0 comments on commit 6092858

Please sign in to comment.