提交 dfaa9e2c 编写于 作者: W Wolfram Sang 提交者: Steven Rostedt

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: NWolfram Sang <w.sang@pengutronix.de>
LKML-Reference: <1262724082-9517-1-git-send-email-w.sang@pengutronix.de>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 dc4f8845
...@@ -136,13 +136,14 @@ my %text_sections = ( ...@@ -136,13 +136,14 @@ my %text_sections = (
".text.unlikely" => 1, ".text.unlikely" => 1,
); );
$objdump = "objdump" if ((length $objdump) == 0); # Note: we are nice to C-programmers here, thus we skip the '||='-idiom.
$objcopy = "objcopy" if ((length $objcopy) == 0); $objdump = 'objdump' if (!$objdump);
$cc = "gcc" if ((length $cc) == 0); $objcopy = 'objcopy' if (!$objcopy);
$ld = "ld" if ((length $ld) == 0); $cc = 'gcc' if (!$cc);
$nm = "nm" if ((length $nm) == 0); $ld = 'ld' if (!$ld);
$rm = "rm" if ((length $rm) == 0); $nm = 'nm' if (!$nm);
$mv = "mv" if ((length $mv) == 0); $rm = 'rm' if (!$rm);
$mv = 'mv' if (!$mv);
#print STDERR "running: $P '$arch' '$objdump' '$objcopy' '$cc' '$ld' " . #print STDERR "running: $P '$arch' '$objdump' '$objcopy' '$cc' '$ld' " .
# "'$nm' '$rm' '$mv' '$inputfile'\n"; # "'$nm' '$rm' '$mv' '$inputfile'\n";
...@@ -194,12 +195,8 @@ sub check_objcopy ...@@ -194,12 +195,8 @@ sub check_objcopy
} }
} }
if ($arch eq "x86") { if ($arch eq 'x86') {
if ($bits == 64) { $arch = ($bits == 64) ? 'x86_64' : 'i386';
$arch = "x86_64";
} else {
$arch = "i386";
}
} }
# #
...@@ -476,11 +473,7 @@ while (<IN>) { ...@@ -476,11 +473,7 @@ while (<IN>) {
$read_headers = 0; $read_headers = 0;
# Only record text sections that we know are safe # Only record text sections that we know are safe
if (defined($text_sections{$1})) { $read_function = defined($text_sections{$1});
$read_function = 1;
} else {
$read_function = 0;
}
# print out any recorded offsets # print out any recorded offsets
update_funcs(); update_funcs();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册