Skip to content

Commit

Permalink
tracing: Fix recordmcount.pl to handle sections with only weak functions
Browse files Browse the repository at this point in the history
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@cisco.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Aug 7, 2009
1 parent 469535a commit 7dbdee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/recordmcount.pl
Original file line number Diff line number Diff line change
@@ -393,7 +393,7 @@ sub update_funcs
$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 @@ sub update_funcs
}

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

0 comments on commit 7dbdee2

Please sign in to comment.