~ubuntu-branches/ubuntu/utopic/makedumpfile/utopic

« back to all changes in this revision

Viewing changes to makedumpfile.conf.5

  • Committer: Package Import Robot
  • Author(s): John Wright
  • Date: 2012-01-22 16:49:51 UTC
  • mfrom: (1.1.5) (7.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120122164951-g3fwcvhcuo5dfwu8
* New upstream version
* Drop makedumpfile-static package, since makedumpfile depends on
  libebl, which is no longer available statically, and nobody is
  depending on makedumpfile-static anyway

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH MAKEDUMPFILE.CONF 5 "12 September 2011" "makedumpfile v1.4.0" "Linux System Administrator's Manual"
 
2
.SH NAME
 
3
makedumpfile.conf \- The filter configuration file for makedumpfile(8).
 
4
.SH DESCRIPTION
 
5
.PP
 
6
The makedumpfile.conf is a configuration file for makedumpfile tool.
 
7
makedumpfile.conf file contains the erase commands to filter out desired kernel
 
8
data from the vmcore while creating \fIDUMPFILE\fR using makedumpfile tool.
 
9
makedumpfile reads the filter config and builds the list of memory addresses
 
10
and its sizes after processing filter commands. The memory locations that
 
11
require to be filtered out are then poisoned with character \fIX\fR (58 in Hex).
 
12
.SH FILE FORMAT
 
13
.PP
 
14
The file consists of module sections that contains filter commands. A section
 
15
begins with the name of the section in square brackets and continues until the
 
16
next section begins.
 
17
 
 
18
.br
 
19
"["<\fIModuleName\fR>"]"
 
20
.br
 
21
<\fIFilterCommands\fR>
 
22
.br
 
23
 
 
24
where
 
25
.br
 
26
"[" is the character \fB[\fR
 
27
.br
 
28
"]" is the character \fB]\fR
 
29
.TP
 
30
<\fIModuleName\fR>
 
31
is either 'vmlinux' or name of a Linux kernel module.
 
32
.TP
 
33
<\fIFilterCommands\fR>
 
34
is a list of one or more filter commands as described in the section
 
35
\fBFILTER COMMANDS\fR of this manual page.
 
36
.PP
 
37
The section name indicates a kernel module name (including \fBvmlinux\fR) where
 
38
the symbols specified in subsequent erase commands belong to. The unnamed
 
39
section defaults to \fB[vmlinux]\fR section. However, a user can also explicitly
 
40
define \fB[vmlinux]\fR section. The sections help makedumpfile tool to select
 
41
appropriate kernel or module debuginfo file before processing the subsequent
 
42
erase commands. Before selecting appropriate debuginfo file, the module name
 
43
is validated against the loaded modules from the vmcore. If no match is found,
 
44
then the section is ignored and makedumpfile skips to the next module section.
 
45
If match is found, then makedumpfile will try to load the corresponding
 
46
module debuginfo file. If module debuginfo is not available then, makedumpfile
 
47
will skip the section with a warning message.
 
48
.SH FILTER COMMANDS
 
49
.SS filter command
 
50
.PP
 
51
A filter command is either an erase command or a loop construct. Each erase
 
52
command and loop construct must start with a new line. Each filter command
 
53
describes data in the dump to be erased. Syntax:
 
54
 
 
55
.br
 
56
<\fIEraseCommands\fR>|<\fILoopConstruct\fR>
 
57
.br
 
58
 
 
59
where
 
60
.TP
 
61
<\fIEraseCommands\fR>
 
62
Described in the subsection \fBerase command\fR of this manual page.
 
63
.TP
 
64
<\fILoopConstruct\fR>
 
65
Described in the subsection \fBLoop construct\fR of this manual page.
 
66
.SS erase command
 
67
.PP
 
68
Erase specified size of a kernel data referred by specified kernel/module
 
69
symbol or its member component. The erase command syntax is:
 
70
 
 
71
.br
 
72
\fBerase\fR <\fISymbol\fR>[.\fImember\fR[...]] [\fBsize\fR
 
73
<\fISizeValue\fR>[K|M]]
 
74
.br
 
75
\fBerase\fR <\fISymbol\fR>[.\fImember\fR[...]] [\fBsize\fR <\fISizeSymbol\fR>]
 
76
.br
 
77
\fBerase\fR <\fISymbol\fR>[.\fImember\fR[...]] [\fBnullify\fR]
 
78
.br
 
79
 
 
80
where
 
81
.br
 
82
.TP
 
83
<\fISymbol\fR>
 
84
A kernel or module symbol (variable) name that is part of global symbols
 
85
\fB/proc/kallsyms\fR.
 
86
.TP
 
87
<\fISizeValue\fR>
 
88
A positive integer value as a size of the data in bytes to be erased. The
 
89
suffixes 'K' and 'M' can be used to specify kilobytes and Megabytes
 
90
respectively where, K means 1024 bytes and M means 1024 ^ 2 = 1048576 bytes.
 
91
The suffixes are not case sensitive.
 
92
.TP
 
93
<\fISizeSymbol\fR>
 
94
A simple expression of the form <\fISymbol\fR>[.\fImember\fR[...]] that denotes
 
95
a symbol which contains a positive integer value as a size of the data in bytes
 
96
to be erased.
 
97
.TP
 
98
<\fISymbol\fR>[.\fImember\fR[...]]
 
99
A simple expression that results into either a global kernel symbol name or
 
100
its member components. The expression always uses '.' operator to specify
 
101
the \fImember\fR component of kernel symbol or its member irrespective of
 
102
whether it is of pointer type or not.
 
103
.TP
 
104
\fImember\fR[...]
 
105
Member or component of member in <\fISymbol\fR>.
 
106
.PP
 
107
The \fBerase\fR command takes two arguments 1. kernel symbol name or its
 
108
member components and 2. size of the data referred by argument (1) OR
 
109
\fBnullify\fR keyword. The second argument \fBsize\fR OR \fBnullify\fR is
 
110
optional. The unit for size value is in \fBbytes\fR. If \fBsize\fR option is
 
111
not specified then the size of the first argument is determined according to
 
112
its data type using dwarf info from debuginfo file. In case of '\fBchar *\fR'
 
113
data type, the length of string pointed by '\fBchar *\fR' pointer is determined
 
114
with an upper limit of 1024. The \fBsize\fR can be specified in two forms 1.
 
115
a integer value as explained above (<\fISizeValue\fR>) and 2. a simple
 
116
expression in the form of <\fISymbol\fR>[.\fImember\fR[...]]] that results into
 
117
base type (integer) variable.
 
118
.PP
 
119
If the specified <\fISymbol\fR> is of type '\fBvoid *\fR', then user needs to
 
120
provide either \fBsize\fR or \fBnullify\fR option, otherwise the erase command
 
121
will not have any effect.
 
122
.PP
 
123
The \fBnullify\fR option only works if specified <\fISymbol\fR> is a pointer.
 
124
Instead of erasing data pointed by the specified pointer \fBnullify\fR erases
 
125
the pointer value and set it to '0' (NULL). Please note that by nullifying
 
126
the pointer values may affect the debug ability of created \fIDUMPFILE\fR.
 
127
Use the \fBnullify\fR option only when the size of data to be erased is not
 
128
known.  \fBe.g.\fR data pointed by '\fBvoid *\fR'.
 
129
.PP
 
130
Let us look at the makedumpfile.conf file from the example below which was
 
131
configured to erase desired kernel data from the kernel module with name
 
132
\fBmymodule\fR. At line 1 and 3, the user has not specified size option while
 
133
erasing 'array_var' and 'mystruct1.name' symbols. Instead the user depends on
 
134
makedumpfile to automatically determine the sizes to be erased \fBi.e\fR
 
135
100 bytes for 'array_var' and 11 bytes for 'mystruct1.name'.  At line 2,
 
136
while erasing the 'mystruct1.buffer' member the user has specified the size
 
137
value 25 against the actual size of 50. In this case the user specified
 
138
\fBsize\fR takes the precedence and makedumpfile erases only 25 bytes from
 
139
\'mystruct1.buffer'. At line 4, the size of the data pointed by \fBvoid *\fR
 
140
pointer 'mystruct1.addr' is unknown. Hence the \fBnullify\fR option has been
 
141
specified to reset the pointer value to NULL. At line 5, the
 
142
\'mystruct2.addr_size' is specified as \fBsize\fR argument to determine the
 
143
size of the data pointed by \fBvoid *\fR pointer 'mystruct2.addr'.
 
144
.br
 
145
 
 
146
.B Example:
 
147
.PP
 
148
Assuming the following piece of code is from kernel module 'mymodule':
 
149
.br
 
150
 
 
151
struct s1 {
 
152
.br
 
153
        char *name;
 
154
.br
 
155
        void *addr1;
 
156
.br
 
157
        void *addr2;
 
158
.br
 
159
        char buffer[50];
 
160
.br
 
161
};
 
162
.br
 
163
struct s2 {
 
164
.br
 
165
        void *addr;
 
166
.br
 
167
        long addr_size;
 
168
.br
 
169
};
 
170
.br
 
171
 
 
172
/* Global symbols */
 
173
.br
 
174
char array_var[100];
 
175
.br
 
176
struct s1 mystruct1;
 
177
.br
 
178
struct s2 *mystruct2;
 
179
.br
 
180
 
 
181
int foo()
 
182
.br
 
183
{
 
184
.br
 
185
        ...
 
186
.br
 
187
        s1.name = "Hello World";
 
188
.br
 
189
        ...
 
190
.br
 
191
}
 
192
.br
 
193
 
 
194
\fBmakedumpfile.conf:\fR
 
195
.br
 
196
[mymodule]
 
197
.br
 
198
erase array_var
 
199
.br
 
200
erase mystruct1.buffer size 25
 
201
.br
 
202
erase mystruct1.name
 
203
.br
 
204
erase mystruct1.addr1 nullify
 
205
.br
 
206
# Assuming addr2 points to 1024 bytes
 
207
.br
 
208
erase mystruct1.addr2 size 1K
 
209
.br
 
210
erase mystruct2.addr size mystruct2.addr_size
 
211
.br
 
212
.B EOF
 
213
 
 
214
.SS Loop construct
 
215
.PP
 
216
A Loop construct allows the user to traverse the linked list or array elements
 
217
and erase the data contents referred by each element.
 
218
 
 
219
.br
 
220
\fBfor\fR <\fIid\fR> \fBin\fR {<\fIArrayVar\fR> |
 
221
.br
 
222
                   <\fIStructVar\fR> \fBvia\fR <\fINextMember\fR> |
 
223
.br
 
224
                   <\fIListHeadVar\fR> \fBwithin\fR
 
225
<\fIStructName\fR>\fB:\fR<\fIListHeadMember\fR>}
 
226
.br
 
227
        \fBerase\fR <\fIid\fR>[.\fIMemberExpression\fR]
 
228
[\fBsize\fR <\fISizeExpression\fR>|\fBnullify\fR]
 
229
.br
 
230
        [\fBerase\fR <\fIid\fR>...]
 
231
.br
 
232
        [...]
 
233
.br
 
234
\fBendfor\fR
 
235
.PP
 
236
where
 
237
.PP
 
238
.TP
 
239
<\fIid\fR>
 
240
Arbitrary name used to temporarily point to elements of the list. This is
 
241
also called iteration variable.
 
242
.TP
 
243
<\fIArrayVar\fR>
 
244
A simple expression in the form of <\fISymbol\fR>[.\fImember\fR[...]] that
 
245
results into an array variable.
 
246
.TP
 
247
<\fIStructVar\fR>
 
248
A simple expression in the form of <\fISymbol\fR>[.\fImember\fR[...]] that
 
249
results into a variable that points to a structure.
 
250
.TP
 
251
<\fINextMember\fR>
 
252
Member within <\fIStructVar\fR> that points to an object of same type that of
 
253
<\fIStructVar\fR>.
 
254
.TP
 
255
<\fIListHeadVar\fR>
 
256
A simple expression in the form of <\fISymbol\fR>[.\fImember\fR[...]] that
 
257
results into a variable of type struct list_head.
 
258
.TP
 
259
<\fIStructName\fR>
 
260
Name of the structure type that can be traversed using HEAD variable
 
261
<\fIListHeadVar\fR> and contains a member named <\fIListHeadMember\fR>.
 
262
.TP
 
263
<\fIListHeadMember\fR>
 
264
Name of a member in <\fIStructName\fR>, of type struct list_head.
 
265
.TP
 
266
<\fIMemberExpression\fR>
 
267
A simple expression in the form of [.\fImember\fR[...]] to specify a member
 
268
or component of an element in <\fIArrayVar\fR>, <\fIStructVar\fR>
 
269
or <\fIStructName\fR>.
 
270
.TP
 
271
<\fISizeExpression\fR>
 
272
Size value in the form of <\fISizeValue\fR>, <\fIid\fR>[.\fIMemberExpression\fR]
 
273
or <\fISymbol\fR>[.\fImember\fR[...]].
 
274
.PP
 
275
The \fBfor\fR loop construct allows to iterate on list of elements in an array
 
276
or linked lists. Each element in the list is assigned to iteration variable
 
277
<\fIid\fR>. The type of the iteration variable is determined by that of the
 
278
list elements. The entry specified after '\fBin\fR' terminal is called LIST
 
279
entry. The LIST entry can be an array variable, structure variable/pointer or a
 
280
struct list_head type variable. The set of \fBerase\fR commands specified
 
281
between \fBfor\fR and \fBendfor\fR, will be executed for each element in the
 
282
LIST entry.
 
283
.PP
 
284
If the LIST entry specified is an array variable, then the loop will be
 
285
executed for each array element. The size of the array will be determined by
 
286
using dwarf information.
 
287
.PP
 
288
If the LIST entry specified is a structure variable/pointer, then a traversal
 
289
member (<\fINextMember\fR>) must be specified using '\fBvia\fR' terminal. The
 
290
\fBfor\fR loop will continue until the value of traversal member is NULL or
 
291
matches with address of the first node <\fIStructVar\fR> if it is a circular
 
292
linked list.
 
293
.PP
 
294
If the LIST entry is specified using a struct list_head type variable, then
 
295
\fBwithin\fR terminal must be used to specify the structure name
 
296
<\fIStructName\fR> that is surrounding to it along with the struct list_head
 
297
type member after '\fB:\fR' which is part of the linked list. In the erase
 
298
statement <\fIid\fR> then denotes the structure that the list_head is
 
299
contained in (ELEMENT_OF).
 
300
.PP
 
301
The below example illustrates how to use loop construct for traversing
 
302
Array, linked list via next member and list_head.
 
303
 
 
304
.B Example:
 
305
.PP
 
306
Assuming following piece of code is from kernel module 'mymodule':
 
307
.br
 
308
 
 
309
struct s1 {
 
310
.br
 
311
        struct *next;
 
312
.br
 
313
        struct list_head list;
 
314
.br
 
315
        char private[100];
 
316
.br
 
317
        void *key;
 
318
.br
 
319
        long key_size;
 
320
.br
 
321
};
 
322
.br
 
323
 
 
324
/* Global symbols */
 
325
.br
 
326
struct s1 mystruct1;
 
327
.br
 
328
static LIST_HEAD(s1_list_head);
 
329
.br
 
330
struct s1 myarray[100];
 
331
.br
 
332
 
 
333
void foo()
 
334
.br
 
335
{
 
336
.br
 
337
        struct s1 *s1_ptr;
 
338
.br
 
339
        ...
 
340
.br
 
341
        ...
 
342
.br
 
343
        s1_ptr = malloc(...);
 
344
.br
 
345
        ...
 
346
.br
 
347
        ...
 
348
.br
 
349
        list_add(&s1_ptr->list, &s1_list_head);
 
350
.br
 
351
        ...
 
352
.br
 
353
}
 
354
.br
 
355
 
 
356
\fBmakedumpfile.conf:\fR
 
357
.br
 
358
[mymodule]
 
359
.br
 
360
# erase private fields from list starting with mystruct1 connected via
 
361
.br
 
362
# 'next' member:
 
363
.br
 
364
for mys1 in mystruct1 via next
 
365
.br
 
366
        erase mys1.private
 
367
.br
 
368
        erase mys1.key size mys1.key_size
 
369
.br
 
370
endfor
 
371
.br
 
372
 
 
373
# erase private fields from list starting with list_head variable
 
374
.br
 
375
# s1_list_head.
 
376
.br
 
377
for mys1 in s1_list_head.next within s1:list
 
378
.br
 
379
        erase mys1.private
 
380
.br
 
381
        erase mys1.key size mys1.key_size
 
382
.br
 
383
endfor
 
384
.br
 
385
 
 
386
# erase private fields from all elements of the array myarray:
 
387
.br
 
388
for mys1 in myarray
 
389
.br
 
390
        erase mys1.private
 
391
.br
 
392
        erase mys1.key size mys1.key_size
 
393
.br
 
394
endfor
 
395
.br
 
396
.B EOF
 
397
.PP
 
398
In the above example, the first \fBfor\fR construct traverses the linked list
 
399
through a specified structure variable \fBmystruct1\fR of type \fBstruct s1\fR.
 
400
The linked list can be traversed using '\fBnext\fR' member of \fBmystruct1\fR.
 
401
Hence a \fBvia\fR terminal has been used to specify the traversal member
 
402
name '\fBnext\fR'.
 
403
.PP
 
404
The second \fBfor\fR construct traverses the linked list through a specified
 
405
struct list_head variable \fBs1_list_head.next\fR. The global symbol
 
406
\fBs1_list_head\fR is a start address of the linked list and its \fBnext\fR
 
407
member points to the address of struct list_head type member '\fBlist\fR' from
 
408
\fBstruct s1\fR. Hence a \fBwithin\fR terminal is used to specify the structure
 
409
name '\fBs1\fR' that can be traversed using \fBs1_list_head.next\fR variable
 
410
along with the name of struct list_head type member '\fBlist\fR' which is part
 
411
of the linked list that starts from \fBs1_list_head\fR global symbol.
 
412
.PP
 
413
The third \fBfor\fR construct traverses the array elements specified through
 
414
a array variable \fBmyarray\fR.
 
415
.br
 
416
.SH SEE ALSO
 
417
.PP
 
418
makedumpfile(8)
 
419