xref: /openbmc/phosphor-logging/extensions/openpower-pels/registry/README.md (revision 1ed1067cea13c64037bfe0fe318c9233b811f73d)
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
242a96a7948SMatt Spinler### Documentation Fields
24326919f07SPatrick Williams
244a96a7948SMatt SpinlerThe documentation fields are used by PEL parsers to display a human readable
245a96a7948SMatt Spinlerdescription of a PEL. They are also the source for the Redfish event log
246a96a7948SMatt Spinlermessages.
247a96a7948SMatt Spinler
248a96a7948SMatt Spinler#### Message
24926919f07SPatrick Williams
250a96a7948SMatt SpinlerThis field is used by the BMC's PEL parser as the description of the error log.
251a96a7948SMatt SpinlerIt will also be used in Redfish event logs. It supports argument substitution
25226919f07SPatrick Williamsusing the %1, %2, etc placeholders allowing any of the SRC user data words 6 - 9
25326919f07SPatrick Williamsto be displayed as part of the message. If the placeholders are used, then the
25426919f07SPatrick Williams`MessageArgSources` property must be present to say which SRC words to use for
25526919f07SPatrick Williamseach placeholder.
256a96a7948SMatt Spinler
257a6c48787SMatt Spinler```json
258a96a7948SMatt Spinler"Message": "Processor %1 had %2 errors"
259a96a7948SMatt Spinler```
260a96a7948SMatt Spinler
261a96a7948SMatt Spinler#### MessageArgSources
26226919f07SPatrick Williams
263a96a7948SMatt SpinlerThis optional field is required when the Message field contains the %X
264a96a7948SMatt Spinlerplaceholder arguments. It is an array that says which SRC words to get the
265a96a7948SMatt Spinlerplaceholders from. In the example below, SRC word 6 would be used for %1, and
266a96a7948SMatt SpinlerSRC word 7 for %2.
267a96a7948SMatt Spinler
268a6c48787SMatt Spinler```json
269a96a7948SMatt Spinler"MessageArgSources":
270a96a7948SMatt Spinler[
271a96a7948SMatt Spinler    "SRCWord6", "SRCWord7"
272a96a7948SMatt Spinler]
273a96a7948SMatt Spinler```
274a96a7948SMatt Spinler
275a96a7948SMatt Spinler#### Description
27626919f07SPatrick Williams
27726919f07SPatrick WilliamsA short description of the error. This is required by the Redfish schema to
27826919f07SPatrick Williamsgenerate a Redfish message entry, but is not used in Redfish or PEL output.
279a96a7948SMatt Spinler
280a6c48787SMatt Spinler```json
281a96a7948SMatt Spinler"Description": "A power fault"
282a96a7948SMatt Spinler```
283a96a7948SMatt Spinler
284a96a7948SMatt Spinler#### Notes
28526919f07SPatrick Williams
286a96a7948SMatt SpinlerThis is an optional free format text field for keeping any notes for the
287a96a7948SMatt Spinlerregistry entry, as comments are not allowed in JSON. It is an array of strings
288a96a7948SMatt Spinlerfor easier readability of long fields.
289a96a7948SMatt Spinler
290a6c48787SMatt Spinler```json
291a96a7948SMatt Spinler"Notes": [
292a96a7948SMatt Spinler    "This entry is for every type of power fault.",
293a96a7948SMatt Spinler    "There is probably a hardware failure."
294a96a7948SMatt Spinler]
295a96a7948SMatt Spinler```
29670311203SMatt Spinler
29770311203SMatt Spinler### Callout Fields
29826919f07SPatrick Williams
29926919f07SPatrick WilliamsThe callout fields allow one to specify the PEL callouts (either a hardware FRU,
30026919f07SPatrick Williamsa symbolic FRU, or a maintenance procedure) in the entry for a particular error.
30126919f07SPatrick WilliamsThese callouts can vary based on system type, as well as a user specified
30226919f07SPatrick WilliamsAdditionalData property field. Callouts will be added to the PEL in the order
30326919f07SPatrick Williamsthey are listed in the JSON. If a callout is passed into the error, say with
30426919f07SPatrick WilliamsCALLOUT_INVENTORY_PATH, then that callout will be added to the PEL before the
30526919f07SPatrick Williamscallouts in the registry.
30670311203SMatt Spinler
30770311203SMatt SpinlerThere is room for up to 10 callouts in a PEL.
30870311203SMatt Spinler
30970311203SMatt Spinler#### Callouts example based on the system type
31070311203SMatt Spinler
311a6c48787SMatt Spinler```json
31270311203SMatt Spinler"Callouts":
31370311203SMatt Spinler[
31470311203SMatt Spinler    {
31570311203SMatt Spinler        "System": "system1",
31670311203SMatt Spinler        "CalloutList":
31770311203SMatt Spinler        [
31870311203SMatt Spinler            {
31970311203SMatt Spinler                "Priority": "high",
32070311203SMatt Spinler                "LocCode": "P1-C1"
32170311203SMatt Spinler            },
32270311203SMatt Spinler            {
32370311203SMatt Spinler                "Priority": "low",
32470311203SMatt Spinler                "LocCode": "P1"
32570311203SMatt Spinler            }
32670311203SMatt Spinler        ]
32770311203SMatt Spinler    },
32870311203SMatt Spinler    {
32970311203SMatt Spinler        "CalloutList":
33070311203SMatt Spinler        [
33170311203SMatt Spinler            {
33270311203SMatt Spinler                "Priority": "high",
33370311203SMatt Spinler                "Procedure": "SVCDOCS"
33470311203SMatt Spinler            }
33570311203SMatt Spinler        ]
33670311203SMatt Spinler
33770311203SMatt Spinler    }
33870311203SMatt Spinler]
33970311203SMatt Spinler
34070311203SMatt Spinler```
34170311203SMatt Spinler
34226919f07SPatrick WilliamsThe above example shows that on system 'system1', the FRU at location P1-C1 will
34326919f07SPatrick Williamsbe called out with a priority of high, and the FRU at P1 with a priority of low.
34426919f07SPatrick WilliamsOn every other system, the maintenance procedure SVCDOCS is called out.
34570311203SMatt Spinler
34670311203SMatt Spinler#### Callouts example based on an AdditionalData field
34770311203SMatt Spinler
348a6c48787SMatt Spinler```json
34970311203SMatt Spinler"CalloutsUsingAD":
35070311203SMatt Spinler{
35170311203SMatt Spinler    "ADName": "PROC_NUM",
35270311203SMatt Spinler    "CalloutsWithTheirADValues":
35370311203SMatt Spinler    [
35470311203SMatt Spinler        {
35570311203SMatt Spinler            "ADValue": "0",
35670311203SMatt Spinler            "Callouts":
35770311203SMatt Spinler            [
35870311203SMatt Spinler                {
35970311203SMatt Spinler                    "CalloutList":
36070311203SMatt Spinler                    [
36170311203SMatt Spinler                        {
36270311203SMatt Spinler                            "Priority": "high",
36370311203SMatt Spinler                            "LocCode": "P1-C5"
36470311203SMatt Spinler                        }
36570311203SMatt Spinler                    ]
36670311203SMatt Spinler                }
36770311203SMatt Spinler            ]
36870311203SMatt Spinler        },
36970311203SMatt Spinler        {
37070311203SMatt Spinler            "ADValue": "1",
37170311203SMatt Spinler            "Callouts":
37270311203SMatt Spinler            [
37370311203SMatt Spinler                {
37470311203SMatt Spinler                    "CalloutList":
37570311203SMatt Spinler                    [
37670311203SMatt Spinler                        {
37770311203SMatt Spinler                            "Priority": "high",
37870311203SMatt Spinler                            "LocCode": "P1-C6"
37970311203SMatt Spinler                        }
38070311203SMatt Spinler                    ]
38170311203SMatt Spinler                }
38270311203SMatt Spinler            ]
38370311203SMatt Spinler        }
38470311203SMatt Spinler    ]
38570311203SMatt Spinler}
38670311203SMatt Spinler
38770311203SMatt Spinler```
38870311203SMatt Spinler
38970311203SMatt SpinlerThis example shows that the callouts were selected based on the 'PROC_NUM'
39026919f07SPatrick WilliamsAdditionalData field. When PROC_NUM was 0, the FRU at P1-C5 was called out. When
39126919f07SPatrick Williamsit was 1, P1-C6 was called out. Note that the same 'Callouts' array is used as
39226919f07SPatrick Williamsin the previous example, so these callouts can also depend on the system type.
39370311203SMatt Spinler
39426919f07SPatrick WilliamsIf it's desired to use a different set of callouts when there isn't a match on
39526919f07SPatrick Williamsthe AdditionalData field, one can use CalloutsWhenNoADMatch. In the following
39626919f07SPatrick Williamsexample, the 'air_mover' callout will be added if 'PROC_NUM' isn't 0.
39726919f07SPatrick Williams'CalloutsWhenNoADMatch' has the same schema as the 'Callouts' section.
3983d923311SMatt Spinler
399a6c48787SMatt Spinler```json
4003d923311SMatt Spinler"CalloutsUsingAD":
4013d923311SMatt Spinler{
4023d923311SMatt Spinler    "ADName": "PROC_NUM",
4033d923311SMatt Spinler    "CalloutsWithTheirADValues":
4043d923311SMatt Spinler    [
4053d923311SMatt Spinler        {
4063d923311SMatt Spinler            "ADValue": "0",
4073d923311SMatt Spinler            "Callouts":
4083d923311SMatt Spinler            [
4093d923311SMatt Spinler                {
4103d923311SMatt Spinler                    "CalloutList":
4113d923311SMatt Spinler                    [
4123d923311SMatt Spinler                        {
4133d923311SMatt Spinler                            "Priority": "high",
4143d923311SMatt Spinler                            "LocCode": "P1-C5"
4153d923311SMatt Spinler                        }
4163d923311SMatt Spinler                    ]
4173d923311SMatt Spinler                }
4183d923311SMatt Spinler            ]
4193d923311SMatt Spinler        },
4203d923311SMatt Spinler    ],
4213d923311SMatt Spinler    "CalloutsWhenNoADMatch": [
4223d923311SMatt Spinler        {
4233d923311SMatt Spinler            "CalloutList": [
4243d923311SMatt Spinler                {
4253d923311SMatt Spinler                    "Priority": "high",
4263d923311SMatt Spinler                    "SymbolicFRU": "air_mover"
4273d923311SMatt Spinler                }
4283d923311SMatt Spinler            ]
4293d923311SMatt Spinler        }
4303d923311SMatt Spinler    ]
4313d923311SMatt Spinler}
4323d923311SMatt Spinler
4333d923311SMatt Spinler```
4343d923311SMatt Spinler
43570311203SMatt Spinler#### CalloutType
43626919f07SPatrick Williams
43726919f07SPatrick WilliamsThis field can be used to modify the failing component type field in the callout
43826919f07SPatrick Williamswhen the default doesn\'t fit:
43970311203SMatt Spinler
440a6c48787SMatt Spinler```json
44170311203SMatt Spinler{
44270311203SMatt Spinler
44370311203SMatt Spinler    "Priority": "high",
44470311203SMatt Spinler    "Procedure": "FIXIT22"
44570311203SMatt Spinler    "CalloutType": "config_procedure"
44670311203SMatt Spinler}
44770311203SMatt Spinler```
44870311203SMatt Spinler
44970311203SMatt SpinlerThe defaults are:
45026919f07SPatrick Williams
45170311203SMatt Spinler- Normal hardware FRU: hardware_fru
45270311203SMatt Spinler- Symbolic FRU: symbolic_fru
45370311203SMatt Spinler- Procedure: maint_procedure
454d03d3d91SMatt Spinler
455f00f9d0fSMatt Spinler#### Symbolic FRU callouts with dynamic trusted location codes
456f00f9d0fSMatt Spinler
457f00f9d0fSMatt SpinlerA special case is when one wants to use a symbolic FRU callout with a trusted
458f00f9d0fSMatt Spinlerlocation code, but the location code to use isn\'t known until runtime. This
459f00f9d0fSMatt Spinlermeans it can\'t be specified using the 'LocCode' key in the registry.
460f00f9d0fSMatt Spinler
461f00f9d0fSMatt SpinlerIn this case, one should use the 'SymbolicFRUTrusted' key along with the
462f00f9d0fSMatt Spinler'UseInventoryLocCode' key, and then pass in the inventory item that has the
463f00f9d0fSMatt Spinlerdesired location code using the 'CALLOUT_INVENTORY_PATH' entry inside of the
464f00f9d0fSMatt SpinlerAdditionalData property. The code will then look up the location code for that
46526919f07SPatrick Williamspassed in inventory FRU and place it in the symbolic FRU callout. The normal FRU
46626919f07SPatrick Williamscallout with that inventory item will not be created. The symbolic FRU must be
46726919f07SPatrick Williamsthe first callout in the registry for this to work.
468f00f9d0fSMatt Spinler
469a6c48787SMatt Spinler```json
470f00f9d0fSMatt Spinler{
471f00f9d0fSMatt Spinler  "Priority": "high",
472f00f9d0fSMatt Spinler  "SymbolicFRUTrusted": "AIR_MOVR",
473f00f9d0fSMatt Spinler  "UseInventoryLocCode": true
474f00f9d0fSMatt Spinler}
475f00f9d0fSMatt Spinler```
476f00f9d0fSMatt Spinler
477f22b4a1eSMatt Spinler### Capturing the Journal
478f22b4a1eSMatt Spinler
479f22b4a1eSMatt SpinlerThe PEL daemon can be told to capture pieces of the journal in PEL UserData
480f22b4a1eSMatt Spinlersections. This could be useful for debugging problems where a BMC dump which
481f22b4a1eSMatt Spinlerwould also contain the journal isn't available.
482f22b4a1eSMatt Spinler
483f22b4a1eSMatt SpinlerThe 'JournalCapture' field has two formats, one that will create one UserData
484f22b4a1eSMatt Spinlersection with the previous N lines of the journal, and another that can capture
485f22b4a1eSMatt Spinlerany number of journal snippets based on the journal's SYSLOG_IDENTIFIER field.
486f22b4a1eSMatt Spinler
487f22b4a1eSMatt Spinler```json
488f22b4a1eSMatt Spinler"JournalCapture": {
489f22b4a1eSMatt Spinler    "NumLines": 30
490f22b4a1eSMatt Spinler}
491f22b4a1eSMatt Spinler```
492f22b4a1eSMatt Spinler
493f22b4a1eSMatt Spinler```json
494f22b4a1eSMatt Spinler"JournalCapture":
495f22b4a1eSMatt Spinler{
496f22b4a1eSMatt Spinler    "Sections": [
497f22b4a1eSMatt Spinler        {
498f22b4a1eSMatt Spinler            "SyslogID": "phosphor-bmc-state-manager",
499f22b4a1eSMatt Spinler            "NumLines": 20
500f22b4a1eSMatt Spinler        },
501f22b4a1eSMatt Spinler        {
502f22b4a1eSMatt Spinler            "SyslogID": "phosphor-log-manager",
503f22b4a1eSMatt Spinler            "NumLines": 15
504f22b4a1eSMatt Spinler        }
505f22b4a1eSMatt Spinler    ]
506f22b4a1eSMatt Spinler}
507f22b4a1eSMatt Spinler```
508f22b4a1eSMatt Spinler
509f22b4a1eSMatt SpinlerThe first example will capture the previous 30 lines from the journal into a
510f22b4a1eSMatt Spinlersingle UserData section.
511f22b4a1eSMatt Spinler
512f22b4a1eSMatt SpinlerThe second example will create two UserData sections, the first with the most
513f22b4a1eSMatt Spinlerrecent 20 lines from phosphor-bmc-state-manager, and the second with 15 lines
514f22b4a1eSMatt Spinlerfrom phosphor-log-manager.
515f22b4a1eSMatt Spinler
516f22b4a1eSMatt SpinlerIf a UserData section would make the PEL exceed its maximum size of 16KB, it
517f22b4a1eSMatt Spinlerwill be dropped.
518f22b4a1eSMatt Spinler
519d03d3d91SMatt Spinler## Modifying and Testing
520d03d3d91SMatt Spinler
521d03d3d91SMatt SpinlerThe general process for adding new entries to the message registry is:
522d03d3d91SMatt Spinler
523d03d3d91SMatt Spinler1. Update message_registry.json to add the new errors.
524d03d3d91SMatt Spinler2. If a new component ID is used (usually the first byte of the SRC reason
5258e823e12SMatt Spinler   code), document it in O_component_ids.json.
526d03d3d91SMatt Spinler3. Validate the file. It must be valid JSON and obey the schema. The
527*1ed1067cSMatt Spinler   `validate_registry.py` script in `extensions/openpower-pels/registry/tools`
528d03d3d91SMatt Spinler   will validate both, though it requires the python-jsonschema package to do
529d03d3d91SMatt Spinler   the schema validation. This script is also run to validate the message
530d03d3d91SMatt Spinler   registry as part of CI testing.
531d03d3d91SMatt Spinler
532a6c48787SMatt Spinler   ```sh
533*1ed1067cSMatt Spinler   ./tools/validate_registry.py -s schema/schema.json -r message_registry.json
534d03d3d91SMatt Spinler   ```
535d03d3d91SMatt Spinler
536d03d3d91SMatt Spinler4. One can test what PELs are generated from these new entries without writing
537d03d3d91SMatt Spinler   any code to create the corresponding event logs:
538a6c48787SMatt Spinler
539d03d3d91SMatt Spinler   1. Copy the modified message_registry.json into `/etc/phosphor-logging/` on
540d03d3d91SMatt Spinler      the BMC. That directory may need to be created.
54126919f07SPatrick Williams   2. Use busctl to call the Create method to create an event log corresponding
54226919f07SPatrick Williams      to the message registry entry under test.
543d03d3d91SMatt Spinler
544a6c48787SMatt Spinler      ```sh
545d03d3d91SMatt Spinler      busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging \
546d03d3d91SMatt Spinler      xyz.openbmc_project.Logging.Create Create ssa{ss} \
547d03d3d91SMatt Spinler      xyz.openbmc_project.Common.Error.Timeout \
548d03d3d91SMatt Spinler      xyz.openbmc_project.Logging.Entry.Level.Error 1 "TIMEOUT_IN_MSEC" "5"
549d03d3d91SMatt Spinler      ```
550d03d3d91SMatt Spinler
551d03d3d91SMatt Spinler   3. Check the PEL that was created using peltool.
552d03d3d91SMatt Spinler   4. When finished, delete the file from `/etc/phosphor-logging/`.
553