Skip to content

Commit 7dbdee2

Browse files
Steven RostedtIngo Molnar
authored andcommitted
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@cisco.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 469535a commit 7dbdee2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/recordmcount.pl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ sub update_funcs
393393
$read_function = 0;
394394
}
395395
# print out any recorded offsets
396-
update_funcs() if ($text_found);
396+
update_funcs() if (defined($ref_func));
397397

398398
# reset all markers and arrays
399399
$text_found = 0;
@@ -444,7 +444,7 @@ sub update_funcs
444444
}
445445

446446
# dump out anymore offsets that may have been found
447-
update_funcs() if ($text_found);
447+
update_funcs() if (defined($ref_func));
448448

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

0 commit comments

Comments
 (0)