All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Hui Zhu <hui.zhu@windriver.com>
Cc: "Américo Wang" <xiyou.wangcong@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Arjan van de Ven" <arjan@linux.intel.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	ozan@pardus.org.tr, "Matthew Wilcox" <willy@linux.intel.com>,
	linux-kernel@vger.kernel.org, teawater@gmail.com
Subject: Re: [PATCH] markup_oops.pl: add options to improve cross-sompilation environments
Date: Fri, 29 Jan 2010 21:27:54 +0100	[thread overview]
Message-ID: <4B6344CA.10504@suse.cz> (raw)
In-Reply-To: <4B5EB223.60307@windriver.com>

On 26.1.2010 10:13, Hui Zhu wrote:
> +# Get options
> +Getopt::Long::GetOptions(
> +    'cross-compile|c=s'    => \$cross_compile,
> +    'module|m=s'    => \$modulefile,
> +    'help|h'        => \&usage,
> +);

You should check the return code of GetOptions() and abort on invalid
options.


> +my $vmlinux_name = $ARGV[$#ARGV];

GetOptions() deletes the recognized options from @ARGV, so you can say
$ARGV[0] as before (and maybe check if there aren't any superfluous
arguments).


> # if it's a module, we need to find the .ko file and calculate a load
> offset
> if ($module ne "") {
> -    my $modulefile = `modinfo $module | grep '^filename:' | awk '{
> print \$2 }'`;
> -    chomp($modulefile);
> +    if ($modulefile eq "") {
> +        my $modulefile = `modinfo $module | grep '^filename:' | awk '{
> print \$2 }'`;

I know you didn't add this, but while at it, could you replace the
pipeline with just `modinfo -F filename $module`?


> +sub usage {
> +    print <<EOT;
> +Usage:
> +  dmesg | perl $0 [OPTION] [VMLINUX]
> +
> +OPTION:
> +  -c, --cross-compile CROSS_COMPILE    Specify the prefix used for
> toolchain.
> +  -m, --module MODULE_DIRNAME        Specify the module directory name.

Here and in the changelog you talk about "module directory name", but in
fact this is the module filename.

Thanks,
Michal

  parent reply	other threads:[~2010-01-29 20:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26  3:11 [PATCH] markup_oops.pl: add options to improve cross-sompilation environments Hui Zhu
2010-01-26  3:05 ` Américo Wang
2010-01-26  7:38   ` Hui Zhu
2010-01-26  7:53     ` Américo Wang
2010-01-26  9:13       ` Hui Zhu
2010-01-26  9:15         ` Américo Wang
2010-01-26  9:21           ` Hui Zhu
2010-01-29 20:27         ` Michal Marek [this message]
2010-02-01  5:41           ` Hui Zhu
2010-02-05 21:38             ` Michal Marek
2010-02-08  2:55               ` Hui Zhu
2010-02-17 13:08                 ` Michal Marek
2010-02-20  2:16                   ` Hui Zhu
  -- strict thread matches above, loose matches on Subject: below --
2010-01-25 14:36 Hui Zhu

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=4B6344CA.10504@suse.cz \
    --to=mmarek@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=hui.zhu@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ozan@pardus.org.tr \
    --cc=sam@ravnborg.org \
    --cc=teawater@gmail.com \
    --cc=willy@linux.intel.com \
    --cc=xiyou.wangcong@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.