aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-11-17 10:48:25 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-11-17 11:05:52 -0500
commit638adb0561264a3360a53e93def62288c85d8373 (patch)
tree4d89d07b6c3c5a8b04458b1118a536d97968adcf /scripts
parentf6060f46819f313d34a8c8151390cda509c23389 (diff)
tracing: Only print objcopy version warning once from recordmcount
If the user has an older version of objcopy, that can not handle converting local symbols to global and vice versa, then some functions will not be part of the dynamic function tracer. The current code in recordmcount.pl will print a warning in this case. Unfortunately, there exists lots of files that may have this issue with older objcopys and this will cause a warning for every file compiled with this issue. This patch solves this overwhelming output by creating a .tmp_quiet_recordmcount file on the first instance the warning is encountered. The warning will not print if this file exists. The temp file is deleted at the beginning of the compile to ensure that the warning will happen once again on new compiles (because the issue is still present). Reported-by: Andrew Morton <akpm@linux-foundation.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/recordmcount.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index a4e2435d4821..f0d14452632b 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -162,6 +162,11 @@ my $alignment; # The .align value to use for $mcount_section
162my $section_type; # Section header plus possible alignment command 162my $section_type; # Section header plus possible alignment command
163my $can_use_local = 0; # If we can use local function references 163my $can_use_local = 0; # If we can use local function references
164 164
165# Shut up recordmcount if user has older objcopy
166my $quiet_recordmcount = ".tmp_quiet_recordmcount";
167my $print_warning = 1;
168$print_warning = 0 if ( -f $quiet_recordmcount);
169
165## 170##
166# check_objcopy - whether objcopy supports --globalize-symbols 171# check_objcopy - whether objcopy supports --globalize-symbols
167# 172#
@@ -179,10 +184,13 @@ sub check_objcopy
179 } 184 }
180 close (IN); 185 close (IN);
181 186
182 if (!$can_use_local) { 187 if (!$can_use_local && $print_warning) {
183 print STDERR "WARNING: could not find objcopy version or version " . 188 print STDERR "WARNING: could not find objcopy version or version " .
184 "is less than 2.17.\n" . 189 "is less than 2.17.\n" .
185 "\tLocal function references is disabled.\n"; 190 "\tLocal function references are disabled.\n";
191 open (QUIET, ">$quiet_recordmcount");
192 printf QUIET "Disables the warning from recordmcount.pl\n";
193 close QUIET;
186 } 194 }
187} 195}
188 196