mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Li Hong <lihong.hi@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, lihong.hi@gmail.com, hpa@zytor.com,
	mingo@redhat.com, rostedt@goodmis.org, tglx@linutronix.de
Subject: [tip:tracing/core] tracing: Move conditional into update_funcs() in recordmcount.pl
Date: Fri, 30 Oct 2009 16:20:22 GMT	[thread overview]
Message-ID: <tip-6092858c60f168c1950f8ad73880d54271696ec5@git.kernel.org> (raw)
In-Reply-To: <20091028050703.GG30758@uhli>

Commit-ID:  6092858c60f168c1950f8ad73880d54271696ec5
Gitweb:     http://git.kernel.org/tip/6092858c60f168c1950f8ad73880d54271696ec5
Author:     Li Hong <lihong.hi@gmail.com>
AuthorDate: Wed, 28 Oct 2009 13:07:03 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Thu, 29 Oct 2009 15:11:54 -0400

tracing: Move conditional into update_funcs() in recordmcount.pl

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

  reply	other threads:[~2009-10-30 16:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-28  4:57 [PATCH v3 0/8] tracing: recordmcount.pl Bug fixes and code improvement Li Hong
2009-10-28  5:01 ` [PATCH v3 1/8] tracing: recordmcount.pl Amend the documentation according to the implementation Li Hong
2009-10-30 16:18   ` [tip:tracing/core] tracing: Amend documentation in recordmcount.pl to reflect implementation tip-bot for Li Hong
2009-10-28  5:02 ` [PATCH v3 2/8] tracing: recordmcount.pl Correct the check on the number of parameters Li Hong
2009-10-28  5:03 ` [PATCH v3 3/8] tracing: recordmcount.pl Support absolute path check on $inputfile Li Hong
2009-10-30 16:19   ` [tip:tracing/core] tracing: Check absolute path of input file in recordmcount.pl tip-bot for Li Hong
2009-10-28  5:04 ` [PATCH v3 4/8] tracing: recordmcount.pl Objcopy check should disable local reference correctly Li Hong
2009-10-28 20:59   ` Steven Rostedt
2009-10-30 16:19   ` [tip:tracing/core] tracing: Fix objcopy revision check in recordmcount.pl tip-bot for Li Hong
2009-10-28  5:05 ` [PATCH v3 5/8] tracing: recordmcount.pl Clarify the logic on mcount section check Li Hong
2009-10-30 16:19   ` [tip:tracing/core] tracing: Move mcount section search to front of loop in recordmcount.pl tip-bot for Li Hong
2009-10-28  5:06 ` [PATCH v3 6/8] tracing: recordmcount.pl Use more friendly variables to clean up the code Li Hong
2009-10-30 16:20   ` [tip:tracing/core] tracing: Add regex for weak functions in recordmcount.pl tip-bot for Li Hong
2009-10-28  5:07 ` [PATCH v3 7/8] tracing: recordmcount.pl Combine the condition validation in update_funcs Li Hong
2009-10-30 16:20   ` tip-bot for Li Hong [this message]
2009-10-28  5:07 ` [PATCH v3 8/8] tracing: recordmcount.pl Die if we use a weak function as reference Li Hong
2009-10-30 16:20   ` [tip:tracing/core] tracing: Exit with error if a weak function is used in recordmcount.pl tip-bot for Li Hong
2009-10-28 15:49 ` [PATCH v3 0/8] tracing: recordmcount.pl Bug fixes and code improvement Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-6092858c60f168c1950f8ad73880d54271696ec5@git.kernel.org \
    --to=lihong.hi@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®