aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/markup_oops.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/markup_oops.pl')
-rw-r--r--scripts/markup_oops.pl10
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl
index 528492bcba5b..5f0fcb712e29 100644
--- a/scripts/markup_oops.pl
+++ b/scripts/markup_oops.pl
@@ -1,6 +1,7 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2 2
3use File::Basename; 3use File::Basename;
4use Math::BigInt;
4 5
5# Copyright 2008, Intel Corporation 6# Copyright 2008, Intel Corporation
6# 7#
@@ -172,8 +173,8 @@ while (<STDIN>) {
172 parse_x86_regs($line); 173 parse_x86_regs($line);
173} 174}
174 175
175my $decodestart = hex($target) - hex($func_offset); 176my $decodestart = Math::BigInt->from_hex("0x$target") - Math::BigInt->from_hex("0x$func_offset");
176my $decodestop = hex($target) + 8192; 177my $decodestop = Math::BigInt->from_hex("0x$target") + 8192;
177if ($target eq "0") { 178if ($target eq "0") {
178 print "No oops found!\n"; 179 print "No oops found!\n";
179 print "Usage: \n"; 180 print "Usage: \n";
@@ -183,10 +184,7 @@ if ($target eq "0") {
183 184
184# if it's a module, we need to find the .ko file and calculate a load offset 185# if it's a module, we need to find the .ko file and calculate a load offset
185if ($module ne "") { 186if ($module ne "") {
186 my $dir = dirname($filename); 187 my $modulefile = `modinfo $module | grep '^filename:' | awk '{ print \$2 }'`;
187 $dir = $dir . "/";
188 my $mod = $module . ".ko";
189 my $modulefile = `find $dir -name $mod | head -1`;
190 chomp($modulefile); 188 chomp($modulefile);
191 $filename = $modulefile; 189 $filename = $modulefile;
192 if ($filename eq "") { 190 if ($filename eq "") {