Commit dfaa9e2c5707b2c217c0121aac796e0fa3051482
Committed by
Steven Rostedt
1 parent
dc4f8845ee
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 11 additions and 18 deletions Side-by-side Diff
scripts/recordmcount.pl
| ... | ... | @@ -136,13 +136,14 @@ |
| 136 | 136 | ".text.unlikely" => 1, |
| 137 | 137 | ); |
| 138 | 138 | |
| 139 | -$objdump = "objdump" if ((length $objdump) == 0); | |
| 140 | -$objcopy = "objcopy" if ((length $objcopy) == 0); | |
| 141 | -$cc = "gcc" if ((length $cc) == 0); | |
| 142 | -$ld = "ld" if ((length $ld) == 0); | |
| 143 | -$nm = "nm" if ((length $nm) == 0); | |
| 144 | -$rm = "rm" if ((length $rm) == 0); | |
| 145 | -$mv = "mv" if ((length $mv) == 0); | |
| 139 | +# Note: we are nice to C-programmers here, thus we skip the '||='-idiom. | |
| 140 | +$objdump = 'objdump' if (!$objdump); | |
| 141 | +$objcopy = 'objcopy' if (!$objcopy); | |
| 142 | +$cc = 'gcc' if (!$cc); | |
| 143 | +$ld = 'ld' if (!$ld); | |
| 144 | +$nm = 'nm' if (!$nm); | |
| 145 | +$rm = 'rm' if (!$rm); | |
| 146 | +$mv = 'mv' if (!$mv); | |
| 146 | 147 | |
| 147 | 148 | #print STDERR "running: $P '$arch' '$objdump' '$objcopy' '$cc' '$ld' " . |
| 148 | 149 | # "'$nm' '$rm' '$mv' '$inputfile'\n"; |
| ... | ... | @@ -194,12 +195,8 @@ |
| 194 | 195 | } |
| 195 | 196 | } |
| 196 | 197 | |
| 197 | -if ($arch eq "x86") { | |
| 198 | - if ($bits == 64) { | |
| 199 | - $arch = "x86_64"; | |
| 200 | - } else { | |
| 201 | - $arch = "i386"; | |
| 202 | - } | |
| 198 | +if ($arch eq 'x86') { | |
| 199 | + $arch = ($bits == 64) ? 'x86_64' : 'i386'; | |
| 203 | 200 | } |
| 204 | 201 | |
| 205 | 202 | # |
| ... | ... | @@ -476,11 +473,7 @@ |
| 476 | 473 | $read_headers = 0; |
| 477 | 474 | |
| 478 | 475 | # Only record text sections that we know are safe |
| 479 | - if (defined($text_sections{$1})) { | |
| 480 | - $read_function = 1; | |
| 481 | - } else { | |
| 482 | - $read_function = 0; | |
| 483 | - } | |
| 476 | + $read_function = defined($text_sections{$1}); | |
| 484 | 477 | # print out any recorded offsets |
| 485 | 478 | update_funcs(); |
| 486 | 479 |