Re: [PATCH v2] markup_oops: Use modinfo to avoid confusion withunderscored module names

From: AmÃrico Wang
Date: Mon Aug 10 2009 - 10:34:37 EST


On Mon, Aug 10, 2009 at 12:13:13PM +0300, Ozan ÃaÄlayan wrote:
>When EIP is at a module having an underscore in its name, the current
>code fails to find it because the module filenames has '-' instead of
>'_'. Use modinfo for a better path finding.
>
>Signed-off-by: Ozan ÃaÄlayan <ozan@xxxxxxxxxxxxx>

Acked-by: WANG Cong <xiyou.wangcong@xxxxxxxxx>

Thanks!

>---
> scripts/markup_oops.pl | 5 +----
> 1 files changed, 1 insertions(+), 4 deletions(-)
>
>diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl
>index 8977401..5f0fcb7 100644
>--- a/scripts/markup_oops.pl
>+++ b/scripts/markup_oops.pl
>@@ -184,10 +184,7 @@ if ($target eq "0") {
>
> # if it's a module, we need to find the .ko file and calculate a load offset
> if ($module ne "") {
>- my $dir = dirname($filename);
>- $dir = $dir . "/";
>- my $mod = $module . ".ko";
>- my $modulefile = `find $dir -name $mod | head -1`;
>+ my $modulefile = `modinfo $module | grep '^filename:' | awk '{ print \$2 }'`;
> chomp($modulefile);
> $filename = $modulefile;
> if ($filename eq "") {
>--
>1.6.3.4
>
>--
>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/

--
Live like a child, think like the god.

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