macros for different classes of network
[unix-history] / .ref-BSD-3 / usr / man / man1 / analyze.1m
CommitLineData
6dc518d4
OB
1.TH ANALYZE 1M
2.UC
3.SH NAME
4analyze \- Virtual UNIX postmortem crash analyzer
5.SH SYNOPSIS
6.B analyze
7[
8.B \-s
9swapfile
10] [
11.B \-fmdDv
12]
13corefile
14[ system ]
15.SH DESCRIPTION
16.I Analyze
17is the post-mortem analyzer for the state of the paging system.
18The following procedure should be followed when the paging system
19crashes:
20.IP 1)
21Following normal crash dump procedures, dump the PSL, registers
22and the top 40 or so locations of the kernel stack on the console,
23and then take a core image dump on tape.
24.IP 2)
25Boot a version of the system which pages or swaps in an area distinct
26from the paging system.
27.IP 3)
28Fix the root file system and then copy the mag tape into the file
29.I /vmcore
30(cp will do fine).
31.IP 4)
32Run the command ``analyze \-s /dev/drum /vmcore /vmunix'' and save
33the output for a systems programmer.
34.IP 5)
35Follow the normal reboot procedure to resume operations.
36.IP 6)
37When the system is up again, run the command ``pstat \-pxk /vmcore /vmunix''
38and route the output to a hardcopy device.
39.PP
40The outputs from the above procedure will get you started investigating
41the cause of the crash, if it was paging related. For details
42on the internal data structures of the system see the document
43.I "Data Structures added in the Berkeley Virtual Memory Extensions to the UNIX System"
44A listing of the system will also be handy while examining the core dump.
45It is suggested that you save the file
46.I /vmcore
47in a less volatile place if you want to make sure it is not clobbered.
48.PP
49The
50.I analyze
51program reads the relevant system data structures from the core
52image file and coordinates these with the information on the disk
53to determine the state of the paging subsystem at the point of crash.
54It looks at each process in the system, and the resources each is
55using in an attempt to determine inconsistencies in the paging system
56state. Normally, the output consists of a sequence of lines showing
57each active process, its state (whether swapped in or not), its
58.I p0br,
59and the number and location of its page table pages.
60Any pages which are locked while raw i/o is in progress, or which
61are locked because they are
62.I intransit
63are also printed. (Intransit text pages often diagnose as duplicated;
64you will have to weed these out by hand.)
65.PP
66The program checks that any pages in core which are marked as not
67modified are, in fact, identical to the swap space copies.
68It also checks for non-overlap of the swap space, and that the core
69map entries correspond to the page tables.
70The state of the free list is also checked.
71.PP
72Options to
73.I analyze
74include
75.B \-m
76which causes the entire coremap state to be dumped,
77.B \-D
78which causes the diskmap for each process to be printed,
79.B \-d
80which causes the (sorted) paging area usage to be printed,
81.B \-v
82(long unused) which causes a hugely verbose output format to be used,
83and
84.B \-f
85which causes the free list to be dumped.
86.PP
87In general, the output from this program can be confused by processes
88which were forking, swapping, or exiting or
89happened to be in unusual states when the
90crash occurred. You should examine the flags field of the output of
91.I pstat
92to help filter out such processes.
93.PP
94You can look at the core dump with
95.I adb
96if you do
97.IP
98adb /vmunix /vmcore
99.br
100.lg 0
101/m 80000000 #ffffffff
102.LP
103which fixes the map of
104.I vmcore
105so that symbols in data space will work.
106It will be necessary to do
107.IP
108.lg 0
109?m 80000000 #ffffffff
110.LP
111to get text symbols to work also.
112You can then look at the
113.I Umap
114array to see the
115.I u.
116pages of the process which was running at the point of the crash.
117Find the first number in the output of
118.I pstat.
119You should be able to find the kernel stack at the point of crash
120either as the stack in the
121.I u.
122area for this process or in the interrupt stack
123.I intstack.
124.PP
125Note that the debugger is looking at the physical memory at the point
126of crash; you will have to determine which pages of physical memory
127the stack is in if you wish to look at it by computing
1280x80000000 + Umap[i] * 0x200.
129A similar computation will give addresses of page table pages. Thus
130if
131.I analyze
132says that a processes page tables are in page 218 (hex of course), then
133you can look at them by looking at address 0x80043000 in the dump, i.e.
134``80043000,80/X'' will print the page of page tables.
135.SH FILES
136/vmunix default system namelist
137.SH SEE ALSO
138``Data Structures added in the Berkeley Virtual Memory Extensions to the UNIX System'',
139crash(8), pstat(1m), ps(1)
140.SH AUTHORS
141Ozalp Babaoglu and William Joy
142.SH DIAGNOSTICS
143Various diagnostics about overlaps in swap mappings, missing swap mappings,
144page table entries inconsistent with the core map, incore pages which
145are marked clean but differ from disk-image copies, pages which are
146locked or intransit, and inconsistencies in the free list.
147.PP
148It would be nice if this program analyzed the system in general, rather
149than just the paging system in particular.