xref: /openbmc/phosphor-logging/extensions/openpower-pels/registry/README.md (revision 26919f07088bc9335e9280c19c94ec147a2d5e5e)
1a96a7948SMatt Spinler# Platform Event Log Message Registry
2*26919f07SPatrick 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
8*26919f07SPatrick Williams
9*26919f07SPatrick Williams- [Component IDs](#component-ids)
10*26919f07SPatrick Williams- [Message Registry](#message-registry-fields)
11*26919f07SPatrick Williams- [Modifying and Testing](#modifying-and-testing)
12a96a7948SMatt Spinler
13a96a7948SMatt Spinler## Component IDs
14*26919f07SPatrick Williams
15a96a7948SMatt SpinlerA component ID is a 2 byte value of the form 0xYY00 used in a PEL to:
16*26919f07SPatrick Williams
17a96a7948SMatt Spinler1. Provide the upper byte (the YY from above) of an SRC reason code in `BD`
18a96a7948SMatt Spinler   SRCs.
19*26919f07SPatrick Williams2. Reside in the section header of the Private Header PEL section to specify the
20*26919f07SPatrick 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.
23*26919f07SPatrick Williams4. Reside in the section header in the User Data section to specify which parser
24*26919f07SPatrick 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
30*26919f07SPatrick WilliamsComponent IDs will be unique on a per-repository basis for errors unique to that
31*26919f07SPatrick Williamsrepository. When the same errors are created by multiple repositories, those
32*26919f07SPatrick Williamserrors will all share the same component ID. The master list of component IDs is
33*26919f07SPatrick Williams[here](O_component_ids.json). That file can used by PEL parsers to display a
34*26919f07SPatrick Williamsname for the component ID. The 'O' in the name is the creator ID value for BMC
35*26919f07SPatrick Williamscreated PELs.
36a96a7948SMatt Spinler
37a96a7948SMatt Spinler## Message Registry Fields
38*26919f07SPatrick 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
46*26919f07SPatrick Williams
47*26919f07SPatrick WilliamsThis is the key into the message registry, and is the Message property of the
48*26919f07SPatrick WilliamsOpenBMC event log that the PEL is being created from.
49a96a7948SMatt Spinler
50a96a7948SMatt Spinler```
51a96a7948SMatt Spinler"Name": "xyz.openbmc_project.Power.Fault"
52a96a7948SMatt Spinler```
53a96a7948SMatt Spinler
54a96a7948SMatt Spinler### Subsystem
55*26919f07SPatrick Williams
56*26919f07SPatrick WilliamsThis field is part of the PEL User Header section, and is used to specify the
57*26919f07SPatrick Williamssubsystem pertaining to the error. It is an enumeration that maps to the actual
58*26919f07SPatrick WilliamsPEL value. If the subsystem isn't known ahead of time, it can be passed in at
59*26919f07SPatrick Williamsthe time of PEL creation using the 'PEL_SUBSYSTEM' AdditionalData field. In this
60*26919f07SPatrick Williamscase, 'Subsystem' isn't required, though 'PossibleSubsystems' is.
61a96a7948SMatt Spinler
62a96a7948SMatt Spinler```
63a96a7948SMatt Spinler"Subsystem": "power_supply"
64a96a7948SMatt Spinler```
65a96a7948SMatt Spinler
6623970b0dSMatt Spinler### PossibleSubsystems
67*26919f07SPatrick Williams
68*26919f07SPatrick WilliamsThis field is used by scripts that build documentation from the message registry
69*26919f07SPatrick Williamsto know which subsystems are possible for an error when it can't be hardcoded
70*26919f07SPatrick Williamsusing the 'Subsystem' field. It is mutually exclusive with the 'Subsystem'
71*26919f07SPatrick Williamsfield.
7223970b0dSMatt Spinler
7323970b0dSMatt Spinler```
7423970b0dSMatt Spinler"PossibleSubsystems": ["memory", "processor"]
7523970b0dSMatt Spinler```
7623970b0dSMatt Spinler
77a96a7948SMatt Spinler### Severity
78*26919f07SPatrick Williams
79*26919f07SPatrick WilliamsThis field is part of the PEL User Header section, and is used to specify the
80*26919f07SPatrick WilliamsPEL severity. It is an optional field, if it isn't specified, then the severity
81*26919f07SPatrick 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
87a96a7948SMatt Spinler```
88a96a7948SMatt Spinler"Severity": "unrecoverable"
89a96a7948SMatt Spinler```
90a96a7948SMatt Spinler
9117952d94SMatt Spinler```
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```
103*26919f07SPatrick Williams
104*26919f07SPatrick WilliamsThe above example shows that on system 'system1' the severity will be recovered,
105*26919f07SPatrick Williamsand on every other system it will be unrecoverable.
10617952d94SMatt Spinler
107a96a7948SMatt Spinler### Mfg Severity
108*26919f07SPatrick 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
113a96a7948SMatt Spinler```
114a96a7948SMatt Spinler"MfgSeverity": "unrecoverable"
115a96a7948SMatt Spinler```
116a96a7948SMatt Spinler
117a96a7948SMatt Spinler### Event Scope
118*26919f07SPatrick Williams
119*26919f07SPatrick WilliamsThis field is part of the PEL User Header section, and is used to specify the
120*26919f07SPatrick Williamsevent scope, as defined by the PEL spec. It is optional and defaults to "entire
121*26919f07SPatrick Williamsplatform".
122a96a7948SMatt Spinler
123a96a7948SMatt Spinler```
124a96a7948SMatt Spinler"EventScope": "entire_platform"
125a96a7948SMatt Spinler```
126a96a7948SMatt Spinler
127a96a7948SMatt Spinler### Event Type
128*26919f07SPatrick Williams
129*26919f07SPatrick WilliamsThis field is part of the PEL User Header section, and is used to specify the
130*26919f07SPatrick Williamsevent type, as defined by the PEL spec. It is optional and defaults to "not
131*26919f07SPatrick Williamsapplicable" for non-informational logs, and "misc_information_only" for
1323fb208e3SMatt Spinlerinformational ones.
133a96a7948SMatt Spinler
134a96a7948SMatt Spinler```
135a96a7948SMatt Spinler"EventType": "na"
136a96a7948SMatt Spinler```
137a96a7948SMatt Spinler
138a96a7948SMatt Spinler### Action Flags
139*26919f07SPatrick 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
144*26919f07SPatrick Williamsseverity or if there are any callouts. As such, this is an optional field and if
145*26919f07SPatrick 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
151a96a7948SMatt Spinler```
152a96a7948SMatt Spinler"ActionFlags": ["service_action", "report", "call_home"]
153a96a7948SMatt Spinler```
154a96a7948SMatt Spinler
155a96a7948SMatt Spinler### Mfg Action Flags
156*26919f07SPatrick 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
160a96a7948SMatt Spinler```
161a96a7948SMatt Spinler"MfgActionFlags": ["service_action", "report", "call_home"]
162a96a7948SMatt Spinler```
163a96a7948SMatt Spinler
164a96a7948SMatt Spinler### Component ID
165*26919f07SPatrick Williams
166*26919f07SPatrick WilliamsThis is the component ID of the PEL creator, in the form 0xYY00. For `BD` SRCs,
167*26919f07SPatrick Williamsthis is an optional field and if not present the value will be taken from the
168*26919f07SPatrick Williamsupper byte of the reason code. If present for `BD` SRCs, then this byte must
169*26919f07SPatrick Williamsmatch the upper byte of the reason code.
170a96a7948SMatt Spinler
171a96a7948SMatt Spinler```
172a96a7948SMatt Spinler"ComponentID": "0x5500"
173a96a7948SMatt Spinler```
174a96a7948SMatt Spinler
175a96a7948SMatt Spinler### SRC Type
176*26919f07SPatrick Williams
177*26919f07SPatrick WilliamsThis specifies the type of SRC to create. The type is the first 2 characters of
178*26919f07SPatrick Williamsthe 8 character ASCII string field of the PEL. The allowed types are `BD`, for
179*26919f07SPatrick Williamsthe standard OpenBMC error, and `11`, for power related errors. It is optional
180*26919f07SPatrick Williamsand if not specified will default to `BD`.
181a96a7948SMatt Spinler
182a96a7948SMatt SpinlerNote: The ASCII string for BD SRCs looks like: `BDBBCCCC`, where:
183*26919f07SPatrick Williams
184*26919f07SPatrick Williams- BD = SRC type
185*26919f07SPatrick Williams- BB = PEL subsystem as mentioned above
186*26919f07SPatrick Williams- CCCC SRC reason code
187a96a7948SMatt Spinler
188a96a7948SMatt SpinlerFor `11` SRCs, it looks like: `1100RRRR`, where RRRR is the SRC reason code.
189a96a7948SMatt Spinler
190a96a7948SMatt Spinler```
191a96a7948SMatt Spinler"Type": "11"
192a96a7948SMatt Spinler```
193a96a7948SMatt Spinler
194a96a7948SMatt Spinler### SRC Reason Code
195*26919f07SPatrick Williams
196*26919f07SPatrick WilliamsThis is the 4 character value in the latter half of the SRC ASCII string. It is
197*26919f07SPatrick Williamstreated as a 2 byte hex value, such as 0x5678. For `BD` SRCs, the first byte is
198*26919f07SPatrick Williamsthe same as the first byte of the component ID field in the Private Header
199*26919f07SPatrick Williamssection that represents the creator's component ID.
200a96a7948SMatt Spinler
201a96a7948SMatt Spinler```
202a96a7948SMatt Spinler"ReasonCode": "0x5544"
203a96a7948SMatt Spinler```
204a96a7948SMatt Spinler
205a96a7948SMatt Spinler### SRC Symptom ID Fields
206*26919f07SPatrick 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
218a96a7948SMatt Spinler```
219a96a7948SMatt Spinler"SymptomIDFields": ["SRCWord3", "SRCWord9"]
220a96a7948SMatt Spinler```
221a96a7948SMatt Spinler
222a96a7948SMatt Spinler### SRC words 6 to 9
223*26919f07SPatrick 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
231a96a7948SMatt Spinler```
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
243*26919f07SPatrick 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
249*26919f07SPatrick 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
252*26919f07SPatrick Williamsusing the %1, %2, etc placeholders allowing any of the SRC user data words 6 - 9
253*26919f07SPatrick Williamsto be displayed as part of the message. If the placeholders are used, then the
254*26919f07SPatrick Williams`MessageArgSources` property must be present to say which SRC words to use for
255*26919f07SPatrick Williamseach placeholder.
256a96a7948SMatt Spinler
257a96a7948SMatt Spinler```
258a96a7948SMatt Spinler"Message": "Processor %1 had %2 errors"
259a96a7948SMatt Spinler```
260a96a7948SMatt Spinler
261a96a7948SMatt Spinler#### MessageArgSources
262*26919f07SPatrick 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
268a96a7948SMatt Spinler```
269a96a7948SMatt Spinler"MessageArgSources":
270a96a7948SMatt Spinler[
271a96a7948SMatt Spinler    "SRCWord6", "SRCWord7"
272a96a7948SMatt Spinler]
273a96a7948SMatt Spinler```
274a96a7948SMatt Spinler
275a96a7948SMatt Spinler#### Description
276*26919f07SPatrick Williams
277*26919f07SPatrick WilliamsA short description of the error. This is required by the Redfish schema to
278*26919f07SPatrick Williamsgenerate a Redfish message entry, but is not used in Redfish or PEL output.
279a96a7948SMatt Spinler
280a96a7948SMatt Spinler```
281a96a7948SMatt Spinler"Description": "A power fault"
282a96a7948SMatt Spinler```
283a96a7948SMatt Spinler
284a96a7948SMatt Spinler#### Notes
285*26919f07SPatrick 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
290a96a7948SMatt Spinler```
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
298*26919f07SPatrick Williams
299*26919f07SPatrick WilliamsThe callout fields allow one to specify the PEL callouts (either a hardware FRU,
300*26919f07SPatrick Williamsa symbolic FRU, or a maintenance procedure) in the entry for a particular error.
301*26919f07SPatrick WilliamsThese callouts can vary based on system type, as well as a user specified
302*26919f07SPatrick WilliamsAdditionalData property field. Callouts will be added to the PEL in the order
303*26919f07SPatrick Williamsthey are listed in the JSON. If a callout is passed into the error, say with
304*26919f07SPatrick WilliamsCALLOUT_INVENTORY_PATH, then that callout will be added to the PEL before the
305*26919f07SPatrick 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
31170311203SMatt Spinler```
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
342*26919f07SPatrick WilliamsThe above example shows that on system 'system1', the FRU at location P1-C1 will
343*26919f07SPatrick Williamsbe called out with a priority of high, and the FRU at P1 with a priority of low.
344*26919f07SPatrick WilliamsOn every other system, the maintenance procedure SVCDOCS is called out.
34570311203SMatt Spinler
34670311203SMatt Spinler#### Callouts example based on an AdditionalData field
34770311203SMatt Spinler
34870311203SMatt Spinler```
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'
390*26919f07SPatrick WilliamsAdditionalData field. When PROC_NUM was 0, the FRU at P1-C5 was called out. When
391*26919f07SPatrick Williamsit was 1, P1-C6 was called out. Note that the same 'Callouts' array is used as
392*26919f07SPatrick Williamsin the previous example, so these callouts can also depend on the system type.
39370311203SMatt Spinler
394*26919f07SPatrick WilliamsIf it's desired to use a different set of callouts when there isn't a match on
395*26919f07SPatrick Williamsthe AdditionalData field, one can use CalloutsWhenNoADMatch. In the following
396*26919f07SPatrick Williamsexample, the 'air_mover' callout will be added if 'PROC_NUM' isn't 0.
397*26919f07SPatrick Williams'CalloutsWhenNoADMatch' has the same schema as the 'Callouts' section.
3983d923311SMatt Spinler
3993d923311SMatt Spinler```
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
436*26919f07SPatrick Williams
437*26919f07SPatrick WilliamsThis field can be used to modify the failing component type field in the callout
438*26919f07SPatrick Williamswhen the default doesn\'t fit:
43970311203SMatt Spinler
44070311203SMatt Spinler```
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:
450*26919f07SPatrick 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
465*26919f07SPatrick Williamspassed in inventory FRU and place it in the symbolic FRU callout. The normal FRU
466*26919f07SPatrick Williamscallout with that inventory item will not be created. The symbolic FRU must be
467*26919f07SPatrick Williamsthe first callout in the registry for this to work.
468f00f9d0fSMatt Spinler
469f00f9d0fSMatt Spinler```
470f00f9d0fSMatt Spinler{
471f00f9d0fSMatt Spinler
472f00f9d0fSMatt Spinler    "Priority": "high",
473f00f9d0fSMatt Spinler    "SymbolicFRUTrusted": "AIR_MOVR",
474f00f9d0fSMatt Spinler    "UseInventoryLocCode": true
475f00f9d0fSMatt Spinler}
476f00f9d0fSMatt Spinler```
477f00f9d0fSMatt Spinler
478d03d3d91SMatt Spinler## Modifying and Testing
479d03d3d91SMatt Spinler
480d03d3d91SMatt SpinlerThe general process for adding new entries to the message registry is:
481d03d3d91SMatt Spinler
482d03d3d91SMatt Spinler1. Update message_registry.json to add the new errors.
483d03d3d91SMatt Spinler2. If a new component ID is used (usually the first byte of the SRC reason
4848e823e12SMatt Spinler   code), document it in O_component_ids.json.
485d03d3d91SMatt Spinler3. Validate the file. It must be valid JSON and obey the schema. The
486d03d3d91SMatt Spinler   `process_registry.py` script in `extensions/openpower-pels/registry/tools`
487d03d3d91SMatt Spinler   will validate both, though it requires the python-jsonschema package to do
488d03d3d91SMatt Spinler   the schema validation. This script is also run to validate the message
489d03d3d91SMatt Spinler   registry as part of CI testing.
490d03d3d91SMatt Spinler
491d03d3d91SMatt Spinler```
492d03d3d91SMatt Spinler ./tools/process_registry.py -v -s schema/schema.json -r message_registry.json
493d03d3d91SMatt Spinler```
494d03d3d91SMatt Spinler
495d03d3d91SMatt Spinler4. One can test what PELs are generated from these new entries without writing
496d03d3d91SMatt Spinler   any code to create the corresponding event logs:
497d03d3d91SMatt Spinler   1. Copy the modified message_registry.json into `/etc/phosphor-logging/` on
498d03d3d91SMatt Spinler      the BMC. That directory may need to be created.
499*26919f07SPatrick Williams   2. Use busctl to call the Create method to create an event log corresponding
500*26919f07SPatrick Williams      to the message registry entry under test.
501d03d3d91SMatt Spinler
502d03d3d91SMatt Spinler```
503d03d3d91SMatt Spinlerbusctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging \
504d03d3d91SMatt Spinlerxyz.openbmc_project.Logging.Create Create ssa{ss} \
505d03d3d91SMatt Spinlerxyz.openbmc_project.Common.Error.Timeout \
506d03d3d91SMatt Spinlerxyz.openbmc_project.Logging.Entry.Level.Error 1 "TIMEOUT_IN_MSEC" "5"
507d03d3d91SMatt Spinler```
508d03d3d91SMatt Spinler
509d03d3d91SMatt Spinler    3. Check the PEL that was created using peltool.
510d03d3d91SMatt Spinler    4. When finished, delete the file from `/etc/phosphor-logging/`.
511