From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Hui Zhu <hui.zhu@windriver.com>
Cc: 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: Tue, 26 Jan 2010 15:53:32 +0800 [thread overview]
Message-ID: <2375c9f91001252353u52f437b0t7ddd643a57047e1c@mail.gmail.com> (raw)
In-Reply-To: <4B5E9BE9.2030702@windriver.com>
On Tue, Jan 26, 2010 at 3:38 PM, Hui Zhu <hui.zhu@windriver.com> wrote:
> Américo Wang:
>>
>> On Tue, Jan 26, 2010 at 11:11 AM, Hui Zhu <hui.zhu@windriver.com> wrote:
>>>
>>> Sorry guys, the prev mail still have some format trouble. I send a new
>>> mail
>>> for it.
>>> +}
>>> +
>>> +if ($vmlinux_name ne "") {
>>> + $vmlinux_name = $ARGV[$#ARGV];
>>> +}
>>
>> Why not using the Perl module 'Getopt' to do this?
>>
> Hi Américo,
>
> Thanks for remind me about it. The following patch use Getopt.
>
> The markup_oops.pl have 3 troubles to support cross-compiler environment:
> 1. It use objdump directly.
> 2. It use modinfo to get the message of module.
> 3. It use hex function that cannot support 64-bit number in 32-bit arch.
>
> This patch add 3 options to markup_oops.pl:
> 1. -c CROSS_COMPILE Specify the prefix used for toolchain.
> 2. -m MODULE_DIRNAME Specify the module directory name.
> 3. Change hex function to Math::BigInt->from_hex.
>
> After this patch, parse the x8664 oops in x86, we can:
> cat amd64m | perl ~/kernel/tmp/m.pl -c /home/teawater/kernel/bin/x8664- -m
> ./e.ko vmlinux
>
> Thanks,
> Hui
>
> Signed-off-by: Hui Zhu <teawater@gmail.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Arjan van de Ven <arjan@linux.intel.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: ozan@pardus.org.tr
> Cc: Matthew Wilcox <willy@linux.intel.com>
>
> ---
> scripts/markup_oops.pl | 45 +++++++++++++++++++++++++++++++++++----------
> 1 file changed, 35 insertions(+), 10 deletions(-)
>
> --- a/scripts/markup_oops.pl
> +++ b/scripts/markup_oops.pl
> @@ -2,6 +2,7 @@
>
> use File::Basename;
> use Math::BigInt;
> +use Getopt::Long;
>
> # Copyright 2008, Intel Corporation
> #
> @@ -15,7 +16,17 @@ use Math::BigInt;
> # Arjan van de Ven <arjan@linux.intel.com>
>
>
> -my $vmlinux_name = $ARGV[0];
> +my $cross_compile = "";
> +my $vmlinux_name = "";
> +my $modulefile = "";
> +
> +# Get options
> +Getopt::Long::GetOptions(
> + 'cross_compile|c=s' => \$cross_compile,
Please make it "cross-compile", because underline is not common
in command line, so "--cross_compile" is worse than "--cross-compile".
> + 'modulefile|m=s' => \$modulefile,
"module" should be enough to express the meaning, I think.
> + 'help|h' => \&usage,
> +);
> +my $vmlinux_name = $ARGV[$#ARGV];
> if (!defined($vmlinux_name)) {
> my $kerver = `uname -r`;
> chomp($kerver);
> @@ -23,6 +34,7 @@ if (!defined($vmlinux_name)) {
> print "No vmlinux specified, assuming $vmlinux_name\n";
> }
> my $filename = $vmlinux_name;
> +
Adding this empty line probably is not what you really want.
> #
> # Step 1: Parse the oops to find the EIP value
> #
{snip}
>
> +sub usage {
> + print <<EOT;
> +Usage:
> + dmesg | perl $0 [OPTION] [VMLINUX]
> +
> +OPTION:
> + -c, -cross_compile CROSS_COMPILE Specify the prefix used for
> toolchain.
> + -m, -modulefile MODULE_DIRNAME Specify the module directory name.
> + -h, -help Help.
> +EOT
> + exit;
> +}
> +
GNU style is preferred here, please use "--foo" instead of "-foo".
Thanks.
next prev parent reply other threads:[~2010-01-26 7:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-26 3:11 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 [this message]
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
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=2375c9f91001252353u52f437b0t7ddd643a57047e1c@mail.gmail.com \
--to=xiyou.wangcong@gmail.com \
--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 \
/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
all inboxes | Powered by JetHome®