[PATCH 7/8] [PATCH 7/8] tracing: Move conditional into update_funcs() in recordmcount.pl

From: Steven Rostedt
Date: Thu Oct 29 2009 - 18:33:49 EST


From: Li Hong <lihong.hi@xxxxxxxxx>

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@xxxxxxxxx>
LKML-Reference: <20091028050703.GG30758@uhli>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
scripts/recordmcount.pl | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 7265a7d..884776a 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -348,9 +348,7 @@ my $offset = 0; # offset of ref_func to section beginning
#
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
@@ -425,7 +423,7 @@ while (<IN>) {
$read_function = 0;
}
# print out any recorded offsets
- update_funcs() if (defined($ref_func));
+ update_funcs();

# reset all markers and arrays
$text_found = 0;
@@ -462,7 +460,7 @@ while (<IN>) {
}

# 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) {
--
1.6.3.3


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/