makedumpfile: Add '--config' option to specify filterconfig file.
Subsystems (2)
Hi Mahesh
Quoted 21 lines · Mahesh J Salgaonkar
From: Mahesh Salgaonkar <[email protected]>
This patch adds '--config' option to specify config file that contains filter commands to filter out desired kernel data and it's members.
Updated makedumpfile man page with '--config' option info.
Signed-off-by Mahesh Salgaonkar <[email protected]>Signed-off-by Prerna Saxena <[email protected]>---
makedumpfile.8 | 20 +++++++++++++++++++- makedumpfile.c | 17 +++++++++++++++++ makedumpfile.h | 7 +++++++ 3 files changed, 43 insertions(+), 1 deletions(-)makedumpfile.8 +0
-0
makedumpfile.8 makedumpfile \- make a small dumpfile of kdump · line 13
Quoted 8 lines
makedumpfile.8 +2
-0@@ -6,6 +6,8 @@ makedumpfile \- make a small dumpfile of kdump .br \fBmakedumpfile\fR \-F [\fIOPTION\fR] [\-x \fIVMLINUX\fR|\-i \fIVMCOREINFO\fR] \fIVMCORE\fR .br +\fBmakedumpfile\fR [\fIOPTION\fR] \-x \fIVMLINUX\fR \-\-config \fIFILTERCONFIGFILE\fR \fIVMCORE\fR \fIDUMPFILE\fR +.br \fBmakedumpfile\fR \-R \fIDUMPFILE\fR .br \fBmakedumpfile\fR \-\-split [\fIOPTION\fR] [\-x \fIVMLINUX\fR|\-i \fIVMCOREINFO\fR] \fIVMCORE\fR \fIDUMPFILE1\fR \fI
DUMPFILE2\fR [\fIDUMPFILE3\fR ..]
Quoted 66 lines
makedumpfile.8 +17
-1@@ -55,6 +57,15 @@ compression support. The ELF format is readable with GDB and the crash utility. If a user wants to use GDB, \fIDUMPFILE\fR format has to be explicitly specified to be the ELF format. .PP +Apart from the exclusion of unnecessary pages mentioned above, makedumpfile +allows user to filter out targeted kernel data. The filter config file can +be used to specify kernel/module symbols and its members that need to be +filtered out through the erase command syntax. makedumpfile reads the filter +config and builds the list of memory addresses and its sizes after processing +filter commands. The memory locations that require to be filtered out are +then poisoned with character 'X' (58 in Hex). Refer to \fBfilter.conf(8)\fR +for file format. +.PP To analyze the first kernel's memory usage, makedumpfile can refer to \fIVMCOREINFO\fR instead of \fIVMLINUX\fR. \fIVMCOREINFO\fR contains the first kernel's information (structure size, field offset, etc.), and \fIVMCOREINFO\fR@@ -232,6 +243,13 @@ specified. # makedumpfile \-g vmcoreinfo \-x vmlinux .TP +\fB\-\-config\fR \fIFILTERCONFIGFILE\fR +Used in conjunction with \-x \fIVMLINUX\fR option, to specify the filter +config file \fIFILTERCONFIGFILE\fR that contains erase commands to filter out +desired kernel data from vmcore while creating \fIDUMPFILE\fR. For filter +command syntax please refer to \fBfilter.conf(8)\fR. + +.TP \fB\-F\fR Output the dump data in the flattened format to the standard output for transporting the dump data by SSH.@@ -482,5 +500,5 @@ Written by Masaki Tachibana, and Ken'ichi Ohmichi. .SH SEE ALSO .PP -crash(8), gdb(1), kexec(8) +crash(8), gdb(1), kexec(8), filter.conf(8)makedumpfile.c +10
-0@@ -636,6 +636,11 @@ print_usage(void)MSG (" Creating DUMPFILE:\n" );MSG (" # makedumpfile [-c|-E] [-d DL] [-x VMLINUX|-i VMCOREINFO] VMCORE DUMPFILE\n" );MSG ("\n" ); +MSG (" Creating DUMPFILE with filtered kernel data specified through filter config\n" ); +MSG (" file:\n" ); +MSG (" # makedumpfile [-c|-E] [-d DL] -x VMLINUX --config FILTERCONFIGFILE VMCORE\n" ); +MSG (" DUMPFILE\n" ); +MSG ("\n" );MSG (" Outputting the dump data in the flattened format to the standard output:\n" );MSG (" # makedumpfile -F [-c|-E] [-d DL] [-x VMLINUX|-i VMCOREINFO] VMCORE\n" );MSG ("\n" );@@ -714,6 +719,11 @@ print_usage(void)MSG (" other system that is running the same first kernel. [-x VMLINUX] must\n" );MSG (" be specified.\n" );MSG ("\n" ); +MSG (" [--config FILTERCONFIGFILE]:\n" ); +MSG (" Used in conjunction with -x VMLINUX option, to specify the filter config\n" ); +MSG (" file that contains filter commands to filter out desired kernel data\n" ); +MSG (" from vmcore while creating DUMPFILE.\n" ); +MSG ("\n" );MSG (" [-F]:\n" );MSG (" Output the dump data in the flattened format to the standard output\n" );MSG (" for transporting the dump data by SSH.\n" );
makedumpfile.c check_param_for_creating_dumpfile(int argc, char *argv[]) · line 7745
Quoted 7 lines
makedumpfile.c +2
-0@@ -7729,6 +7739,9 @@ check_param_for_creating_dumpfile(int argc, char *argv[])if (info->flag_flatten && info->flag_split)return FALSE; +if (info->name_filterconfig && !info->name_vmlinux) +return FALSE;
A new option '--config makedumpfile.conf' always needs an option '-x debug_info_file', doesn't it?
Once I heard that a debug_info file(i.e. vmlinux) was too large to be included in 2nd kernel's initrd.
So instead of a debug_info_file, small text files generated by '-g debug_info_file' were introduced.
Now a debug information is read from /proc/vmcore.
Do you want to use '--config' while 2nd kernel is running? But I think it's impossible on usual distributers' environment, because vmlinux is not included in 2nd kernel's initrd.
So I suppose you use this option as follows:
1.Panic occurs.
2.2nd kernel is activated.
3.makedumpfile makes a dump file from /proc/vmcore without '--config'. 4.1st kernel is reactivated.
5.makedumpfile makes a masked dump file from the above dump file
with '--config'.
Am I right?
Thanks
tachibana
Quoted 42 lines
makedumpfile.c +1
-0+ if ((argc == optind + 2) && !info->flag_flattenmakedumpfile.c +4
-0&& !info->flag_split) {/* @@ -7821,6 +7834,7 @@ static struct option longopts[] = { {"message-level", required_argument, NULL, 'm'}, {"vtop", required_argument, NULL, 'V'}, {"dump-dmesg", no_argument, NULL, 'M'}, + {"config", required_argument, NULL, 'C'}, {"help", no_argument, NULL, 'h'}, {0, 0, 0, 0} };@@ -7851,6 +7865,9 @@ main(int argc, char *argv[])case 'b' : info->block_order =atoi (optarg);break ; +case 'C' : + info->name_filterconfig = optarg; +break ;case 'c' : info->flag_compress =1 ;break ;makedumpfile.h +7
-0@@ -888,6 +888,13 @@ struct DumpInfo {unsigned long vmemmap_end;/* +* Filter config file containing filter commands to filter out kernel +* data from vmcore. +*/ +char *name_filterconfig; +FILE *file_filterconfig; + +/* * diskdimp info: */ int block_order;
Quoted 4 lines
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 105 lines · On 05/23/2011 02:39 PM, [email protected] wrote:
Hi Mahesh
Quoted 21 lines · Mahesh J Salgaonkar
From: Mahesh Salgaonkar <[email protected]>
This patch adds '--config' option to specify config file that contains filter commands to filter out desired kernel data and it's members.
Updated makedumpfile man page with '--config' option info.
Signed-off-by Mahesh Salgaonkar <[email protected]>Signed-off-by Prerna Saxena <[email protected]>---
makedumpfile.8 | 20 +++++++++++++++++++- makedumpfile.c | 17 +++++++++++++++++ makedumpfile.h | 7 +++++++ 3 files changed, 43 insertions(+), 1 deletions(-)makedumpfile.8 +0
-0makedumpfile.8 makedumpfile \- make a small dumpfile of kdump · line 13
Quoted 8 lines
makedumpfile.8 +2
-0@@ -6,6 +6,8 @@ makedumpfile \- make a small dumpfile of kdump .br \fBmakedumpfile\fR \-F [\fIOPTION\fR] [\-x \fIVMLINUX\fR|\-i \fIVMCOREINFO\fR] \fIVMCORE\fR .br +\fBmakedumpfile\fR [\fIOPTION\fR] \-x \fIVMLINUX\fR \-\-config \fIFILTERCONFIGFILE\fR \fIVMCORE\fR \fIDUMPFILE\fR +.br \fBmakedumpfile\fR \-R \fIDUMPFILE\fR .br \fBmakedumpfile\fR \-\-split [\fIOPTION\fR] [\-x \fIVMLINUX\fR|\-i \fIVMCOREINFO\fR] \fIVMCORE\fR \fIDUMPFILE1\fR \fIDUMPFILE2\fR [\fIDUMPFILE3\fR ..]
Quoted 69 lines
makedumpfile.8 +17
-1@@ -55,6 +57,15 @@ compression support. The ELF format is readable with GDB and the crash utility. If a user wants to use GDB, \fIDUMPFILE\fR format has to be explicitly specified to be the ELF format. .PP +Apart from the exclusion of unnecessary pages mentioned above, makedumpfile +allows user to filter out targeted kernel data. The filter config file can +be used to specify kernel/module symbols and its members that need to be +filtered out through the erase command syntax. makedumpfile reads the filter +config and builds the list of memory addresses and its sizes after processing +filter commands. The memory locations that require to be filtered out are +then poisoned with character 'X' (58 in Hex). Refer to \fBfilter.conf(8)\fR +for file format. +.PP To analyze the first kernel's memory usage, makedumpfile can refer to \fIVMCOREINFO\fR instead of \fIVMLINUX\fR. \fIVMCOREINFO\fR contains the first kernel's information (structure size, field offset, etc.), and \fIVMCOREINFO\fR@@ -232,6 +243,13 @@ specified. # makedumpfile \-g vmcoreinfo \-x vmlinux .TP +\fB\-\-config\fR \fIFILTERCONFIGFILE\fR +Used in conjunction with \-x \fIVMLINUX\fR option, to specify the filter +config file \fIFILTERCONFIGFILE\fR that contains erase commands to filter out +desired kernel data from vmcore while creating \fIDUMPFILE\fR. For filter +command syntax please refer to \fBfilter.conf(8)\fR. + +.TP \fB\-F\fR Output the dump data in the flattened format to the standard output for transporting the dump data by SSH.@@ -482,5 +500,5 @@ Written by Masaki Tachibana, and Ken'ichi Ohmichi. .SH SEE ALSO .PP -crash(8), gdb(1), kexec(8) +crash(8), gdb(1), kexec(8), filter.conf(8)makedumpfile.c +10
-0@@ -636,6 +636,11 @@ print_usage(void)MSG (" Creating DUMPFILE:\n" );MSG (" # makedumpfile [-c|-E] [-d DL] [-x VMLINUX|-i VMCOREINFO] VMCORE DUMPFILE\n" );MSG ("\n" ); +MSG (" Creating DUMPFILE with filtered kernel data specified through filter config\n" ); +MSG (" file:\n" ); +MSG (" # makedumpfile [-c|-E] [-d DL] -x VMLINUX --config FILTERCONFIGFILE VMCORE\n" ); +MSG (" DUMPFILE\n" ); +MSG ("\n" );MSG (" Outputting the dump data in the flattened format to the standard output:\n" );MSG (" # makedumpfile -F [-c|-E] [-d DL] [-x VMLINUX|-i VMCOREINFO] VMCORE\n" );MSG ("\n" );@@ -714,6 +719,11 @@ print_usage(void)MSG (" other system that is running the same first kernel. [-x VMLINUX] must\n" );MSG (" be specified.\n" );MSG ("\n" ); +MSG (" [--config FILTERCONFIGFILE]:\n" ); +MSG (" Used in conjunction with -x VMLINUX option, to specify the filter config\n" ); +MSG (" file that contains filter commands to filter out desired kernel data\n" ); +MSG (" from vmcore while creating DUMPFILE.\n" ); +MSG ("\n" );MSG (" [-F]:\n" );MSG (" Output the dump data in the flattened format to the standard output\n" );MSG (" for transporting the dump data by SSH.\n" );@@ -7729,6 +7739,9 @@ check_param_for_creating_dumpfile(int argc, char *argv[])if (info->flag_flatten && info->flag_split)return FALSE;
Quoted 5 lines
makedumpfile.c check_param_for_creating_dumpfile(int argc, char *argv[]) · line 7743
Quoted 2 lines
makedumpfile.c +2
-0+if (info->name_filterconfig && !info->name_vmlinux) +return FALSE;A new option '--config makedumpfile.conf' always needs an option '-x
debug_info_file', doesn't it?
Yes, '-x' is mandatory while using '--config' option.
Quoted 16 lines
Once I heard that a
debug_infofile(i.e. vmlinux) was too large to be included in 2nd kernel's initrd.
So instead of adebug_info_file, small text files generated by '-gdebug_info_file' were introduced.
Now a debug information is read from/proc/vmcore.
Do you want to use '--config' while 2nd kernel is running? But I think it's impossible on usual distributers' environment, because vmlinux is not included in 2nd kernel's initrd.
So I suppose you use this option as follows:
1.Panic occurs.
2.2nd kernel is activated.
3.makedumpfile makes a dump file from/proc/vmcorewithout '--config'. 4.1st kernel is reactivated.
5.makedumpfile makes a masked dump file from the above dump file
with '--config'.
Quoted 1 line
Am I right?
Yes.
Quoted 48 lines
Thanks
tachibanaQuoted 42 lines
makedumpfile.c +5
-0+if ((argc == optind +2 ) && !info->flag_flatten && !info->flag_split) {/* @@ -7821,6 +7834,7 @@ static struct option longopts[] = { {"message-level", required_argument, NULL, 'm'}, {"vtop", required_argument, NULL, 'V'}, {"dump-dmesg", no_argument, NULL, 'M'}, + {"config", required_argument, NULL, 'C'}, {"help", no_argument, NULL, 'h'}, {0, 0, 0, 0} };@@ -7851,6 +7865,9 @@ main(int argc, char *argv[])case 'b' : info->block_order =atoi (optarg);break ; +case 'C' : + info->name_filterconfig = optarg; +break ;case 'c' : info->flag_compress =1 ;break ;makedumpfile.h +7
-0@@ -888,6 +888,13 @@ struct DumpInfo {unsigned long vmemmap_end;/* +* Filter config file containing filter commands to filter out kernel +* data from vmcore. +*/ +char *name_filterconfig; +FILE *file_filterconfig; + +/* * diskdimp info: */ int block_order;
Quoted 9 lines
Quoted 4 lines
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec