lkml.org 
[lkml]   [2009]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/9] tracing: recordmcount.pl Support absolute path check on $inputfile
From
Date
On Tue, 2009-10-27 at 14:58 +0800, Li Hong wrote:
> >From fdf89709ddf4a6ff2f2d21ff8a964e949a069fe4 Mon Sep 17 00:00:00 2001
> From: Li Hong <lihong.hi@gmail.com>
> Date: Tue, 27 Oct 2009 12:32:18 +0800
> Subject: [PATCH] tracing: recordmcount.pl Support absolute path check on $inputfile
>
> Signed-off-by: Li Hong <lihong.hi@gmail.com>
>
> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
> index 0850b83..94daf9e 100755
> --- a/scripts/recordmcount.pl
> +++ b/scripts/recordmcount.pl
> @@ -122,9 +122,7 @@ my ($arch, $bits, $objdump, $objcopy, $cc,
> $ld, $nm, $rm, $mv, $is_module, $inputfile) = @ARGV;
>
> # This file refers to mcount and shouldn't be ftraced, so lets' ignore it
> -if ($inputfile eq "kernel/trace/ftrace.o") {
> - exit(0);
> -}
> +exit (0) if ($inputfile =~ "kernel/trace/ftrace.o");

I prefer to keep the C like notation for error paths. Less to scare C
programers from perl the better.

Also, if you are using a regular expression to match, might as well do
it fully:

if ($inputfile =~ m,kernel/tracel/ftrace\.o$,) {
exit(0);
}

-- Steve




\
 
 \ /
  Last update: 2009-10-27 21:23    [W:1.933 / U:1.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site