]> git.lizzy.rs Git - plan9front.git/blob - sys/man/6/snap
/sys/man/*/*: fix perms (sorry)
[plan9front.git] / sys / man / 6 / snap
1 .TH SNAP 6
2 .SH NAME
3 snap \- process snapshots
4 .SH DESCRIPTION
5 Process snapshots are used to
6 save a process image for debugging on 
7 another machine or at another time.
8 They are like old Unix core dumps but 
9 can hold multiple process images and
10 are smaller.
11 .PP
12 The first line of a snapshot begins with the prefix
13 ``process snapshot'' and often contains
14 other information as well, such as creation time,
15 user name, system name, cpu type, and kernel type.
16 This information is intended for humans, not programs.
17 Programs reading snapshots should only
18 check that this line begins with the specified prefix.
19 .PP
20 Throughout the rest of the snapshot, decimal strings are
21 always right-justified, blank-padded to at least 11 characters,
22 and followed by a single space character.
23 .PP
24 The rest of the snapshot is one or more records,
25 each of which begins with a one-line header.
26 This header is a decimal process id followed by
27 an identification string, which denotes the type of
28 data in the record.
29 .PP
30 Records of type 
31 .BR fd ,
32 .BR fpregs ,
33 .BR kregs ,
34 .BR noteid ,
35 .BR ns ,
36 .BR proc ,
37 .BR regs ,
38 .BR segment ,
39 and
40 .BR status 
41 are all formatted as a decimal number 
42 .I n
43 followed by 
44 .I n
45 bytes of data.
46 This data is the contents of the file
47 of the same name found in 
48 .BR /proc .
49 .PP
50 The format of the 
51 .B mem
52 and 
53 .B text
54 sections is not as simple.
55 These sections contain one or more page descriptions.
56 Each describes a one kilobyte page of data.
57 If the section is not a multiple of a kilobyte in size,
58 the last page will be shorter.
59 Each description begins with a one-byte
60 flag.
61 If the flag is
62 .BR r ,
63 then it is followed by
64 a page of binary data.
65 If the flag is
66 .BR z ,
67 then the data is understood to be zeros,
68 and is omitted.
69 If the flag is 
70 .B m 
71 or 
72 .BR t ,
73 then it is followed by two decimal strings 
74 .I p
75 and
76 .IR o ,
77 indicating that this page is the same
78 as the page at offset
79 .I o
80 of the memory or text
81 segment for process 
82 .IR p .
83 This data must have been previously
84 described in the snapshot, and the offset
85 must be a multiple of a kilobyte.
86 .PP
87 It is not guaranteed that any of the sections
88 described above be in a process snapshot,
89 although the snapshot quickly becomes useless when
90 too much is missing.
91 .PP
92 Memory and text images may be incomplete.
93 The memory or text file for a given process
94 may be split across multiple disjoint sections
95 in the snapshot.
96 .SH SEE ALSO
97 .IR proc (3),
98 .IR snap (4).