Re: [PATCH 3/9] tracing: recordmcount.pl Support absolute pathcheck on $inputfile

From: Steven Rostedt
Date: Tue Oct 27 2009 - 16:20:03 EST


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@xxxxxxxxx>
> 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@xxxxxxxxx>
>
> 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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/