aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2010-01-05 15:41:22 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-06 18:08:58 -0500
commitdfaa9e2c5707b2c217c0121aac796e0fa3051482 (patch)
tree786f61acc9b13c6177f4ebab6a51b715326796a5 /scripts
parentdc4f8845ee2ca39fe054a2d911729ffd269b4b66 (diff)
tracing: Use appropriate perl constructs in recordmcount.pl
Modified recordmcount.pl to use perl constructs that are still understandable by C hackers that are not perl programmers. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> LKML-Reference: <1262724082-9517-1-git-send-email-w.sang@pengutronix.de> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/recordmcount.pl29
1 files changed, 11 insertions, 18 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 5de12c7b366f..545fe7154ced 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -136,13 +136,14 @@ my %text_sections = (
136 ".text.unlikely" => 1, 136 ".text.unlikely" => 1,
137); 137);
138 138
139$objdump = "objdump" if ((length $objdump) == 0); 139# Note: we are nice to C-programmers here, thus we skip the '||='-idiom.
140$objcopy = "objcopy" if ((length $objcopy) == 0); 140$objdump = 'objdump' if (!$objdump);
141$cc = "gcc" if ((length $cc) == 0); 141$objcopy = 'objcopy' if (!$objcopy);
142$ld = "ld" if ((length $ld) == 0); 142$cc = 'gcc' if (!$cc);
143$nm = "nm" if ((length $nm) == 0); 143$ld = 'ld' if (!$ld);
144$rm = "rm" if ((length $rm) == 0); 144$nm = 'nm' if (!$nm);
145$mv = "mv" if ((length $mv) == 0); 145$rm = 'rm' if (!$rm);
146$mv = 'mv' if (!$mv);
146 147
147#print STDERR "running: $P '$arch' '$objdump' '$objcopy' '$cc' '$ld' " . 148#print STDERR "running: $P '$arch' '$objdump' '$objcopy' '$cc' '$ld' " .
148# "'$nm' '$rm' '$mv' '$inputfile'\n"; 149# "'$nm' '$rm' '$mv' '$inputfile'\n";
@@ -194,12 +195,8 @@ sub check_objcopy
194 } 195 }
195} 196}
196 197
197if ($arch eq "x86") { 198if ($arch eq 'x86') {
198 if ($bits == 64) { 199 $arch = ($bits == 64) ? 'x86_64' : 'i386';
199 $arch = "x86_64";
200 } else {
201 $arch = "i386";
202 }
203} 200}
204 201
205# 202#
@@ -476,11 +473,7 @@ while (<IN>) {
476 $read_headers = 0; 473 $read_headers = 0;
477 474
478 # Only record text sections that we know are safe 475 # Only record text sections that we know are safe
479 if (defined($text_sections{$1})) { 476 $read_function = defined($text_sections{$1});
480 $read_function = 1;
481 } else {
482 $read_function = 0;
483 }
484 # print out any recorded offsets 477 # print out any recorded offsets
485 update_funcs(); 478 update_funcs();
486 479