Re: [PATCH] scripts: script from kerneloops.org to pretty printoops dumps

From: AmÃrico Wang
Date: Thu Nov 06 2008 - 05:30:32 EST


On Wed, Nov 05, 2008 at 07:07:26PM -0800, Arjan van de Ven wrote:
>Hi,
>

Hi,

thanks for your work!

>
>diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl
>new file mode 100644
>index 0000000..c8a2200
>--- /dev/null
>+++ b/scripts/markup_oops.pl
>@@ -0,0 +1,165 @@
>+#!/usr/bin/perl -w
>+
>+# Copyright 2008, Intel Corporation
>+#
>+# This file is part of the Linux kernel
>+#
>+# This program file is free software; you can redistribute it and/or modify it
>+# under the terms of the GNU General Public License as published by the
>+# Free Software Foundation; version 2 of the License.
>+#
>+# Authors:
>+# Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
>+
>+
>+my $vmlinux_name = $ARGV[0];
>+
>+#
>+# Step 1: Parse the oops to find the EIP value
>+#
>+
>+my $target = "0";
>+while (<STDIN>) {
>+ if ($_ =~ /EIP: 0060:\[\<([a-z0-9]+)\>\]/) {
>+ $target = $1;
>+ }
>+}
>+
>+if ($target =~ /^f8/) {
>+ print "This script does not work on modules ... \n";
>+ exit;
>+}
>+
>+if ($target eq "0") {
>+ print "No oops found!\n";
>+ print "Usage: \n";
>+ print " dmesg | perl scripts/markup_oops.pl vmlinux\n";
>+ exit;


One thing to note here, no oops doesn't always mean wrong usage. :)
So I think usage should be printed only when the usage is actually
wrong, e.g. ARGV[0] is missed.



>+$start = $center;
>+$codelines = 0;
>+$binarylines = 0;

Why not fold these lines into their definitions?


--
"Sometimes the only way to stay sane is to go a little crazy."

--
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/