xref: /openbmc/phosphor-logging/extensions/openpower-pels/registry/README.md (revision 3fe93e968dcd0ecf0f302007efdee97313938ce2)
1a96a7948SMatt Spinler# Platform Event Log Message Registry
226919f07SPatrick Williams
3a96a7948SMatt SpinlerOn the BMC, PELs are created from the standard event logs provided by
4a96a7948SMatt Spinlerphosphor-logging using a message registry that provides the PEL related fields.
5a96a7948SMatt SpinlerThe message registry is a JSON file.
6a96a7948SMatt Spinler
7a96a7948SMatt Spinler## Contents
826919f07SPatrick Williams
926919f07SPatrick Williams- [Component IDs](#component-ids)
1026919f07SPatrick Williams- [Message Registry](#message-registry-fields)
1126919f07SPatrick Williams- [Modifying and Testing](#modifying-and-testing)
12a96a7948SMatt Spinler
13a96a7948SMatt Spinler## Component IDs
1426919f07SPatrick Williams
15a96a7948SMatt SpinlerA component ID is a 2 byte value of the form 0xYY00 used in a PEL to:
1626919f07SPatrick Williams
17a96a7948SMatt Spinler1. Provide the upper byte (the YY from above) of an SRC reason code in `BD`
18a96a7948SMatt Spinler   SRCs.
1926919f07SPatrick Williams2. Reside in the section header of the Private Header PEL section to specify the
2026919f07SPatrick Williams   error log creator's component ID.
21a96a7948SMatt Spinler3. Reside in the section header of the User Header section to specify the error
22a96a7948SMatt Spinler   log committer's component ID.
2326919f07SPatrick Williams4. Reside in the section header in the User Data section to specify which parser
2426919f07SPatrick Williams   to call to parse that section.
25a96a7948SMatt Spinler
26a96a7948SMatt SpinlerComponent IDs are specified in the message registry either as the upper byte of
27a96a7948SMatt Spinlerthe SRC reason code field for `BD` SRCs, or in the standalone `ComponentID`
28a96a7948SMatt Spinlerfield.
29a96a7948SMatt Spinler
3026919f07SPatrick WilliamsComponent IDs will be unique on a per-repository basis for errors unique to that
3126919f07SPatrick Williamsrepository. When the same errors are created by multiple repositories, those
3226919f07SPatrick Williamserrors will all share the same component ID. The master list of component IDs is
3326919f07SPatrick Williams[here](O_component_ids.json). That file can used by PEL parsers to display a
3426919f07SPatrick Williamsname for the component ID. The 'O' in the name is the creator ID value for BMC
3526919f07SPatrick Williamscreated PELs.
36a96a7948SMatt Spinler
37a96a7948SMatt Spinler## Message Registry Fields
3826919f07SPatrick Williams
39a96a7948SMatt SpinlerThe message registry schema is [here](schema/schema.json), and the message
40a96a7948SMatt Spinlerregistry itself is [here](message_registry.json). The schema will be validated
41a96a7948SMatt Spinlereither during a bitbake build or during CI, or eventually possibly both.
42a96a7948SMatt Spinler
43a96a7948SMatt SpinlerIn the message registry, there are fields for specifying:
44a96a7948SMatt Spinler
45a96a7948SMatt Spinler### Name
4626919f07SPatrick Williams
4726919f07SPatrick WilliamsThis is the key into the message registry, and is the Message property of the
4826919f07SPatrick WilliamsOpenBMC event log that the PEL is being created from.
49a96a7948SMatt Spinler
50a6c48787SMatt Spinler```json
51a96a7948SMatt Spinler"Name": "xyz.openbmc_project.Power.Fault"
52a96a7948SMatt Spinler```
53a96a7948SMatt Spinler
54a96a7948SMatt Spinler### Subsystem
5526919f07SPatrick Williams
5626919f07SPatrick WilliamsThis field is part of the PEL User Header section, and is used to specify the
5726919f07SPatrick Williamssubsystem pertaining to the error. It is an enumeration that maps to the actual
5826919f07SPatrick WilliamsPEL value. If the subsystem isn't known ahead of time, it can be passed in at
5926919f07SPatrick Williamsthe time of PEL creation using the 'PEL_SUBSYSTEM' AdditionalData field. In this
6026919f07SPatrick Williamscase, 'Subsystem' isn't required, though 'PossibleSubsystems' is.
61a96a7948SMatt Spinler
62a6c48787SMatt Spinler```json
63a96a7948SMatt Spinler"Subsystem": "power_supply"
64a96a7948SMatt Spinler```
65a96a7948SMatt Spinler
6623970b0dSMatt Spinler### PossibleSubsystems
6726919f07SPatrick Williams
6826919f07SPatrick WilliamsThis field is used by scripts that build documentation from the message registry
6926919f07SPatrick Williamsto know which subsystems are possible for an error when it can't be hardcoded
7026919f07SPatrick Williamsusing the 'Subsystem' field. It is mutually exclusive with the 'Subsystem'
7126919f07SPatrick Williamsfield.
7223970b0dSMatt Spinler
73a6c48787SMatt Spinler```json
7423970b0dSMatt Spinler"PossibleSubsystems": ["memory", "processor"]
7523970b0dSMatt Spinler```
7623970b0dSMatt Spinler
77a96a7948SMatt Spinler### Severity
7826919f07SPatrick Williams
7926919f07SPatrick WilliamsThis field is part of the PEL User Header section, and is used to specify the
8026919f07SPatrick WilliamsPEL severity. It is an optional field, if it isn't specified, then the severity
8126919f07SPatrick Williamsof the OpenBMC event log will be converted into a PEL severity value.
82a96a7948SMatt Spinler
8317952d94SMatt SpinlerIt can either be the plain severity value, or an array of severity values that
8417952d94SMatt Spinlerare based on system type, where an entry without a system type will match
8517952d94SMatt Spinleranything unless another entry has a matching system type.
8617952d94SMatt Spinler
87a6c48787SMatt Spinler```json
88a96a7948SMatt Spinler"Severity": "unrecoverable"
89a96a7948SMatt Spinler```
90a96a7948SMatt Spinler
91a6c48787SMatt Spinler```json
9217952d94SMatt SpinlerSeverity":
9317952d94SMatt Spinler[
9417952d94SMatt Spinler    {
9517952d94SMatt Spinler        "System": "system1",
9617952d94SMatt Spinler        "SevValue": "recovered"
9717952d94SMatt Spinler    },
9817952d94SMatt Spinler    {
9917952d94SMatt Spinler        "Severity": "unrecoverable"
10017952d94SMatt Spinler    }
10117952d94SMatt Spinler]
10217952d94SMatt Spinler```
10326919f07SPatrick Williams
10426919f07SPatrick WilliamsThe above example shows that on system 'system1' the severity will be recovered,
10526919f07SPatrick Williamsand on every other system it will be unrecoverable.
10617952d94SMatt Spinler
107a96a7948SMatt Spinler### Mfg Severity
10826919f07SPatrick Williams
109a96a7948SMatt SpinlerThis is an optional field and is used to override the Severity field when a
11017952d94SMatt Spinlerspecific manufacturing isolation mode is enabled. It has the same format as
11117952d94SMatt SpinlerSeverity.
112a96a7948SMatt Spinler
113a6c48787SMatt Spinler```json
114a96a7948SMatt Spinler"MfgSeverity": "unrecoverable"
115a96a7948SMatt Spinler```
116a96a7948SMatt Spinler
117a96a7948SMatt Spinler### Event Scope
11826919f07SPatrick Williams
11926919f07SPatrick WilliamsThis field is part of the PEL User Header section, and is used to specify the
12026919f07SPatrick Williamsevent scope, as defined by the PEL spec. It is optional and defaults to "entire
12126919f07SPatrick Williamsplatform".
122a96a7948SMatt Spinler
123a6c48787SMatt Spinler```json
124a96a7948SMatt Spinler"EventScope": "entire_platform"
125a96a7948SMatt Spinler```
126a96a7948SMatt Spinler
127a96a7948SMatt Spinler### Event Type
12826919f07SPatrick Williams
12926919f07SPatrick WilliamsThis field is part of the PEL User Header section, and is used to specify the
13026919f07SPatrick Williamsevent type, as defined by the PEL spec. It is optional and defaults to "not
13126919f07SPatrick Williamsapplicable" for non-informational logs, and "misc_information_only" for
1323fb208e3SMatt Spinlerinformational ones.
133a96a7948SMatt Spinler
134a6c48787SMatt Spinler```json
135a96a7948SMatt Spinler"EventType": "na"
136a96a7948SMatt Spinler```
137a96a7948SMatt Spinler
138a96a7948SMatt Spinler### Action Flags
13926919f07SPatrick Williams
140a96a7948SMatt SpinlerThis field is part of the PEL User Header section, and is used to specify the
141a96a7948SMatt SpinlerPEL action flags, as defined by the PEL spec. It is an array of enumerations.
142a96a7948SMatt Spinler
1433fb208e3SMatt SpinlerThe action flags can usually be deduced from other PEL fields, such as the
14426919f07SPatrick Williamsseverity or if there are any callouts. As such, this is an optional field and if
14526919f07SPatrick Williamsnot supplied the code will fill them in based on those fields.
1463fb208e3SMatt Spinler
1473fb208e3SMatt SpinlerIn fact, even if supplied here, the code may still modify them to ensure they
14878feef04SMatt Spinlerare correct. The rules used for this are
14978feef04SMatt Spinler[here](../README.md#action-flags-and-event-type-rules).
1503fb208e3SMatt Spinler
151a6c48787SMatt Spinler```json
152a96a7948SMatt Spinler"ActionFlags": ["service_action", "report", "call_home"]
153a96a7948SMatt Spinler```
154a96a7948SMatt Spinler
155a96a7948SMatt Spinler### Mfg Action Flags
15626919f07SPatrick Williams
157a96a7948SMatt SpinlerThis is an optional field and is used to override the Action Flags field when a
158a96a7948SMatt Spinlerspecific manufacturing isolation mode is enabled.
159a96a7948SMatt Spinler
160a6c48787SMatt Spinler```json
161a96a7948SMatt Spinler"MfgActionFlags": ["service_action", "report", "call_home"]
162a96a7948SMatt Spinler```
163a96a7948SMatt Spinler
164a96a7948SMatt Spinler### Component ID
16526919f07SPatrick Williams
16626919f07SPatrick WilliamsThis is the component ID of the PEL creator, in the form 0xYY00. For `BD` SRCs,
16726919f07SPatrick Williamsthis is an optional field and if not present the value will be taken from the
16826919f07SPatrick Williamsupper byte of the reason code. If present for `BD` SRCs, then this byte must
16926919f07SPatrick Williamsmatch the upper byte of the reason code.
170a96a7948SMatt Spinler
171a6c48787SMatt Spinler```json
172a96a7948SMatt Spinler"ComponentID": "0x5500"
173a96a7948SMatt Spinler```
174a96a7948SMatt Spinler
175a96a7948SMatt Spinler### SRC Type
17626919f07SPatrick Williams
17726919f07SPatrick WilliamsThis specifies the type of SRC to create. The type is the first 2 characters of
17826919f07SPatrick Williamsthe 8 character ASCII string field of the PEL. The allowed types are `BD`, for
17926919f07SPatrick Williamsthe standard OpenBMC error, and `11`, for power related errors. It is optional
18026919f07SPatrick Williamsand if not specified will default to `BD`.
181a96a7948SMatt Spinler
182a96a7948SMatt SpinlerNote: The ASCII string for BD SRCs looks like: `BDBBCCCC`, where:
18326919f07SPatrick Williams
18426919f07SPatrick Williams- BD = SRC type
18526919f07SPatrick Williams- BB = PEL subsystem as mentioned above
18626919f07SPatrick Williams- CCCC SRC reason code
187a96a7948SMatt Spinler
188a96a7948SMatt SpinlerFor `11` SRCs, it looks like: `1100RRRR`, where RRRR is the SRC reason code.
189a96a7948SMatt Spinler
190a6c48787SMatt Spinler```json
191a96a7948SMatt Spinler"Type": "11"
192a96a7948SMatt Spinler```
193a96a7948SMatt Spinler
194a96a7948SMatt Spinler### SRC Reason Code
19526919f07SPatrick Williams
19626919f07SPatrick WilliamsThis is the 4 character value in the latter half of the SRC ASCII string. It is
19726919f07SPatrick Williamstreated as a 2 byte hex value, such as 0x5678. For `BD` SRCs, the first byte is
19826919f07SPatrick Williamsthe same as the first byte of the component ID field in the Private Header
19926919f07SPatrick Williamssection that represents the creator's component ID.
200a96a7948SMatt Spinler
201a6c48787SMatt Spinler```json
202a96a7948SMatt Spinler"ReasonCode": "0x5544"
203a96a7948SMatt Spinler```
204a96a7948SMatt Spinler
205a96a7948SMatt Spinler### SRC Symptom ID Fields
20626919f07SPatrick Williams
207a96a7948SMatt SpinlerThe symptom ID is in the Extended User Header section and is defined in the PEL
208a96a7948SMatt Spinlerspec as the unique event signature string. It always starts with the ASCII
209a96a7948SMatt Spinlerstring. This field in the message registry allows one to choose which SRC words
210a96a7948SMatt Spinlerto use in addition to the ASCII string field to form the symptom ID. All words
211a96a7948SMatt Spinlerare separated by underscores. If not specified, the code will choose a default
212a96a7948SMatt Spinlerformat, which may depend on the SRC type.
213a96a7948SMatt Spinler
214a96a7948SMatt SpinlerFor example: ["SRCWord3", "SRCWord9"] would be:
215a96a7948SMatt Spinler`<ASCII_STRING>_<SRCWord3>_<SRCWord9>`, which could look like:
216a96a7948SMatt Spinler`B181320_00000050_49000000`.
217a96a7948SMatt Spinler
218a6c48787SMatt Spinler```json
219a96a7948SMatt Spinler"SymptomIDFields": ["SRCWord3", "SRCWord9"]
220a96a7948SMatt Spinler```
221a96a7948SMatt Spinler
222a96a7948SMatt Spinler### SRC words 6 to 9
22326919f07SPatrick Williams
224a96a7948SMatt SpinlerIn a PEL, these SRC words are free format and can be filled in by the user as
225a96a7948SMatt Spinlerdesired. On the BMC, the source of these words is the AdditionalData fields in
226a96a7948SMatt Spinlerthe event log. The message registry provides a way for the log creator to
227a96a7948SMatt Spinlerspecify which AdditionalData property field to get the data from, and also to
228a96a7948SMatt Spinlerdefine what the SRC word means for use by parsers. If not specified, these SRC
229a96a7948SMatt Spinlerwords will be set to zero in the PEL.
230a96a7948SMatt Spinler
231a6c48787SMatt Spinler```json
232a96a7948SMatt Spinler"Words6to9":
233a96a7948SMatt Spinler{
234a96a7948SMatt Spinler    "6":
235a96a7948SMatt Spinler    {
236a96a7948SMatt Spinler        "description": "Failing unit number",
237a96a7948SMatt Spinler        "AdditionalDataPropSource": "PS_NUM"
238a96a7948SMatt Spinler    }
239a96a7948SMatt Spinler}
240a96a7948SMatt Spinler```
241a96a7948SMatt Spinler
242*3fe93e96SMatt Spinler### SRC Deconfig Flag
243*3fe93e96SMatt Spinler
244*3fe93e96SMatt SpinlerBit 6 in hex word 5 of the SRC means that one or more called out resources have
245*3fe93e96SMatt Spinlerbeen deconfigured, and this flag can be used to set that bit. The only other way
246*3fe93e96SMatt Spinlerto set it is by indicating it when
247*3fe93e96SMatt Spinler[passing in the callouts via JSON](../README.md#callouts).
248*3fe93e96SMatt Spinler
249*3fe93e96SMatt SpinlerThis is looked at by the software that creates the periodic PELs that indicate a
250*3fe93e96SMatt Spinlersystem is running with deconfigured hardware.
251*3fe93e96SMatt Spinler
252*3fe93e96SMatt Spinler```json
253*3fe93e96SMatt Spinler"DeconfigFlag": true
254*3fe93e96SMatt Spinler```
255*3fe93e96SMatt Spinler
256a96a7948SMatt Spinler### Documentation Fields
25726919f07SPatrick Williams
258a96a7948SMatt SpinlerThe documentation fields are used by PEL parsers to display a human readable
259a96a7948SMatt Spinlerdescription of a PEL. They are also the source for the Redfish event log
260a96a7948SMatt Spinlermessages.
261a96a7948SMatt Spinler
262a96a7948SMatt Spinler#### Message
26326919f07SPatrick Williams
264a96a7948SMatt SpinlerThis field is used by the BMC's PEL parser as the description of the error log.
265a96a7948SMatt SpinlerIt will also be used in Redfish event logs. It supports argument substitution
26626919f07SPatrick Williamsusing the %1, %2, etc placeholders allowing any of the SRC user data words 6 - 9
26726919f07SPatrick Williamsto be displayed as part of the message. If the placeholders are used, then the
26826919f07SPatrick Williams`MessageArgSources` property must be present to say which SRC words to use for
26926919f07SPatrick Williamseach placeholder.
270a96a7948SMatt Spinler
271a6c48787SMatt Spinler```json
272a96a7948SMatt Spinler"Message": "Processor %1 had %2 errors"
273a96a7948SMatt Spinler```
274a96a7948SMatt Spinler
275a96a7948SMatt Spinler#### MessageArgSources
27626919f07SPatrick Williams
277a96a7948SMatt SpinlerThis optional field is required when the Message field contains the %X
278a96a7948SMatt Spinlerplaceholder arguments. It is an array that says which SRC words to get the
279a96a7948SMatt Spinlerplaceholders from. In the example below, SRC word 6 would be used for %1, and
280a96a7948SMatt SpinlerSRC word 7 for %2.
281a96a7948SMatt Spinler
282a6c48787SMatt Spinler```json
283a96a7948SMatt Spinler"MessageArgSources":
284a96a7948SMatt Spinler[
285a96a7948SMatt Spinler    "SRCWord6", "SRCWord7"
286a96a7948SMatt Spinler]
287a96a7948SMatt Spinler```
288a96a7948SMatt Spinler
289a96a7948SMatt Spinler#### Description
29026919f07SPatrick Williams
29126919f07SPatrick WilliamsA short description of the error. This is required by the Redfish schema to
29226919f07SPatrick Williamsgenerate a Redfish message entry, but is not used in Redfish or PEL output.
293a96a7948SMatt Spinler
294a6c48787SMatt Spinler```json
295a96a7948SMatt Spinler"Description": "A power fault"
296a96a7948SMatt Spinler```
297a96a7948SMatt Spinler
298a96a7948SMatt Spinler#### Notes
29926919f07SPatrick Williams
300a96a7948SMatt SpinlerThis is an optional free format text field for keeping any notes for the
301a96a7948SMatt Spinlerregistry entry, as comments are not allowed in JSON. It is an array of strings
302a96a7948SMatt Spinlerfor easier readability of long fields.
303a96a7948SMatt Spinler
304a6c48787SMatt Spinler```json
305a96a7948SMatt Spinler"Notes": [
306a96a7948SMatt Spinler    "This entry is for every type of power fault.",
307a96a7948SMatt Spinler    "There is probably a hardware failure."
308a96a7948SMatt Spinler]
309a96a7948SMatt Spinler```
31070311203SMatt Spinler
31170311203SMatt Spinler### Callout Fields
31226919f07SPatrick Williams
31326919f07SPatrick WilliamsThe callout fields allow one to specify the PEL callouts (either a hardware FRU,
31426919f07SPatrick Williamsa symbolic FRU, or a maintenance procedure) in the entry for a particular error.
31526919f07SPatrick WilliamsThese callouts can vary based on system type, as well as a user specified
31626919f07SPatrick WilliamsAdditionalData property field. Callouts will be added to the PEL in the order
31726919f07SPatrick Williamsthey are listed in the JSON. If a callout is passed into the error, say with
31826919f07SPatrick WilliamsCALLOUT_INVENTORY_PATH, then that callout will be added to the PEL before the
31926919f07SPatrick Williamscallouts in the registry.
32070311203SMatt Spinler
32170311203SMatt SpinlerThere is room for up to 10 callouts in a PEL.
32270311203SMatt Spinler
32370311203SMatt Spinler#### Callouts example based on the system type
32470311203SMatt Spinler
325a6c48787SMatt Spinler```json
32670311203SMatt Spinler"Callouts":
32770311203SMatt Spinler[
32870311203SMatt Spinler    {
32970311203SMatt Spinler        "System": "system1",
33070311203SMatt Spinler        "CalloutList":
33170311203SMatt Spinler        [
33270311203SMatt Spinler            {
33370311203SMatt Spinler                "Priority": "high",
33470311203SMatt Spinler                "LocCode": "P1-C1"
33570311203SMatt Spinler            },
33670311203SMatt Spinler            {
33770311203SMatt Spinler                "Priority": "low",
33870311203SMatt Spinler                "LocCode": "P1"
33970311203SMatt Spinler            }
34070311203SMatt Spinler        ]
34170311203SMatt Spinler    },
34270311203SMatt Spinler    {
34370311203SMatt Spinler        "CalloutList":
34470311203SMatt Spinler        [
34570311203SMatt Spinler            {
34670311203SMatt Spinler                "Priority": "high",
34770311203SMatt Spinler                "Procedure": "SVCDOCS"
34870311203SMatt Spinler            }
34970311203SMatt Spinler        ]
35070311203SMatt Spinler
35170311203SMatt Spinler    }
35270311203SMatt Spinler]
35370311203SMatt Spinler
35470311203SMatt Spinler```
35570311203SMatt Spinler
35626919f07SPatrick WilliamsThe above example shows that on system 'system1', the FRU at location P1-C1 will
35726919f07SPatrick Williamsbe called out with a priority of high, and the FRU at P1 with a priority of low.
35826919f07SPatrick WilliamsOn every other system, the maintenance procedure SVCDOCS is called out.
35970311203SMatt Spinler
36070311203SMatt Spinler#### Callouts example based on an AdditionalData field
36170311203SMatt Spinler
362a6c48787SMatt Spinler```json
36370311203SMatt Spinler"CalloutsUsingAD":
36470311203SMatt Spinler{
36570311203SMatt Spinler    "ADName": "PROC_NUM",
36670311203SMatt Spinler    "CalloutsWithTheirADValues":
36770311203SMatt Spinler    [
36870311203SMatt Spinler        {
36970311203SMatt Spinler            "ADValue": "0",
37070311203SMatt Spinler            "Callouts":
37170311203SMatt Spinler            [
37270311203SMatt Spinler                {
37370311203SMatt Spinler                    "CalloutList":
37470311203SMatt Spinler                    [
37570311203SMatt Spinler                        {
37670311203SMatt Spinler                            "Priority": "high",
37770311203SMatt Spinler                            "LocCode": "P1-C5"
37870311203SMatt Spinler                        }
37970311203SMatt Spinler                    ]
38070311203SMatt Spinler                }
38170311203SMatt Spinler            ]
38270311203SMatt Spinler        },
38370311203SMatt Spinler        {
38470311203SMatt Spinler            "ADValue": "1",
38570311203SMatt Spinler            "Callouts":
38670311203SMatt Spinler            [
38770311203SMatt Spinler                {
38870311203SMatt Spinler                    "CalloutList":
38970311203SMatt Spinler                    [
39070311203SMatt Spinler                        {
39170311203SMatt Spinler                            "Priority": "high",
39270311203SMatt Spinler                            "LocCode": "P1-C6"
39370311203SMatt Spinler                        }
39470311203SMatt Spinler                    ]
39570311203SMatt Spinler                }
39670311203SMatt Spinler            ]
39770311203SMatt Spinler        }
39870311203SMatt Spinler    ]
39970311203SMatt Spinler}
40070311203SMatt Spinler
40170311203SMatt Spinler```
40270311203SMatt Spinler
40370311203SMatt SpinlerThis example shows that the callouts were selected based on the 'PROC_NUM'
40426919f07SPatrick WilliamsAdditionalData field. When PROC_NUM was 0, the FRU at P1-C5 was called out. When
40526919f07SPatrick Williamsit was 1, P1-C6 was called out. Note that the same 'Callouts' array is used as
40626919f07SPatrick Williamsin the previous example, so these callouts can also depend on the system type.
40770311203SMatt Spinler
40826919f07SPatrick WilliamsIf it's desired to use a different set of callouts when there isn't a match on
40926919f07SPatrick Williamsthe AdditionalData field, one can use CalloutsWhenNoADMatch. In the following
41026919f07SPatrick Williamsexample, the 'air_mover' callout will be added if 'PROC_NUM' isn't 0.
41126919f07SPatrick Williams'CalloutsWhenNoADMatch' has the same schema as the 'Callouts' section.
4123d923311SMatt Spinler
413a6c48787SMatt Spinler```json
4143d923311SMatt Spinler"CalloutsUsingAD":
4153d923311SMatt Spinler{
4163d923311SMatt Spinler    "ADName": "PROC_NUM",
4173d923311SMatt Spinler    "CalloutsWithTheirADValues":
4183d923311SMatt Spinler    [
4193d923311SMatt Spinler        {
4203d923311SMatt Spinler            "ADValue": "0",
4213d923311SMatt Spinler            "Callouts":
4223d923311SMatt Spinler            [
4233d923311SMatt Spinler                {
4243d923311SMatt Spinler                    "CalloutList":
4253d923311SMatt Spinler                    [
4263d923311SMatt Spinler                        {
4273d923311SMatt Spinler                            "Priority": "high",
4283d923311SMatt Spinler                            "LocCode": "P1-C5"
4293d923311SMatt Spinler                        }
4303d923311SMatt Spinler                    ]
4313d923311SMatt Spinler                }
4323d923311SMatt Spinler            ]
4333d923311SMatt Spinler        },
4343d923311SMatt Spinler    ],
4353d923311SMatt Spinler    "CalloutsWhenNoADMatch": [
4363d923311SMatt Spinler        {
4373d923311SMatt Spinler            "CalloutList": [
4383d923311SMatt Spinler                {
4393d923311SMatt Spinler                    "Priority": "high",
4403d923311SMatt Spinler                    "SymbolicFRU": "air_mover"
4413d923311SMatt Spinler                }
4423d923311SMatt Spinler            ]
4433d923311SMatt Spinler        }
4443d923311SMatt Spinler    ]
4453d923311SMatt Spinler}
4463d923311SMatt Spinler
4473d923311SMatt Spinler```
4483d923311SMatt Spinler
44970311203SMatt Spinler#### CalloutType
45026919f07SPatrick Williams
45126919f07SPatrick WilliamsThis field can be used to modify the failing component type field in the callout
45226919f07SPatrick Williamswhen the default doesn\'t fit:
45370311203SMatt Spinler
454a6c48787SMatt Spinler```json
45570311203SMatt Spinler{
45670311203SMatt Spinler
45770311203SMatt Spinler    "Priority": "high",
45870311203SMatt Spinler    "Procedure": "FIXIT22"
45970311203SMatt Spinler    "CalloutType": "config_procedure"
46070311203SMatt Spinler}
46170311203SMatt Spinler```
46270311203SMatt Spinler
46370311203SMatt SpinlerThe defaults are:
46426919f07SPatrick Williams
46570311203SMatt Spinler- Normal hardware FRU: hardware_fru
46670311203SMatt Spinler- Symbolic FRU: symbolic_fru
46770311203SMatt Spinler- Procedure: maint_procedure
468d03d3d91SMatt Spinler
469f00f9d0fSMatt Spinler#### Symbolic FRU callouts with dynamic trusted location codes
470f00f9d0fSMatt Spinler
471f00f9d0fSMatt SpinlerA special case is when one wants to use a symbolic FRU callout with a trusted
472f00f9d0fSMatt Spinlerlocation code, but the location code to use isn\'t known until runtime. This
473f00f9d0fSMatt Spinlermeans it can\'t be specified using the 'LocCode' key in the registry.
474f00f9d0fSMatt Spinler
475f00f9d0fSMatt SpinlerIn this case, one should use the 'SymbolicFRUTrusted' key along with the
476f00f9d0fSMatt Spinler'UseInventoryLocCode' key, and then pass in the inventory item that has the
477f00f9d0fSMatt Spinlerdesired location code using the 'CALLOUT_INVENTORY_PATH' entry inside of the
478f00f9d0fSMatt SpinlerAdditionalData property. The code will then look up the location code for that
47926919f07SPatrick Williamspassed in inventory FRU and place it in the symbolic FRU callout. The normal FRU
48026919f07SPatrick Williamscallout with that inventory item will not be created. The symbolic FRU must be
48126919f07SPatrick Williamsthe first callout in the registry for this to work.
482f00f9d0fSMatt Spinler
483a6c48787SMatt Spinler```json
484f00f9d0fSMatt Spinler{
485f00f9d0fSMatt Spinler  "Priority": "high",
486f00f9d0fSMatt Spinler  "SymbolicFRUTrusted": "AIR_MOVR",
487f00f9d0fSMatt Spinler  "UseInventoryLocCode": true
488f00f9d0fSMatt Spinler}
489f00f9d0fSMatt Spinler```
490f00f9d0fSMatt Spinler
491f22b4a1eSMatt Spinler### Capturing the Journal
492f22b4a1eSMatt Spinler
493f22b4a1eSMatt SpinlerThe PEL daemon can be told to capture pieces of the journal in PEL UserData
494f22b4a1eSMatt Spinlersections. This could be useful for debugging problems where a BMC dump which
495f22b4a1eSMatt Spinlerwould also contain the journal isn't available.
496f22b4a1eSMatt Spinler
497f22b4a1eSMatt SpinlerThe 'JournalCapture' field has two formats, one that will create one UserData
498f22b4a1eSMatt Spinlersection with the previous N lines of the journal, and another that can capture
499f22b4a1eSMatt Spinlerany number of journal snippets based on the journal's SYSLOG_IDENTIFIER field.
500f22b4a1eSMatt Spinler
501f22b4a1eSMatt Spinler```json
502f22b4a1eSMatt Spinler"JournalCapture": {
503f22b4a1eSMatt Spinler    "NumLines": 30
504f22b4a1eSMatt Spinler}
505f22b4a1eSMatt Spinler```
506f22b4a1eSMatt Spinler
507f22b4a1eSMatt Spinler```json
508f22b4a1eSMatt Spinler"JournalCapture":
509f22b4a1eSMatt Spinler{
510f22b4a1eSMatt Spinler    "Sections": [
511f22b4a1eSMatt Spinler        {
512f22b4a1eSMatt Spinler            "SyslogID": "phosphor-bmc-state-manager",
513f22b4a1eSMatt Spinler            "NumLines": 20
514f22b4a1eSMatt Spinler        },
515f22b4a1eSMatt Spinler        {
516f22b4a1eSMatt Spinler            "SyslogID": "phosphor-log-manager",
517f22b4a1eSMatt Spinler            "NumLines": 15
518f22b4a1eSMatt Spinler        }
519f22b4a1eSMatt Spinler    ]
520f22b4a1eSMatt Spinler}
521f22b4a1eSMatt Spinler```
522f22b4a1eSMatt Spinler
523f22b4a1eSMatt SpinlerThe first example will capture the previous 30 lines from the journal into a
524f22b4a1eSMatt Spinlersingle UserData section.
525f22b4a1eSMatt Spinler
526f22b4a1eSMatt SpinlerThe second example will create two UserData sections, the first with the most
527f22b4a1eSMatt Spinlerrecent 20 lines from phosphor-bmc-state-manager, and the second with 15 lines
528f22b4a1eSMatt Spinlerfrom phosphor-log-manager.
529f22b4a1eSMatt Spinler
530f22b4a1eSMatt SpinlerIf a UserData section would make the PEL exceed its maximum size of 16KB, it
531f22b4a1eSMatt Spinlerwill be dropped.
532f22b4a1eSMatt Spinler
533d03d3d91SMatt Spinler## Modifying and Testing
534d03d3d91SMatt Spinler
535d03d3d91SMatt SpinlerThe general process for adding new entries to the message registry is:
536d03d3d91SMatt Spinler
537d03d3d91SMatt Spinler1. Update message_registry.json to add the new errors.
538d03d3d91SMatt Spinler2. If a new component ID is used (usually the first byte of the SRC reason
5398e823e12SMatt Spinler   code), document it in O_component_ids.json.
540d03d3d91SMatt Spinler3. Validate the file. It must be valid JSON and obey the schema. The
5411ed1067cSMatt Spinler   `validate_registry.py` script in `extensions/openpower-pels/registry/tools`
542d03d3d91SMatt Spinler   will validate both, though it requires the python-jsonschema package to do
543d03d3d91SMatt Spinler   the schema validation. This script is also run to validate the message
544d03d3d91SMatt Spinler   registry as part of CI testing.
545d03d3d91SMatt Spinler
546a6c48787SMatt Spinler   ```sh
5471ed1067cSMatt Spinler   ./tools/validate_registry.py -s schema/schema.json -r message_registry.json
548d03d3d91SMatt Spinler   ```
549d03d3d91SMatt Spinler
550d03d3d91SMatt Spinler4. One can test what PELs are generated from these new entries without writing
551d03d3d91SMatt Spinler   any code to create the corresponding event logs:
552a6c48787SMatt Spinler
553d03d3d91SMatt Spinler   1. Copy the modified message_registry.json into `/etc/phosphor-logging/` on
554d03d3d91SMatt Spinler      the BMC. That directory may need to be created.
55526919f07SPatrick Williams   2. Use busctl to call the Create method to create an event log corresponding
55626919f07SPatrick Williams      to the message registry entry under test.
557d03d3d91SMatt Spinler
558a6c48787SMatt Spinler      ```sh
559d03d3d91SMatt Spinler      busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging \
560d03d3d91SMatt Spinler      xyz.openbmc_project.Logging.Create Create ssa{ss} \
561d03d3d91SMatt Spinler      xyz.openbmc_project.Common.Error.Timeout \
562d03d3d91SMatt Spinler      xyz.openbmc_project.Logging.Entry.Level.Error 1 "TIMEOUT_IN_MSEC" "5"
563d03d3d91SMatt Spinler      ```
564d03d3d91SMatt Spinler
565d03d3d91SMatt Spinler   3. Check the PEL that was created using peltool.
566d03d3d91SMatt Spinler   4. When finished, delete the file from `/etc/phosphor-logging/`.
567