1# dreport
2
3dreport is a shell script that uses plugin shell scripts to collect debug
4information about the system and package it into a tar.xz archive file.
5
6The phosphor-dump-manager application will automatically run dreport in certain
7failure cases, and it can also be run manually by running `dreport` or `dreport
8-v`.
9
10## Dump Types
11The dump types are defined in [sample.conf](sample.conf):
12- core: Triggered by an application core dump
13- user: The type when manually called, such as from running `dreport`.
14- elog: Triggered when there are specific phosphor-logging event logs.
15- checkstop: Triggered on a specific type of host crash.
16- ramoops: Triggered when there is a kernel panic.
17
18## Plugins
19The plugins are the shell scripts in the [plugins.d](plugins.d) subdirectory.
20They can call [provided functions](include.d/functions) to add data to the dump
21archive.  Each plugin needs a comment line like the following to specify which
22dump types should trigger it:
23
24```
25# config A B
26```
27
28- 'A' is a sequence of the dump types from the mapping defined in
29  [sample.conf](sample.conf).
30- 'B' is a priority determines the order the plugins run in.
31
32For example, the `bmcstate` plugin has:
33```
34# config: 12345 5
35```
36
37It will run on dump types 1 (core), 2 (user), 3 (checkstop), 4 (checkstop), and 5
38(ramooops) with a priority of 5.
39
40During the bitbake build, the script will be linked into a directory based on
41the dump type, with the priority built into the name:
42```
43/usr/share/dreport.d# find /usr/share/dreport.d/ -name *bmcstate
44/usr/share/dreport.d/plugins.d/bmcstate
45/usr/share/dreport.d/pl_user.d/E5bmcstate
46/usr/share/dreport.d/pl_checkstop.d/E5bmcstate
47/usr/share/dreport.d/pl_elog.d/E5bmcstate
48/usr/share/dreport.d/pl_core.d/E5bmcstate
49```
50