[tip:tracing/urgent] tracing: Fix recordmcount.pl to handle sections with only weak functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  7dbdee2e9a2ac42ea5135801bcc9d1a8e3f672aa
Gitweb:     http://git.kernel.org/tip/7dbdee2e9a2ac42ea5135801bcc9d1a8e3f672aa
Author:     Steven Rostedt <srostedt@xxxxxxxxxx>
AuthorDate: Thu, 6 Aug 2009 19:53:18 -0400
Committer:  Ingo Molnar <mingo@xxxxxxx>
CommitDate: Fri, 7 Aug 2009 08:50:29 +0200

tracing: Fix recordmcount.pl to handle sections with only weak functions

Roland Dreier found that a section that contained only a weak
function in one of the staging drivers and this caused
recordmcount.pl to spit out a warning and fail.

Although it is strange that a driver would have a weak function, and
this function only be used in one place, it should not be something
to make recordmcount.pl fail.

This patch fixes the issue in a simple manner: if only weak
functions exist in a section, then that section will not be
recorded.

Reported-by: Roland Dreier <rdreier@xxxxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>


---
 scripts/recordmcount.pl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 4889c44..911ba7f 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -393,7 +393,7 @@ while (<IN>) {
 	    $read_function = 0;
 	}
 	# print out any recorded offsets
-	update_funcs() if ($text_found);
+	update_funcs() if (defined($ref_func));
 
 	# reset all markers and arrays
 	$text_found = 0;
@@ -444,7 +444,7 @@ while (<IN>) {
 }
 
 # dump out anymore offsets that may have been found
-update_funcs() if ($text_found);
+update_funcs() if (defined($ref_func));
 
 # If we did not find any mcount callers, we are done (do nothing).
 if (!$opened) {
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux