mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Wolfram Sang <w.sang@pengutronix.de>
Subject: [PATCH 10/11] tracing: Use appropriate perl constructs in recordmcount.pl
Date: Wed, 06 Jan 2010 18:13:59 -0500	[thread overview]
Message-ID: <20100106231533.895223898@goodmis.org> (raw)
In-Reply-To: <20100106231349.107649729@goodmis.org>

[-- Attachment #1: 0010-tracing-Use-appropriate-perl-constructs-in-recordmco.patch --]
[-- Type: text/plain, Size: 1928 bytes --]

From: Wolfram Sang <w.sang@pengutronix.de>

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>
---
 scripts/recordmcount.pl |   29 +++++++++++------------------
 1 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 5de12c7..545fe71 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -136,13 +136,14 @@ my %text_sections = (
      ".text.unlikely" => 1,
 );
 
-$objdump = "objdump" if ((length $objdump) == 0);
-$objcopy = "objcopy" if ((length $objcopy) == 0);
-$cc = "gcc" if ((length $cc) == 0);
-$ld = "ld" if ((length $ld) == 0);
-$nm = "nm" if ((length $nm) == 0);
-$rm = "rm" if ((length $rm) == 0);
-$mv = "mv" if ((length $mv) == 0);
+# Note: we are nice to C-programmers here, thus we skip the '||='-idiom.
+$objdump = 'objdump' if (!$objdump);
+$objcopy = 'objcopy' if (!$objcopy);
+$cc = 'gcc' if (!$cc);
+$ld = 'ld' if (!$ld);
+$nm = 'nm' if (!$nm);
+$rm = 'rm' if (!$rm);
+$mv = 'mv' if (!$mv);
 
 #print STDERR "running: $P '$arch' '$objdump' '$objcopy' '$cc' '$ld' " .
 #    "'$nm' '$rm' '$mv' '$inputfile'\n";
@@ -194,12 +195,8 @@ sub check_objcopy
     }
 }
 
-if ($arch eq "x86") {
-    if ($bits == 64) {
-	$arch = "x86_64";
-    } else {
-	$arch = "i386";
-    }
+if ($arch eq 'x86') {
+    $arch = ($bits == 64) ? 'x86_64' : 'i386';
 }
 
 #
@@ -476,11 +473,7 @@ while (<IN>) {
 	$read_headers = 0;
 
 	# Only record text sections that we know are safe
-	if (defined($text_sections{$1})) {
-	    $read_function = 1;
-	} else {
-	    $read_function = 0;
-	}
+	$read_function = defined($text_sections{$1});
 	# print out any recorded offsets
 	update_funcs();
 
-- 
1.6.5



  parent reply	other threads:[~2010-01-06 23:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 23:13 [PATCH 0/11][GIT PULL] tracing: various updates for 2.6.34 Steven Rostedt
2010-01-06 23:13 ` [PATCH 01/11] tracing: Have __dynamic_array() define a field Steven Rostedt
2010-01-06 23:13 ` [PATCH 02/11] tracing: Add print_fmt field Steven Rostedt
2010-01-06 23:13 ` [PATCH 03/11] tracing/syscalls: Init print_fmt for syscall events Steven Rostedt
2010-01-06 23:13 ` [PATCH 04/11] tracing/kprobes: Init print_fmt for kprobe events Steven Rostedt
2010-01-06 23:13 ` [PATCH 05/11] tracing: Have syscall tracing call its own init function Steven Rostedt
2010-01-06 23:13 ` [PATCH 06/11] tracing: Use defined fields and print_fmt to print formats Steven Rostedt
2010-01-06 23:13 ` [PATCH 07/11] tracing: Remove show_format and related macros from TRACE_EVENT Steven Rostedt
2010-01-06 23:13 ` [PATCH 08/11] tracing: Consolidate protection of reader access to the ring buffer Steven Rostedt
2010-01-06 23:13 ` [PATCH 09/11] tracing: optimize recordmcount.pl for offsets-handling Steven Rostedt
2010-01-06 23:13 ` Steven Rostedt [this message]
2010-01-06 23:14 ` [PATCH 11/11] tracing: Add stack dump to trace_printk if stacktrace option is set Steven Rostedt
2010-01-13  8:26 ` [PATCH 0/11][GIT PULL] tracing: various updates for 2.6.34 Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100106231533.895223898@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=w.sang@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome