This section will guide you through the process of making your first LDAS (Linux Dump Analysis Script). Fist of all, please check your environment for dump analysis:
$ uname -r 2.4.21-9.30AX
$perl --version This is perl, v5.8.0 built for : :
$ perldoc -m Term::ReadKey # $Id: ReadKey.pm,v 1.7 2002/07/28 12:01:18 gellyfish Exp $ : : $ perldoc -m Term::ReadLine::Perl package Term::ReadLine::Perl; : :
$ crash -v crash 3.8-5 : :
You need the Linux kernel dump, system map and vmlinux. Kernel dump is taken using LKCD, netdump, diskdump and so on. System map is the table to know the address of kernel symbol (e.g. /boot/System.map ). vmlinux is the uncompressed kernel image that has been compiled with -g option.
If you don't have these files, you may be able to run Alicia using the live memory (e.g. /dev/mem).
Next steps from here are to run your Alicia.
$ alicia -crash -s map vmlinux dump Alicia 1.0.1 (build: Thu Mar 24 10:41:28 JST 2005) : :or
$ su - # alicia -crash -s
alicia> sys; SYSTEM MAP: map DEBUG KERNEL: vmlinux (2.4.21-9.35AX.reboot3smp) DUMPFILE: dump CPUS: 32 DATE: Sat Oct 9 01:13:21 2004 UPTIME: 02:04:25 LOAD AVERAGE: 65.99, 754.32, 975.01 TASKS: 2166 NODENAME: mlnx1 RELEASE: 2.4.21-9.35AX.reboot3smp VERSION: #1 SMP Wed Sep 15 11:44:07 JST 2004 MACHINE: i686 (2800 Mhz) MEMORY: 3.9 GB PANIC: "Fatal exception"
alicia> $var1 = pass_through('sys'); alicia> print $var1; SYSTEM MAP: map DEBUG KERNEL: vmlinux (2.4.21-9.35AX.reboot3smp) DUMPFILE: dump CPUS: 32 DATE: Sat Oct 9 01:13:21 2004 UPTIME: 02:04:25 LOAD AVERAGE: 65.99, 754.32, 975.01 TASKS: 2166 NODENAME: mlnx1 RELEASE: 2.4.21-9.35AX.reboot3smp VERSION: #1 SMP Wed Sep 15 11:44:07 JST 2004 MACHINE: i686 (2800 Mhz) MEMORY: 3.9 GB PANIC: "Fatal exception"
alicia> $addr = get_addr 'saved_command_line' alicia> print map { pack ("V",hex($_)) } get_mem($addr, 32) ro r/devGrouLogV rhgiet ole= alicia> $utsname = get_addr('system_utsname'); alicia> print kernel($utsname, 'new_utsname', 'release', 'char *'); 2.6.11-1.27_FC3
sub psmem { my ($text, @pss, $header, @mps); $text = pass_through('ps'); $text =~ s/>/ /g; @pss = split(/\n/, $text); $header = shift @pss; @mps = sort { (split(/\s+/,$b))[8]<=>(split(/\s+/,$a))[8]; } @pss; unshift (@mps, $header); return join "\n", @mps; } 1;
Loading the psmem.ldas on Alicia and Display the return value of psmem command.
alicia> load 'psmem.ldas' alicia> less psmem; PID PPID CPU TASK ST %MEM VSZ RSS COMM 1262 1249 6 f4bd0000 RU 0.2 49384 6932 ocssd.bin 1277 1264 25 f47de000 RU 0.2 49384 6932 ocssd.bin 1278 1264 9 f47da000 RU 0.2 49384 6932 ocssd.bin 1221 1 28 f4c46000 RU 0.1 6056 3640 xfs 28254 28233 11 f0628000 RU 0.1 3308 2320 multitask 28312 28233 29 e9300000 RU 0.1 3308 2320 multitask 2090 1 0 f42dc000 RU 0.0 3044 1672 oprofiled 1127 1 23 f5348000 IN 0.0 3776 1556 sshd
sub uname { my @member = qw(sysname nodename release version machine); my $output = ''; my $uts = get_addr('system_utsname'); $output .= kernel($uts, 'new_utsname', $_, 'char*') . ' ' for (@member); print $output, "\n"; } 1;
alicia> class 'task_struct', qw{flags pid *parent} # * for pointer alicia> my $flags = task_struct(dde8853c)->flags alicia> my $p_pid = task_struct(dde8853c)->_p_parent->pid
All Rights Reserved, Copyright © 2005, UNIADEX, Ltd.