-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrash_maintenance.html
8381 lines (7555 loc) · 308 KB
/
crash_maintenance.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<HTML>
<HEAD>
<TITLE>crash utility maintenance guide</TITLE>
</HEAD>
<BODY>
<TABLE WIDTH=800PX>
<TR><TD style="font-size:34px">
<DIV ALIGN="CENTER"><B>Crash Utility Maintenance Guide</B></DIV>
</TR></TD>
</TABLE>
<P>
<TABLE>
<TR><TD>
Dave Anderson
</TD></TR>
</TABLE>
<P>Copyright © 2020 by Red Hat, Inc.<BR>
Copyright © 2021 by NEC Corporation</P>
<TABLE WIDTH=800PX>
<TR><TD>
Permission is granted to copy, distribute and/or modify this document under
the terms of the GNU Free Documentation License, Version 1.2 or any later
version published by the Free Software Foundation; with no Invariant Sections,
no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is
included in the section entitled "GNU Free Documentation License".
</TR></TD>
</TABLE>
<A NAME="contents"><BR><HR ALIGN=LEFT WIDTH=800PX><BR></A>
<TABLE WIDTH=800PX>
<TR>
<TD style="font-size:28px">
<B>Contents</B>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html">[Prev]</A></B>
<B><A HREF="crash_maintenance.html#intro">[Next]</A></B>
</TD>
</TR>
</TABLE>
<FONT SIZE="+1">
<UL>
<LI><A HREF="crash_maintenance.html#intro">Introduction</A>
<LI><A HREF="crash_maintenance.html#source">Files</A>
<UL>
<LI><A HREF="crash_maintenance.html#github_sources">Github Repository</A>
<LI><A HREF="crash_maintenance.html#rhel_sources">RHEL Distribution</A>
<LI><A HREF="crash_maintenance.html#fedora_sources">Fedora Distribution</A>
<LI><A HREF="crash_maintenance.html#file_contents">Source Files</A>
<LI><A HREF="crash_maintenance.html#other_files">Other Files</A>
</UL>
<LI><A HREF="crash_maintenance.html#configuration">Configuration</A>
<LI><A HREF="crash_maintenance.html#build">Build Process</A>
<UL>
<LI><A HREF="crash_maintenance.html#toplevel">Top-Level Source Files</A>
<LI><A HREF="crash_maintenance.html#linkage">Linkage with GDB</A>
</UL>
<LI ><A HREF="crash_maintenance.html#global">Global Data</A>
<LI><A HREF="crash_maintenance.html#initialization">Initialization Sequence</A>
<UL>
<LI><A HREF="crash_maintenance.html#options">Command Line Options</A>
<LI><A HREF="crash_maintenance.html#setup_environment"><tt>setup_environment()</tt></A>
<LI><A HREF="crash_maintenance.html#main"><tt>main()</tt></A>
<LI><A HREF="crash_maintenance.html#GDB_init">GDB Initialization</A>
<LI><A HREF="crash_maintenance.html#main_loop"><tt>main_loop()</tt></A>
<LI><A HREF="crash_maintenance.html#init_backtrace">Post Initialization Backtrace</A>
</UL>
<LI><A HREF="crash_maintenance.html#runtime">Runtime Control Flow</A>
<UL>
<LI><A HREF="crash_maintenance.html#process_command_line"><tt>process_command_line()</tt></A>
<LI><A HREF="crash_maintenance.html#exec_command"><tt>exec_command()</tt></A>
</UL>
<LI><A HREF="crash_maintenance.html#commandexec">Command Execution</A>
<UL>
<LI><A HREF="crash_maintenance.html#arguments">Arguments</A>
<LI><A HREF="crash_maintenance.html#memalloc">Memory Allocation</A>
<LI><A HREF="crash_maintenance.html#utilityfunc">Utility Functions</A>
<LI><A HREF="crash_maintenance.html#errorhandling">Error Handling</A>
</UL>
<LI><A HREF="crash_maintenance.html#GDB_interface">GDB Interface</A>
<LI><A HREF="crash_maintenance.html#debugging">Debugging</A>
<UL>
<LI><A HREF="crash_maintenance.html#crashdebug"><tt>CRASHDEBUG()</tt></A>
<LI><A HREF="crash_maintenance.html#console"><tt>console()</tt></A>
<LI><A HREF="crash_maintenance.html#test_cmd"><tt>cmd_test()</tt></A>
</UL>
<LI><A HREF="crash_maintenance.html#extension">Extension Modules</A>
<UL>
<LI><A HREF="crash_maintenance.html#samples_ext">Package Samples</A>
<LI><A HREF="crash_maintenance.html#upstream_ext">Upstream</A>
<LI><A HREF="crash_maintenance.html#rhel_ext">RHEL Packages</A>
</UL>
<LI><A HREF="crash_maintenance.html#testing">Testing</A>
<LI><A HREF="crash_maintenance.html#pkgmaint">Package Maintenance</A>
<UL>
<LI><A HREF="crash_maintenance.html#github">Github</A>
<LI><A HREF="crash_maintenance.html#fedora">Fedora</A>
<LI><A HREF="crash_maintenance.html#rhel">RHEL</A>
<LI><A HREF="crash_maintenance.html#centos">CentOS Stream</A>
<LI><A HREF="crash_maintenance.html#people"><tt>people.redhat.com</tt></A>
<LI><A HREF="crash_maintenance.html#github_io"><tt>https://crash-utility.github.io</tt></A>
<LI><A HREF="crash_maintenance.html#cvs">CVS</A>
</UL>
<LI><A HREF="crash_maintenance.html#mailing">Crash Utility Mailing List</A>
<LI><A HREF="crash_maintenance.html#upstream">Monitoring Upstream Kernel Development</A>
<LI><A HREF="crash_maintenance.html#FAQ">Frequently Asked Questions</A>
<LI><A HREF="crash_maintenance.html#further">Further Information</A>
<LI><A HREF="crash_maintenance.html#GNU">GNU Free Documentation License</A>
</UL>
</FONT>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR>
</TR>
<TR>
<TD>
<B><A HREF="crash_maintenance.html#contents">[Top]</A></B>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html">[Prev]</A></B>
<B><A HREF="crash_maintenance.html#intro">[Next]</A></B>
</TD>
</TR>
</TABLE>
<BR><HR ALIGN=LEFT WIDTH=800PX><BR>
<P STYLE="PADDING:40EM;"></P>
<BR><A NAME="intro"><HR ALIGN=LEFT WIDTH=800PX></A><BR>
<TABLE WIDTH=800PX>
<TR>
<TD>
<FONT SIZE="+2"><B>Introduction</B></FONT>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html#contents">[Prev]</A></B>
<B><A HREF="crash_maintenance.html#contents">[Contents]</A></B>
<B><A HREF="crash_maintenance.html#source">[Next]</A></B>
</TD>
</TR>
</TABLE>
<BR>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR><TD>
This document contains several sections regarding the
design and maintenance of the crash utility.
It is intended to be a "live" document,
to be updated with additional information, better examples, and additional
<A HREF="crash_maintenance.html#FAQ">Frequently Asked Questions</A>.
</TR></TD>
</TABLE>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR>
</TR>
<TR>
<TD>
<B><A HREF="crash_maintenance.html#intro">[Top]</A></B>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html#contents">[Prev]</A></B>
<B><A HREF="crash_maintenance.html#contents">[Contents]</A></B>
<B><A HREF="crash_maintenance.html#source">[Next]</A></B>
</TD>
</TR>
</TABLE>
<BR><HR ALIGN=LEFT WIDTH=800PX><BR>
<P STYLE="PADDING:40EM;"></P>
<BR><A NAME="source"><HR ALIGN=LEFT WIDTH=800PX></A><BR>
<TABLE WIDTH=800PX>
<TR>
<TD>
<FONT SIZE="+2"><B>Files</B></FONT>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html#intro">[Prev]</A></B>
<B><A HREF="crash_maintenance.html#contents">[Contents]</A></B>
<B><A HREF="crash_maintenance.html#configuration">[Next]</A></B>
</TD>
</TR>
</TABLE>
<BR>
<TABLE WIDTH=800PX>
<TR><TD>
<UL>
<FONT SIZE="+1">
<LI><A HREF="crash_maintenance.html#github_sources">Github Repository</A>
<LI><A HREF="crash_maintenance.html#rhel_sources">RHEL Distribution</A>
<LI><A HREF="crash_maintenance.html#fedora_sources">Fedora Distribution</A>
<LI><A HREF="crash_maintenance.html#file_contents">Source Files</A>
<LI><A HREF="crash_maintenance.html#other_files">Other Files</A>
</FONT>
</UL>
</TR></TD>
</TABLE>
<A NAME="github_sources"></A>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR>
<TD>
<FONT SIZE="+1"><BR><B><U>Github Repository</U></B></FONT>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html#source">[Top]</A></B>
</TD>
</TR>
<TR><TD><BR>
The crash utility sources consist of the following:
</TD></TR>
</TABLE>
<BLOCKQUOTE>
<pre>
$ <B>git clone git://github.com/crash-utility/crash.git</B>
Cloning into 'crash'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 2897 (delta 5), reused 10 (delta 3), pack-reused 2885
Receiving objects: 100% (2897/2897), 5.43 MiB | 1.41 MiB/s, done.
Resolving deltas: 100% (1952/1952), done.
$ <B>cd crash</B>
$ <B>ls</B>
alpha.c lkcd_fix_mem.h sadump.c
arm64.c lkcd_v1.c sadump.h
arm.c lkcd_v2_v3.c sparc64.c
bpf.c lkcd_v5.c symbols.c
cmdline.c lkcd_v7.c task.c
configure.c lkcd_v8.c test.c
COPYING3 lkcd_vmdump_v1.h tools.c
crash.8 lkcd_vmdump_v2_v3.h unwind_arm.c
defs.h lkcd_x86_trace.c unwind.c
dev.c lkcd_x86_trace.h unwind_decoder.c
diskdump.c main.c unwind.h
diskdump.h makedumpfile.c unwind_i.h
extensions/ makedumpfile.h unwind_x86_32_64.c
extensions.c Makefile unwind_x86_64.h
filesys.c memory.c unwind_x86.h
gdb-7.6.patch memory_driver/ vas_crash.h
gdb-7.6-ppc64le-support.patch mips.c va_server.c
gdb-7.6-proc_service.h.patch net.c va_server.h
gdb_interface.c netdump.c va_server_v1.c
global_data.c netdump.h vmcore.h
help.c ppc64.c vmware_vmss.c
ia64.c ppc.c vmware_vmss.h
ibm_common.h qemu.c x86_64.c
ipcs.c qemu-load.c x86.c
kaslr_helper.c qemu-load.h xen_dom0.c
kernel.c ramdump.c xen_dom0.h
kvmdump.c README xendump.c
kvmdump.h remote.c xendump.h
lkcd_common.c rse.h xen_hyper.c
lkcd_dump_v5.h s390.c xen_hyper_command.c
lkcd_dump_v7.h s390dbf.c xen_hyper_defs.h
lkcd_dump_v8.h s390_dump.c xen_hyper_dump_tables.c
lkcd_fix_mem.c s390x.c xen_hyper_global_data.c
$
</pre>
</BLOCKQUOTE>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX"><TR><TD>
Note that the GDB sources are not included in the
<A HREF="https://github.com/crash-utility/crash">github</A>
repository.
There are 3 GDB patch files:
<P>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX"><TR><TD>
<BL>
<LI><tt>gdb-7.6.patch</tt> file is always applied.
<LI><tt>gdb-7.6-ppc64le-support.patch</tt> is only applied for the ppc64le architecture.
<LI><tt>gdb-7.6-proc_service.h.patch</tt> is applied depending upon the contents of <i>/usr/include/proc_service.h</i>
</BL>
</TR></TD>
</TABLE>
<P>
The <tt>extensions</tt> subdirectory contains a small set of <i><b>sample</b></i>
extension modules. New extension modules should not be added to this directory:
</TD></TR></TABLE>
<BLOCKQUOTE>
<pre>
$ <b>ls extensions</b>
dminfo.c echo.c eppic.c eppic.mk Makefile snap.c snap.mk trace.c
$
</BLOCKQUOTE>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR><TD>
The <tt>memory_driver</tt> subdirectory contains a sample kernel driver
that is similar to the old <i>/dev/crash</i> driver. Given that /proc/kcore has
been stabilized for use on live systems, the sample driver is pretty much obsolete:
</TD></TR></TABLE>
<BLOCKQUOTE>
<pre>
$ <b>ls memory_driver</b>
crash.c Makefile README
$
</pre>
</BLOCKQUOTE>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR><TD>
Lastly, unshown above is the hidden <tt>.rh_rpm_package</tt> file, which contains
the package version number.
</TD></TR></TABLE>
<BR>
<A NAME="rhel_sources"></A>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR><TD>
<FONT SIZE="+1"><BR><B><U>RHEL Distribution</U></B></FONT>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html#source">[Top]</A></B>
</TD>
</TR>
<TR><TD><BR>
The RHEL sources, at a minimum, consist of the following:
<pre>
$ <b>rpm -qpl crash-7.2.6-1.el8.src.rpm</b>
crash-7.2.6.tar.gz
crash.spec
lzo_snappy.patch
rhel8_build.patch
$
</pre>
The <tt>crash-7.2.6.tar.gz</tt> file contains all of the
<A HREF="https://github.com/crash-utility/crash">github</A>
sources <b>plus</b>
the GDB source files. The GDB sources were downloaded from the FSF web site,
where currently <tt>gdb-7.6.tar.gz</tt> is being used:
<pre>
$ <b>tar tvzmf crash-7.2.6.tar.gz | grep tar.gz</b>
-rw-r--r-- root/root 31437633 2019-09-20 10:36 crash-7.2.7/gdb-7.6.tar.gz
$
</pre>
The <tt>lzo_snappy.patch</tt>
file causes the LZO and snappy compression libraries to be built into the crash binary.
RHEL8 requires the <tt>rhel8_build.patch</tt>, which causes the crash sources to be compiled with -fPIE,
the crash binary to linked with "-Wl,-z,now -fpie", and the host build system's
LDFLAGS contents to be utilized.
<P>
If/when the release numbers get bumped from -1 and beyond, additional patches may be added to the lists above.
See the <A HREF="crash_maintenance.html#rhel">RHEL Package Maintenance</A> section for details.
</TR></TD>
</TABLE>
<BR>
<A NAME="fedora_sources"></A>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR><TD>
<FONT SIZE="+1"><BR><B><U>Fedora Distribution</U></B></FONT>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html#source">[Top]</A></B>
</TD>
</TR>
<TR><TD><BR>
The Fedora sources, at a minimum, consist of the following:
<pre>
$ <b>rpm -qpl crash-7.2.6-1.fc31.src.rpm</b>
crash-7.2.6.tar.gz
crash.spec
lzo_snappy.patch
use_system_readline_v3.patch
$
</pre>
The <tt>crash-7.2.6.tar.gz</tt> file contains all of the
<A HREF="https://github.com/crash-utility/crash">github</A>
sources <b>plus</b>
the GDB source files. The GDB sources were downloaded from the FSF
web site, where currently <tt>gdb-7.6.tar.gz</tt> is being used:
<pre>
$ <b>tar tvzmf crash-7.2.6.tar.gz | grep tar.gz</b>
-rw-r--r-- root/root 31437633 2019-09-20 10:36 crash-7.2.6/gdb-7.6.tar.gz
$
</pre>
The <tt>lzo_snappy.patch</tt>
file causes the LZO and snappy compression libraries to be built into the crash binary.
Fedora requires the <tt>use_system_readline_v3.patch</tt>, which causes the build to utilize the host
system's <tt>readline</tt> library instead of the <tt>readline</tt> library that is bundled in the GDB sources.
<P>
If/when the release numbers get bumped from -1 and beyond, additional patches may be added to the lists above.
See the <A HREF="crash_maintenance.html#fedora">Fedora Package Maintenance</A> section for details.
</TR></TD>
</TABLE>
<BR>
<A NAME="file_contents"></A>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR><TD>
<FONT SIZE="+1"><BR><B><U>Source Files</U></B></FONT>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html#source">[Top]</A></B>
</TD>
</TR>
<TR><TD><BR>
The build is configured by the interaction of these two files. See the
<A HREF="crash_maintenance.html#configuration">Configuration</A> and
<A HREF="crash_maintenance.html#build">Build Process</A> sections for details:
<BR><BR>
<BL>
<LI><tt>configure.c</tt>
<LI><tt>Makefile</tt>
</BL>
<BR><BR>
The RHEL crash utility RPM packages are bundled with the current version
of GDB, which was downloaded from the Free Software Foundation
<A HREF="http://ftp.gnu.org/gnu/gdb"><tt>http://ftp.gnu.org/gnu/gdb</tt></A>
website. When building from
a git tree, it is downloaded dynamically:
<BR><BR>
<BL>
<LI><tt>gdb-7.6.tar.gz</tt>
</BL>
<BR><BR>
There is one major header file that most of the C files include,
which is the only file contained in the <tt>crash-devel</tt> RPM package:
<BR><BR>
<BL>
<LI><tt>defs.h</tt>
</BL>
<BR><BR>
Each of the supported architectures contains its own file, containing
numerous machine-specific functions that must exist for each architecture.
The majority of the text within each file is conditionally compiled
because it is contained within per-architecture <tt>#ifdef/#endif</tt> directives:
<BR><BR>
<BL>
<LI><tt>alpha.c</tt>
<LI><tt>arm64.c</tt>
<LI><tt>arm.c</tt>
<LI><tt>ia64.c</tt>
<LI><tt>mips.c</tt>
<LI><tt>ppc64.c</tt>
<LI><tt>ppc.c</tt>
<LI><tt>s390.c</tt>
<LI><tt>s390x.c</tt>
<LI><tt>sparc64.c</tt>
<LI><tt>x86_64.c</tt>
<LI><tt>x86.c</tt>
</BL>
<BL>
<BR>
<BR>
Support for the various memory sources are contained in several files.
Historically, the first supported dumpfile type was the Mcore kernel patch
from Mission Critical Linux:
<BR><BR>
<BL>
<LI><tt>vas_crash.h</tt>
<LI><tt>va_server.c</tt>
<LI><tt>va_server.h</tt>
<LI><tt>va_server_v1.c</tt>
</BL>
<BR><BR>
That was followed by support for the LKCD kernel patch from Silicon Graphics.
Both Mcore and LKCD were never accepted into the upstream kernel tree,
and for all practical purposes are obsolete. However, the LKCD format
apparently still exists in some IBM configurations:
<BR><BR>
<BL>
<LI><tt>lkcd_common.c</tt>
<LI><tt>lkcd_dump_v5.h</tt>
<LI><tt>lkcd_dump_v7.h</tt>
<LI><tt>lkcd_dump_v8.h</tt>
<LI><tt>lkcd_fix_mem.c</tt>
<LI><tt>lkcd_fix_mem.h</tt>
<LI><tt>lkcd_v1.c</tt>
<LI><tt>lkcd_v2_v3.c</tt>
<LI><tt>lkcd_v5.c</tt>
<LI><tt>lkcd_v7.c</tt>
<LI><tt>lkcd_v8.c</tt>
<LI><tt>lkcd_vmdump_v1.h</tt>
<LI><tt>lkcd_vmdump_v2_v3.h</tt>
</BL>
<BR><BR>
Support for ELF format dumpfiles was first introduced by the Red Hat Netdump facility,
and then subsequently by the Kdump facility, and the Xen ELF format. The support for
all ELF format dumpfiles is contained in these two files:
<BR><BR>
<BL>
<LI><tt>netdump.c</tt>
<LI><tt>netdump.h</tt>
</BL>
<BR><BR>
The original compressed dumpfile format was the Diskdump facility introduced by
Fujitsu. That format was later utilized and expanded upon by the
compressed Kdump format:
<BR><BR>
<BL>
<LI><tt>diskdump.c</tt>
<LI><tt>diskdump.h</tt>
</BL>
<BR><BR>
Another compressed dumpfile is the Fujitsu SADUMP, created
by the Fujitsu Stand Alone Dump facility. The dump-creation
mechanism is initiated from hardware-specific firmware, generating a dumpfile in three
different formats: sadump dump device (single partition), sadump dump
device (disk set), and archive file formats:
<BR><BR>
<BL>
<LI><tt>sadump.c</tt>
<LI><tt>sadump.h</tt>
</BL>
<BR><BR>
The original Xen dumpfile format was the XC_SAVE format produced by the <tt>xm save</tt> command,
and later the XC_CORE_ORIG format created by the <tt>xc_domain_dumpcore()</tt> library function in
<tt>libxc/xc_core.c</tt>, and lastly an XC_CORE_ELF format, which has also has support in
<tt>netdump.c</tt>:
<BR><BR>
<BL>
<LI><tt>xendump.c</tt>
<LI><tt>xendump.h</tt>
<LI><tt>xen_dom0.c</tt>
<LI><tt>xen_dom0.h</tt>
</BL>
<BR><BR>
When a dom0 kernel or its underlying Xen hypervisor binary crashes, a single vmcore file is created.
To analyze the vmcore from the perspective of the Xen hypervisor, support was added to
allow the substitution of the <tt>vmlinux</tt> file with a <tt>xen-syms</tt> file.
A separate set of commands exists for such an invocation:
<BR><BR>
<BL>
<LI><tt>xen_hyper.c</tt>
<LI><tt>xen_hyper_command.c</tt>
<LI><tt>xen_hyper_defs.h</tt>
<LI><tt>xen_hyper_dump_tables.c</tt>
<LI><tt>xen_hyper_global_data.c</tt>
</BL>
<BR><BR>
The original dumpfile format produced by the KVM <tt>virsh dump</tt> command
was based upon its "save-vm" format. It was not well-suited for use as a
dumpfile because it was not designed to be random access:
<BR><BR>
<BL>
<LI><tt>qemu.c</tt>
<LI><tt>qemu-load.c</tt>
<LI><tt>qemu-load.h</tt>
<LI><tt>kvmdump.c</tt>
<LI><tt>kvmdump.h</tt>
</BL>
<BR><BR>
The original s390/s390x native dumpfile format was essentially a
copy of physical memory created by the IBM stand-alone dump tool:
<BR><BR>
<BL>
<LI><tt>ibm_common.h</tt>
<LI><tt>s390_dump.c</tt>
</BL>
<BR><BR>
Support was added for <tt>makedumpfile</tt>'s "vmcore.flat" dumpfile format,
so that it is not necessary to revert the flattened-format dumpfile back into
an ELF vmcore or compressed kdump vmcore with <tt>makedumpfile -R</tt>", or with
the <tt>makedumpfile-R.pl</tt> script. It is a slower invocation, because
the crash utility needs to perform the physical memory "rearrangement" during
its initialization sequence:
<BR><BR>
<BL>
<LI><tt>makedumpfile.h</tt>
<LI><tt>makedumpfile.c</tt>
</BL>
<BR><BR>
Support for VMware VMSS suspended state dumpfiles is here:
<BR><BR>
<BL>
<LI><tt>vmware_vmss.c</tt>
<LI><tt>vmware_vmss.h</tt>
</BL>
<BR><BR>
Support was added for raw RAM dump files, which get transformed into temporary
ELF format files for analysis. This file is also used for remote "live"
ramdump files as referenced below in the <tt>remote.c</tt>
description:
<BR><BR>
<BL>
<LI><tt>ramdump.c</tt>
</BL>
<BR><BR>
Originally there was support for running the crash utility against
dumpfiles that were located on a remote host, which required that the
deprecated "crash daemon" was running on the remote host. That functionality
has been obsolete for many years; however the remote functionality has been
somewhat resurrected for two rare cases. One is for use with a "xen-crashd" daemon running
on a Xen Dom0 host, which communicates with a paused or shutdown DomU
guest kernel. The second is for support of "live" ramdump files, such as
those that are specified by the QEMU mem-path argument of a memory-backend-file
object, which allows the running of a live crash session against a
QEMU guest from the host machine:
<BR><BR>
<BL>
<LI><tt>remote.c</tt>
</BL>
<BR><BR>
In addition to containing the crash utility's <tt>main()</tt> invocation
function, this file accomplishes such things as the program context initialization,
initiates the interaction with the embedded GDB module, contains the
command execution loop, and contains
the <tt>mach</tt> and <tt>quit</tt> commands:
<BR><BR>
<BL>
<LI><tt>main.c</tt>
</BL>
<BR><BR>
There are several global data structures that can be referenced directly by any
other file are collected in one file. These include the <tt>program_context</tt>,
the <tt>task_table</tt>, the <tt>kernel_table</tt>, the <tt>vm_table</tt>,
the <tt>machdep_table</tt>,
the <tt>symbol_table_data</tt> tables; these tables can be referenced by the
<tt>pc</tt>,
<tt>tt</tt>,
<tt>kt</tt>,
<tt>vm</tt>,
<tt>machdep</tt>,
and <tt>st</tt> global pointers respectively. This file also contains
the <tt>args[]</tt>, <tt>argscnt</tt> and
<tt>argerrs</tt> for command-gathering, the <tt>linux_command_table[]</tt>,
the <tt>extension_table</tt> for linking extension module commands, and the <tt>offset_table</tt>, <tt>size_table</tt> and
<tt>array_table</tt> for storing commonly-used structure offsets, structure sizes, and array sizes:
<BR><BR>
<BL>
<LI><tt>global_data.c</tt>
</BL>
<BR><BR>
Support for gathering symbol table information from the <tt>vmlinux</tt>
file for use during runtime, the <tt>sym</tt>,
<tt>sym</tt>,
<tt>struct</tt>,
<tt>union</tt>,
<tt>*</tt>
and <tt>p</tt> commands,
as well as numerous symbol-related utility
functions are found here:
<BR><BR>
<BL>
<LI><tt>symbols.c</tt>
</BL>
<BR><BR>
Command line handling and support functions, and the
<tt>alias</tt> and
<tt>repeat</tt> commands are contained here:
<BR><BR>
<BL>
<LI><tt>cmdline.c</tt>
</BL>
<BR><BR>
Communication functions with the embedded GDB module, and the
generic <tt>gdb</tt> command are contained here:
<BR><BR>
<BL>
<LI><tt>gdb_interface.c</tt>
</BL>
<BR><BR>
Physical and virtual memory-specific initialization, support functions, and the
<tt>rd</tt>,
<tt>wr</tt>,
<tt>ptov</tt>,
<tt>vtop</tt>,
<tt>vm</tt>,
<tt>ptob</tt>,
<tt>btop</tt>,
<tt>kmem</tt>,
<tt>search</tt>,
<tt>swap</tt> and
<tt>pte</tt> commands are here:
<BR><BR>
<BL>
<LI><tt>memory.c</tt>
</BL>
<BR><BR>
Kernel-specific initialization, support functions, and the
<tt>bt</tt>,
<tt>dis</tt>,
<tt>mod</tt>,
<tt>log</tt>,
<tt>sys</tt>,
<tt>irq</tt>,
<tt>timer</tt> and
<tt>waitq</tt> commands are here:
<BR><BR>
<BL>
<LI><tt>kernel.c</tt>
</BL>
<BR><BR>
Task-specific initialization, support functions, and the
<tt>ps</tt>,
<tt>task</tt>,
<tt>foreach</tt>,
<tt>runq</tt> and
<tt>sig</tt> commands are here:
<BR><BR>
<BL>
<LI><tt>task.c</tt>
</BL>
<BR><BR>
File system-specific initialization, support functions, and the
<tt>mount</tt>,
<tt>files</tt> and
<tt>fuser</tt> commands are here:
<BR><BR>
<BL>
<LI><tt>filesys.c</tt>
</BL>
<BR><BR>
Device-specific initialization, support functions, and the <tt>dev</tt>
command are contained here:
<BR><BR>
<BL>
<LI><tt>dev.c</tt>
</BL>
<BR><BR>
Support for the dumping of the NT_VMCOREDD vmcore ELF note requires this header:
<BR><BR>
<BL>
<LI><tt>vmcore.h</tt>
</BL>
<BR><BR>
Network-specific initialization, support functions, and the <tt>net</tt> command
are contained here:
<BR><BR>
<BL>
<LI><tt>net.c</tt>
</BL>
<BR><BR>
Numerous commonly-used utility functions, and the
<tt>set</tt>,
<tt>eval</tt>,
<tt>list</tt> and
<tt>tree</tt> commands are here:
<BR><BR>
<BL>
<LI><tt>tools.c</tt>
</BL>
<BR><BR>
The <tt>ipcs</tt> command and its support functions are contained here:
<BR><BR>
<BL>
<LI><tt>ipcs.c</tt>
</BL>
<BR><BR>
The <tt>bpf</tt> command and its support functions are contained here:
<BR><BR>
<BL>
<LI><tt>bpf.c</tt>
</BL>
<BR><BR>
The hidden <tt>test</tt> debug/test command is contained here:
<BR><BR>
<BL>
<LI><tt>ipcs.c</tt>
</BL>
<BR><BR>
The <tt>help</tt> command and its support functions are contained here:
<BR><BR>
<BL>
<LI><tt>help.c</tt>
</BL>
<BR><BR>
The extension module <tt>extend</tt> command and its support functions are contained here:
<BR><BR>
<BL>
<LI><tt>extensions.c</tt>
</BL>
<BR><BR>
The <tt>s390dbf</tt> command and its support functions are contained here:
<BR><BR>
<BL>
<LI><tt>s390dbf.c</tt>
</BL>
<BR><BR>
The 32-bit x86 <tt>bt</tt> command uses a modified version of the old LKCD backtrace
code:
<BR><BR>
<BL>
<LI><tt>lkcd_x86_trace.c</tt>
<LI><tt>lkcd_x86_trace.h</tt>
</BL>
<BR><BR>
Functions required for KASLR offset calculation when the relevant
vmcoreinfo data is not contained in the dumpfile are found here:
<BR><BR>
<BL>
<LI><tt>kaslr_helper.c</tt>
</BL>
<BR><BR>
Backtrace support in older kernel versions could optionally use the kernel's
Dwarf unwind tables:
<BR><BR>
<BL>
<LI><tt>unwind_arm.c</tt>
<LI><tt>rse.h</tt>
<LI><tt>unwind.c</tt>
<LI><tt>unwind_decoder.c</tt>
<LI><tt>unwind.h</tt>
<LI><tt>unwind_i.h</tt>
<LI><tt>unwind_x86_32_64.c</tt>
<LI><tt>unwind_x86_64.h</tt>
<LI><tt>unwind_x86.h</tt>
</BL>
<BR><BR>
There are 3 patches for the current version of GDB that
are required to marry it with the crash utility code:
<BR><BR>
<BL>
<LI><tt>gdb-7.6.patch</tt>
<LI><tt>gdb-7.6-ppc64le-support.patch</tt>
<LI><tt>gdb-7.6-proc_service.h.patch</tt>
</BL>
<BR><BR>
The <tt>CRASH(8)</tt> man page is here:
<BR><BR>
<BL>
<LI><tt>crash.8</tt>
</BL>
<BR><BR>
The crash utility's README file is generated/updated by the <tt>crash -h README</tt> command,
which is called by the <tt>make files</tt>, <tt>make tar</tt> and <tt>make release</tt>
targets to update its contents slightly, for example, to show the current crash utility
version number:
<BR><BR>
<BL>
<LI><tt>README</tt>
</BL>
<BR><BR>
The crash utility's version number is generated by the <tt>make RPMPKG=</tt><<i>version</i>>
target, or it can be modified manually:
<BR><BR>
<BL>
<LI><tt>.rh_rpm_package</tt>
</BL>
<BR><BR>
The GPLv3 license that must be included with the package is here:
<BR><BR>
<BL>
<LI><tt>COPYING3</tt>
</BL>
<BR><BR>
The <tt>extensions/</tt> subdirectory contains a set of
sample extension modules and requisite makefiles. See the
<A HREF="crash_maintenance.html#extension">Extension Modules</A>
section for details:
<BR><BR>
<BL>
<LI><tt>dminfo.c</tt>
<LI><tt>echo.c</tt>
<LI><tt>eppic.c</tt>
<LI><tt>eppic.mk</tt>
<LI><tt>Makefile</tt>
<LI><tt>snap.c</tt>
<LI><tt>snap.mk</tt>
<LI><tt>trace.c</tt>
</BL>
<BR><BR>
The <tt>memory_driver/</tt> subdirectory contains a
a sample <tt>/dev/crash</tt> memory driver for live
system analysis if <tt>/dev/mem</tt> and/or <tt>/proc/kcore</tt>
are unavailable on a host machine:
<BR><BR>
<BL>
<LI><tt>crash.c</tt>
<LI><tt>Makefile</tt>
<LI><tt>README</tt>
</BL>
</TR></TD>
</TABLE>
<A NAME="other_files"></A>
<TABLE WIDTH=800PX STYLE="PADDING-LEFT: 20PX">
<TR><TD>
<FONT SIZE="+1"><BR><B><U>Other Files</U></B></FONT>
</TD>
<TD ALIGN=RIGHT>
<B><A HREF="crash_maintenance.html#source">[Top]</A></B>
</TD>
<BR><BR>
</TR>
<TR><TD>
<BR>
There are several files that are not part of the original source
tree. Most importantly, is the current version
of GDB, which gets downloaded from the Free Software Foundation
<A HREF="http://ftp.gnu.org/gnu/gdb"><tt>http://ftp.gnu.org/gnu/gdb</tt></A>
website during the initial build; the file is bundled with RHEL and Fedora
<tt>crash-</tt><<i>version</i>></tt>.src.rpm</tt> file:
<BR><BR>
<BL>
<LI><tt>gdb-7.6.tar.gz</tt>
</BL>
<BR><BR>
The following files are not part of the original source tree. They
are created dynamically or manually.
<p>
The resultant build data is created by this file and stored in the
crash utility binary, which can be viewed during runtime by <tt>help -B</tt>.
This file is created dynamically each time a build is done:
<BL>
<LI><tt>build_data.c</tt>
</BL>
<BR><BR>
With older versions of GDB, certain files were excluded from
being extracted from the <tt>gdb-</tt><<i>version</i>><tt>.tar.gz</tt>
file. This file is created automatically during the initial build, and it
contained a list of files to be excluded.
With the current version of <tt>gdb-7.6</tt>, it is obsolete:
<BR><BR>
<BL>
<LI><tt>gdb.files</tt>
</BL>
<BR><BR>
These two files allow a user to apply extra CFLAGS and LDFLAGS
options to the compilation:
<BR><BR>
<BL>
<LI><tt>CFLAGS.extra</tt>
<LI><tt>LDFLAGS.extra</tt>
</BL>