All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: Keith Owens <kaos@melbourne.sgi.com>
Cc: Martin Michlmayr <tbm@cyrius.com>, linux-mips@oss.sgi.com
Subject: Re: Kernel Oops when booting on DECstation
Date: Mon, 18 Dec 2000 10:48:52 -0800	[thread overview]
Message-ID: <3A3E5C14.F116DCBB@mvista.com> (raw)
In-Reply-To: 23987.976979391@ocs3.ocs-net

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

Keith Owens wrote:
> 
> On Sat, 16 Dec 2000 16:00:51 +0100,
> Martin Michlmayr <tbm@cyrius.com> wrote:
> >ksymoops 2.3.5 on i586 2.2.15.  Options used
> >     -a mipsel
> >Using defaults from ksymoops -t elf32-i386
> 
> The joys of cross system debugging.  You need to set ksymoops option
> -t, it is defaulting to elf32-i386 which is no good for mips objects.
> You almost certainly need to set environment variables KSYMOOPS_NM and
> KSYMOOPS_OBJDUMP to point to versions of these programs that understand
> mips.  If mips prints the code in big endian format then you need to
> use ksymoops option -e.  man ksymoops and scan for 'cross'.

Martin,

If you have System.map file, you can use a perl script written by Phil to
decode the trace.

Jun

[-- Attachment #2: call2sym --]
[-- Type: text/plain, Size: 2754 bytes --]

#!/usr/bin/perl

# call2sym -  convert linux kernel oops call trace listings to System.map
#             symbolic names.
#
# Written by Phil Hollenback
# Copyright (C) 2000 Phil Hollenback <phollenback@pobox.com>
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
# All other rights reserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# See the perlpod documentation at the end of this file for
# instructions.
#
# $Id: call2sym,v 1.2 2000/09/28 20:15:59 phil Exp $

#
# Configuration Options
#

# This will be viewable thru the "-v" switch at a later date.
$version = "0.0.1";

#
# End Configuration Options
#

# Check that we got passed a System.map file on the command line.
(scalar(@ARGV) == 1) or $mapfile = "System.map";
(scalar(@ARGV) == 1) and $mapfile = $ARGV[0];

( -r $mapfile ) or die "Can't read file $mapfile\n";

print "Ready for call trace list.  <ctrl-d> on a blank line when done.\n\n";

while (<STDIN>)
  {
    # remove newlines in case this was a cut-n-paste.
    chop;
    $trace_line .= $_;
  }

print "\nProcessing...\n";

# Now munge call trace entries into an array.
@trace_addrs = ();

# Split into an array of addresses, on whitespace.
@trace_addrs = split / /,$trace_line;

# I think I'm clever, so use a map to remove cruft from each array
# entry.
@trace_addrs = map { m|\[<(.*)>\]| } @trace_addrs;

# I now have an in-order array of the call trace addresses.

# Suck the whole mapfile into a hash keyed on address.  Convert keys to
# decimal for easier compares later on.
open MAPFILE, $mapfile or die "Can't open mapfile $mapfile\n";
while (<MAPFILE>)
  {
    if ( /^00000000(.*) . (.*)/ )
      {
        # convert to decimal and pad to 10 digits.
        # that way everything lines up and conversions should be easy.
        $decaddr = sprintf "%010lu", hex($1);
        $funcs{$decaddr} = $2;
      }
  }

# print a header
print "\nAddress\t\tFunction\n\n";

# We've got all the addresses in the hash as string versions of
# decimal numbers. Should now be able to iterate thru the
# list until we find the one closest to each $addr.
foreach $addr (@trace_addrs)
  {
    # convert addr to decimal.
    $decaddr = hex($addr);

    # loop through keys until we find the one just 1 greater.
    foreach $func (sort keys %funcs)
      {
        # now print out the one just 1 less.
        if ($func > $decaddr ) {
          print  "$addr\t$funcs{$lastfunc}\n";
          last;
        }
        $lastfunc = $func;
      }
  }




  parent reply	other threads:[~2000-12-18 18:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-16  7:56 Kernel Oops when booting on DECstation Martin Michlmayr
2000-12-16 10:20 ` Karel van Houten
2000-12-16 10:20   ` Karel van Houten
2000-12-16 11:19 ` Keith Owens
2000-12-16 15:00   ` Martin Michlmayr
2000-12-16 15:09     ` Keith Owens
2000-12-17 20:23       ` Martin Michlmayr
2000-12-18 18:48       ` Jun Sun [this message]
2000-12-18 11:07 ` Florian Lohoff
2000-12-19 12:48   ` Martin Michlmayr
2000-12-19 17:03     ` Harald Koerfgen
2000-12-19 17:09       ` Karel van Houten
2000-12-19 17:09         ` Karel van Houten
2000-12-22 10:44     ` Maciej W. Rozycki

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=3A3E5C14.F116DCBB@mvista.com \
    --to=jsun@mvista.com \
    --cc=kaos@melbourne.sgi.com \
    --cc=linux-mips@oss.sgi.com \
    --cc=tbm@cyrius.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.