1a96a7948SMatt Spinler# Platform Event Log Message Registry 2a96a7948SMatt SpinlerOn the BMC, PELs are created from the standard event logs provided by 3a96a7948SMatt Spinlerphosphor-logging using a message registry that provides the PEL related fields. 4a96a7948SMatt SpinlerThe message registry is a JSON file. 5a96a7948SMatt Spinler 6a96a7948SMatt Spinler## Contents 7a96a7948SMatt Spinler* [Component IDs](#component-ids) 8a96a7948SMatt Spinler* [Message Registry](#message-registry-fields) 9d03d3d91SMatt Spinler* [Modifying and Testing](#modifying-and-testing) 10a96a7948SMatt Spinler 11a96a7948SMatt Spinler## Component IDs 12a96a7948SMatt SpinlerA component ID is a 2 byte value of the form 0xYY00 used in a PEL to: 13a96a7948SMatt Spinler1. Provide the upper byte (the YY from above) of an SRC reason code in `BD` 14a96a7948SMatt Spinler SRCs. 15a96a7948SMatt Spinler2. Reside in the section header of the Private Header PEL section to specify 16a96a7948SMatt Spinler the error log creator's component ID. 17a96a7948SMatt Spinler3. Reside in the section header of the User Header section to specify the error 18a96a7948SMatt Spinler log committer's component ID. 19a96a7948SMatt Spinler4. Reside in the section header in the User Data section to specify which 20a96a7948SMatt Spinler parser to call to parse that section. 21a96a7948SMatt Spinler 22a96a7948SMatt SpinlerComponent IDs are specified in the message registry either as the upper byte of 23a96a7948SMatt Spinlerthe SRC reason code field for `BD` SRCs, or in the standalone `ComponentID` 24a96a7948SMatt Spinlerfield. 25a96a7948SMatt Spinler 26a96a7948SMatt SpinlerComponent IDs will be unique on a per-repository basis for errors unique to 27a96a7948SMatt Spinlerthat repository. When the same errors are created by multiple repositories, 28a96a7948SMatt Spinlerthose errors will all share the same component ID. The master list of 29*8e823e12SMatt Spinlercomponent IDs is [here](O_component_ids.json). That file can used by PEL 30*8e823e12SMatt Spinlerparsers to display a name for the component ID. The 'O' in the name is the 31*8e823e12SMatt Spinlercreator ID value for BMC created PELs. 32a96a7948SMatt Spinler 33a96a7948SMatt Spinler## Message Registry Fields 34a96a7948SMatt SpinlerThe message registry schema is [here](schema/schema.json), and the message 35a96a7948SMatt Spinlerregistry itself is [here](message_registry.json). The schema will be validated 36a96a7948SMatt Spinlereither during a bitbake build or during CI, or eventually possibly both. 37a96a7948SMatt Spinler 38a96a7948SMatt SpinlerIn the message registry, there are fields for specifying: 39a96a7948SMatt Spinler 40a96a7948SMatt Spinler### Name 41a96a7948SMatt SpinlerThis is the key into the message registry, and is the Message property 42a96a7948SMatt Spinlerof the OpenBMC event log that the PEL is being created from. 43a96a7948SMatt Spinler 44a96a7948SMatt Spinler``` 45a96a7948SMatt Spinler"Name": "xyz.openbmc_project.Power.Fault" 46a96a7948SMatt Spinler``` 47a96a7948SMatt Spinler 48a96a7948SMatt Spinler### Subsystem 49a96a7948SMatt SpinlerThis field is part of the PEL User Header section, and is used to specify 50a96a7948SMatt Spinlerthe subsystem pertaining to the error. It is an enumeration that maps to the 5123970b0dSMatt Spinleractual PEL value. If the subsystem isn't known ahead of time, it can be passed 5223970b0dSMatt Spinlerin at the time of PEL creation using the 'PEL\_SUBSYSTEM' AdditionalData field. 5323970b0dSMatt SpinlerIn this case, 'Subsystem' isn't required, though 'PossibleSubsystems' is. 54a96a7948SMatt Spinler 55a96a7948SMatt Spinler``` 56a96a7948SMatt Spinler"Subsystem": "power_supply" 57a96a7948SMatt Spinler``` 58a96a7948SMatt Spinler 5923970b0dSMatt Spinler### PossibleSubsystems 6023970b0dSMatt SpinlerThis field is used by scripts that build documentation from the message 6123970b0dSMatt Spinlerregistry to know which subsystems are possible for an error when it can't be 6223970b0dSMatt Spinlerhardcoded using the 'Subsystem' field. It is mutually exclusive with the 6323970b0dSMatt Spinler'Subsystem' field. 6423970b0dSMatt Spinler 6523970b0dSMatt Spinler``` 6623970b0dSMatt Spinler"PossibleSubsystems": ["memory", "processor"] 6723970b0dSMatt Spinler``` 6823970b0dSMatt Spinler 69a96a7948SMatt Spinler### Severity 70a96a7948SMatt SpinlerThis field is part of the PEL User Header section, and is used to specify 71a96a7948SMatt Spinlerthe PEL severity. It is an optional field, if it isn't specified, then the 72a96a7948SMatt Spinlerseverity of the OpenBMC event log will be converted into a PEL severity value. 73a96a7948SMatt Spinler 7417952d94SMatt SpinlerIt can either be the plain severity value, or an array of severity values that 7517952d94SMatt Spinlerare based on system type, where an entry without a system type will match 7617952d94SMatt Spinleranything unless another entry has a matching system type. 7717952d94SMatt Spinler 78a96a7948SMatt Spinler``` 79a96a7948SMatt Spinler"Severity": "unrecoverable" 80a96a7948SMatt Spinler``` 81a96a7948SMatt Spinler 8217952d94SMatt Spinler``` 8317952d94SMatt SpinlerSeverity": 8417952d94SMatt Spinler[ 8517952d94SMatt Spinler { 8617952d94SMatt Spinler "System": "system1", 8717952d94SMatt Spinler "SevValue": "recovered" 8817952d94SMatt Spinler }, 8917952d94SMatt Spinler { 9017952d94SMatt Spinler "Severity": "unrecoverable" 9117952d94SMatt Spinler } 9217952d94SMatt Spinler] 9317952d94SMatt Spinler``` 9417952d94SMatt SpinlerThe above example shows that on system 'system1' the severity will be 9517952d94SMatt Spinlerrecovered, and on every other system it will be unrecoverable. 9617952d94SMatt Spinler 97a96a7948SMatt Spinler### Mfg Severity 98a96a7948SMatt SpinlerThis is an optional field and is used to override the Severity field when a 9917952d94SMatt Spinlerspecific manufacturing isolation mode is enabled. It has the same format as 10017952d94SMatt SpinlerSeverity. 101a96a7948SMatt Spinler 102a96a7948SMatt Spinler``` 103a96a7948SMatt Spinler"MfgSeverity": "unrecoverable" 104a96a7948SMatt Spinler``` 105a96a7948SMatt Spinler 106a96a7948SMatt Spinler### Event Scope 107a96a7948SMatt SpinlerThis field is part of the PEL User Header section, and is used to specify 108a96a7948SMatt Spinlerthe event scope, as defined by the PEL spec. It is optional and defaults to 109a96a7948SMatt Spinler"entire platform". 110a96a7948SMatt Spinler 111a96a7948SMatt Spinler``` 112a96a7948SMatt Spinler"EventScope": "entire_platform" 113a96a7948SMatt Spinler``` 114a96a7948SMatt Spinler 115a96a7948SMatt Spinler### Event Type 116a96a7948SMatt SpinlerThis field is part of the PEL User Header section, and is used to specify 117a96a7948SMatt Spinlerthe event type, as defined by the PEL spec. It is optional and defaults to 1183fb208e3SMatt Spinler"not applicable" for non-informational logs, and "misc_information_only" for 1193fb208e3SMatt Spinlerinformational ones. 120a96a7948SMatt Spinler 121a96a7948SMatt Spinler``` 122a96a7948SMatt Spinler"EventType": "na" 123a96a7948SMatt Spinler``` 124a96a7948SMatt Spinler 125a96a7948SMatt Spinler### Action Flags 126a96a7948SMatt SpinlerThis field is part of the PEL User Header section, and is used to specify the 127a96a7948SMatt SpinlerPEL action flags, as defined by the PEL spec. It is an array of enumerations. 128a96a7948SMatt Spinler 1293fb208e3SMatt SpinlerThe action flags can usually be deduced from other PEL fields, such as the 1303fb208e3SMatt Spinlerseverity or if there are any callouts. As such, this is an optional field and 1313fb208e3SMatt Spinlerif not supplied the code will fill them in based on those fields. 1323fb208e3SMatt Spinler 1333fb208e3SMatt SpinlerIn fact, even if supplied here, the code may still modify them to ensure they 13478feef04SMatt Spinlerare correct. The rules used for this are 13578feef04SMatt Spinler[here](../README.md#action-flags-and-event-type-rules). 1363fb208e3SMatt Spinler 137a96a7948SMatt Spinler``` 138a96a7948SMatt Spinler"ActionFlags": ["service_action", "report", "call_home"] 139a96a7948SMatt Spinler``` 140a96a7948SMatt Spinler 141a96a7948SMatt Spinler### Mfg Action Flags 142a96a7948SMatt SpinlerThis is an optional field and is used to override the Action Flags field when a 143a96a7948SMatt Spinlerspecific manufacturing isolation mode is enabled. 144a96a7948SMatt Spinler 145a96a7948SMatt Spinler``` 146a96a7948SMatt Spinler"MfgActionFlags": ["service_action", "report", "call_home"] 147a96a7948SMatt Spinler``` 148a96a7948SMatt Spinler 149a96a7948SMatt Spinler### Component ID 150a96a7948SMatt SpinlerThis is the component ID of the PEL creator, in the form 0xYY00. For `BD` 151a96a7948SMatt SpinlerSRCs, this is an optional field and if not present the value will be taken from 152a96a7948SMatt Spinlerthe upper byte of the reason code. If present for `BD` SRCs, then this byte 153a96a7948SMatt Spinlermust match the upper byte of the reason code. 154a96a7948SMatt Spinler 155a96a7948SMatt Spinler``` 156a96a7948SMatt Spinler"ComponentID": "0x5500" 157a96a7948SMatt Spinler``` 158a96a7948SMatt Spinler 159a96a7948SMatt Spinler### SRC Type 160a96a7948SMatt SpinlerThis specifies the type of SRC to create. The type is the first 2 characters 161a96a7948SMatt Spinlerof the 8 character ASCII string field of the PEL. The allowed types are `BD`, 162a96a7948SMatt Spinlerfor the standard OpenBMC error, and `11`, for power related errors. It is 163a96a7948SMatt Spinleroptional and if not specified will default to `BD`. 164a96a7948SMatt Spinler 165a96a7948SMatt SpinlerNote: The ASCII string for BD SRCs looks like: `BDBBCCCC`, where: 166a96a7948SMatt Spinler* BD = SRC type 167a96a7948SMatt Spinler* BB = PEL subsystem as mentioned above 168a96a7948SMatt Spinler* CCCC SRC reason code 169a96a7948SMatt Spinler 170a96a7948SMatt SpinlerFor `11` SRCs, it looks like: `1100RRRR`, where RRRR is the SRC reason code. 171a96a7948SMatt Spinler 172a96a7948SMatt Spinler``` 173a96a7948SMatt Spinler"Type": "11" 174a96a7948SMatt Spinler``` 175a96a7948SMatt Spinler 176a96a7948SMatt Spinler### SRC Reason Code 177a96a7948SMatt SpinlerThis is the 4 character value in the latter half of the SRC ASCII string. It 178a96a7948SMatt Spinleris treated as a 2 byte hex value, such as 0x5678. For `BD` SRCs, the first 179a96a7948SMatt Spinlerbyte is the same as the first byte of the component ID field in the Private 180a96a7948SMatt SpinlerHeader section that represents the creator's component ID. 181a96a7948SMatt Spinler 182a96a7948SMatt Spinler``` 183a96a7948SMatt Spinler"ReasonCode": "0x5544" 184a96a7948SMatt Spinler``` 185a96a7948SMatt Spinler 186a96a7948SMatt Spinler### SRC Symptom ID Fields 187a96a7948SMatt SpinlerThe symptom ID is in the Extended User Header section and is defined in the PEL 188a96a7948SMatt Spinlerspec as the unique event signature string. It always starts with the ASCII 189a96a7948SMatt Spinlerstring. This field in the message registry allows one to choose which SRC words 190a96a7948SMatt Spinlerto use in addition to the ASCII string field to form the symptom ID. All words 191a96a7948SMatt Spinlerare separated by underscores. If not specified, the code will choose a default 192a96a7948SMatt Spinlerformat, which may depend on the SRC type. 193a96a7948SMatt Spinler 194a96a7948SMatt SpinlerFor example: ["SRCWord3", "SRCWord9"] would be: 195a96a7948SMatt Spinler`<ASCII_STRING>_<SRCWord3>_<SRCWord9>`, which could look like: 196a96a7948SMatt Spinler`B181320_00000050_49000000`. 197a96a7948SMatt Spinler 198a96a7948SMatt Spinler``` 199a96a7948SMatt Spinler"SymptomIDFields": ["SRCWord3", "SRCWord9"] 200a96a7948SMatt Spinler``` 201a96a7948SMatt Spinler 202a96a7948SMatt Spinler### SRC words 6 to 9 203a96a7948SMatt SpinlerIn a PEL, these SRC words are free format and can be filled in by the user as 204a96a7948SMatt Spinlerdesired. On the BMC, the source of these words is the AdditionalData fields in 205a96a7948SMatt Spinlerthe event log. The message registry provides a way for the log creator to 206a96a7948SMatt Spinlerspecify which AdditionalData property field to get the data from, and also to 207a96a7948SMatt Spinlerdefine what the SRC word means for use by parsers. If not specified, these SRC 208a96a7948SMatt Spinlerwords will be set to zero in the PEL. 209a96a7948SMatt Spinler 210a96a7948SMatt Spinler``` 211a96a7948SMatt Spinler"Words6to9": 212a96a7948SMatt Spinler{ 213a96a7948SMatt Spinler "6": 214a96a7948SMatt Spinler { 215a96a7948SMatt Spinler "description": "Failing unit number", 216a96a7948SMatt Spinler "AdditionalDataPropSource": "PS_NUM" 217a96a7948SMatt Spinler } 218a96a7948SMatt Spinler} 219a96a7948SMatt Spinler``` 220a96a7948SMatt Spinler 221a96a7948SMatt Spinler### Documentation Fields 222a96a7948SMatt SpinlerThe documentation fields are used by PEL parsers to display a human readable 223a96a7948SMatt Spinlerdescription of a PEL. They are also the source for the Redfish event log 224a96a7948SMatt Spinlermessages. 225a96a7948SMatt Spinler 226a96a7948SMatt Spinler#### Message 227a96a7948SMatt SpinlerThis field is used by the BMC's PEL parser as the description of the error log. 228a96a7948SMatt SpinlerIt will also be used in Redfish event logs. It supports argument substitution 229a96a7948SMatt Spinlerusing the %1, %2, etc placeholders allowing any of the SRC user data words 6 - 230a96a7948SMatt Spinler9 to be displayed as part of the message. If the placeholders are used, then 231a96a7948SMatt Spinlerthe `MessageArgSources` property must be present to say which SRC words to use 232a96a7948SMatt Spinlerfor each placeholder. 233a96a7948SMatt Spinler 234a96a7948SMatt Spinler``` 235a96a7948SMatt Spinler"Message": "Processor %1 had %2 errors" 236a96a7948SMatt Spinler``` 237a96a7948SMatt Spinler 238a96a7948SMatt Spinler#### MessageArgSources 239a96a7948SMatt SpinlerThis optional field is required when the Message field contains the %X 240a96a7948SMatt Spinlerplaceholder arguments. It is an array that says which SRC words to get the 241a96a7948SMatt Spinlerplaceholders from. In the example below, SRC word 6 would be used for %1, and 242a96a7948SMatt SpinlerSRC word 7 for %2. 243a96a7948SMatt Spinler 244a96a7948SMatt Spinler``` 245a96a7948SMatt Spinler"MessageArgSources": 246a96a7948SMatt Spinler[ 247a96a7948SMatt Spinler "SRCWord6", "SRCWord7" 248a96a7948SMatt Spinler] 249a96a7948SMatt Spinler``` 250a96a7948SMatt Spinler 251a96a7948SMatt Spinler#### Description 252a96a7948SMatt SpinlerA short description of the error. This is required by the Redfish schema to generate a Redfish message entry, but is not used in Redfish or PEL output. 253a96a7948SMatt Spinler 254a96a7948SMatt Spinler``` 255a96a7948SMatt Spinler"Description": "A power fault" 256a96a7948SMatt Spinler``` 257a96a7948SMatt Spinler 258a96a7948SMatt Spinler#### Notes 259a96a7948SMatt SpinlerThis is an optional free format text field for keeping any notes for the 260a96a7948SMatt Spinlerregistry entry, as comments are not allowed in JSON. It is an array of strings 261a96a7948SMatt Spinlerfor easier readability of long fields. 262a96a7948SMatt Spinler 263a96a7948SMatt Spinler``` 264a96a7948SMatt Spinler"Notes": [ 265a96a7948SMatt Spinler "This entry is for every type of power fault.", 266a96a7948SMatt Spinler "There is probably a hardware failure." 267a96a7948SMatt Spinler] 268a96a7948SMatt Spinler``` 26970311203SMatt Spinler 27070311203SMatt Spinler### Callout Fields 27170311203SMatt SpinlerThe callout fields allow one to specify the PEL callouts (either a hardware 27270311203SMatt SpinlerFRU, a symbolic FRU, or a maintenance procedure) in the entry for a particular 27370311203SMatt Spinlererror. These callouts can vary based on system type, as well as a user 27470311203SMatt Spinlerspecified AdditionalData property field. Callouts will be added to the PEL in 27570311203SMatt Spinlerthe order they are listed in the JSON. If a callout is passed into the error, 27670311203SMatt Spinlersay with CALLOUT_INVENTORY_PATH, then that callout will be added to the PEL 27770311203SMatt Spinlerbefore the callouts in the registry. 27870311203SMatt Spinler 27970311203SMatt SpinlerThere is room for up to 10 callouts in a PEL. 28070311203SMatt Spinler 28170311203SMatt Spinler#### Callouts example based on the system type 28270311203SMatt Spinler 28370311203SMatt Spinler``` 28470311203SMatt Spinler"Callouts": 28570311203SMatt Spinler[ 28670311203SMatt Spinler { 28770311203SMatt Spinler "System": "system1", 28870311203SMatt Spinler "CalloutList": 28970311203SMatt Spinler [ 29070311203SMatt Spinler { 29170311203SMatt Spinler "Priority": "high", 29270311203SMatt Spinler "LocCode": "P1-C1" 29370311203SMatt Spinler }, 29470311203SMatt Spinler { 29570311203SMatt Spinler "Priority": "low", 29670311203SMatt Spinler "LocCode": "P1" 29770311203SMatt Spinler } 29870311203SMatt Spinler ] 29970311203SMatt Spinler }, 30070311203SMatt Spinler { 30170311203SMatt Spinler "CalloutList": 30270311203SMatt Spinler [ 30370311203SMatt Spinler { 30470311203SMatt Spinler "Priority": "high", 30570311203SMatt Spinler "Procedure": "SVCDOCS" 30670311203SMatt Spinler } 30770311203SMatt Spinler ] 30870311203SMatt Spinler 30970311203SMatt Spinler } 31070311203SMatt Spinler] 31170311203SMatt Spinler 31270311203SMatt Spinler``` 31370311203SMatt Spinler 31470311203SMatt SpinlerThe above example shows that on system 'system1', the FRU at location P1-C1 31570311203SMatt Spinlerwill be called out with a priority of high, and the FRU at P1 with a priority 31670311203SMatt Spinlerof low. On every other system, the maintenance procedure SVCDOCS is called 31770311203SMatt Spinlerout. 31870311203SMatt Spinler 31970311203SMatt Spinler#### Callouts example based on an AdditionalData field 32070311203SMatt Spinler 32170311203SMatt Spinler``` 32270311203SMatt Spinler"CalloutsUsingAD": 32370311203SMatt Spinler{ 32470311203SMatt Spinler "ADName": "PROC_NUM", 32570311203SMatt Spinler "CalloutsWithTheirADValues": 32670311203SMatt Spinler [ 32770311203SMatt Spinler { 32870311203SMatt Spinler "ADValue": "0", 32970311203SMatt Spinler "Callouts": 33070311203SMatt Spinler [ 33170311203SMatt Spinler { 33270311203SMatt Spinler "CalloutList": 33370311203SMatt Spinler [ 33470311203SMatt Spinler { 33570311203SMatt Spinler "Priority": "high", 33670311203SMatt Spinler "LocCode": "P1-C5" 33770311203SMatt Spinler } 33870311203SMatt Spinler ] 33970311203SMatt Spinler } 34070311203SMatt Spinler ] 34170311203SMatt Spinler }, 34270311203SMatt Spinler { 34370311203SMatt Spinler "ADValue": "1", 34470311203SMatt Spinler "Callouts": 34570311203SMatt Spinler [ 34670311203SMatt Spinler { 34770311203SMatt Spinler "CalloutList": 34870311203SMatt Spinler [ 34970311203SMatt Spinler { 35070311203SMatt Spinler "Priority": "high", 35170311203SMatt Spinler "LocCode": "P1-C6" 35270311203SMatt Spinler } 35370311203SMatt Spinler ] 35470311203SMatt Spinler } 35570311203SMatt Spinler ] 35670311203SMatt Spinler } 35770311203SMatt Spinler ] 35870311203SMatt Spinler} 35970311203SMatt Spinler 36070311203SMatt Spinler``` 36170311203SMatt Spinler 36270311203SMatt SpinlerThis example shows that the callouts were selected based on the 'PROC_NUM' 36370311203SMatt SpinlerAdditionalData field. When PROC_NUM was 0, the FRU at P1-C5 was called out. 36470311203SMatt SpinlerWhen it was 1, P1-C6 was called out. Note that the same 'Callouts' array is 36570311203SMatt Spinlerused as in the previous example, so these callouts can also depend on the 36670311203SMatt Spinlersystem type. 36770311203SMatt Spinler 36870311203SMatt Spinler#### CalloutType 36970311203SMatt SpinlerThis field can be used to modify the failing component type field in the 37070311203SMatt Spinlercallout when the default doesn\'t fit: 37170311203SMatt Spinler 37270311203SMatt Spinler``` 37370311203SMatt Spinler{ 37470311203SMatt Spinler 37570311203SMatt Spinler "Priority": "high", 37670311203SMatt Spinler "Procedure": "FIXIT22" 37770311203SMatt Spinler "CalloutType": "config_procedure" 37870311203SMatt Spinler} 37970311203SMatt Spinler``` 38070311203SMatt Spinler 38170311203SMatt SpinlerThe defaults are: 38270311203SMatt Spinler- Normal hardware FRU: hardware_fru 38370311203SMatt Spinler- Symbolic FRU: symbolic_fru 38470311203SMatt Spinler- Procedure: maint_procedure 385d03d3d91SMatt Spinler 386f00f9d0fSMatt Spinler#### Symbolic FRU callouts with dynamic trusted location codes 387f00f9d0fSMatt Spinler 388f00f9d0fSMatt SpinlerA special case is when one wants to use a symbolic FRU callout with a trusted 389f00f9d0fSMatt Spinlerlocation code, but the location code to use isn\'t known until runtime. This 390f00f9d0fSMatt Spinlermeans it can\'t be specified using the 'LocCode' key in the registry. 391f00f9d0fSMatt Spinler 392f00f9d0fSMatt SpinlerIn this case, one should use the 'SymbolicFRUTrusted' key along with the 393f00f9d0fSMatt Spinler'UseInventoryLocCode' key, and then pass in the inventory item that has the 394f00f9d0fSMatt Spinlerdesired location code using the 'CALLOUT_INVENTORY_PATH' entry inside of the 395f00f9d0fSMatt SpinlerAdditionalData property. The code will then look up the location code for that 396f00f9d0fSMatt Spinlerpassed in inventory FRU and place it in the symbolic FRU callout. The normal 397f00f9d0fSMatt SpinlerFRU callout with that inventory item will not be created. The symbolic FRU 398f00f9d0fSMatt Spinlermust be the first callout in the registry for this to work. 399f00f9d0fSMatt Spinler 400f00f9d0fSMatt Spinler``` 401f00f9d0fSMatt Spinler{ 402f00f9d0fSMatt Spinler 403f00f9d0fSMatt Spinler "Priority": "high", 404f00f9d0fSMatt Spinler "SymbolicFRUTrusted": "AIR_MOVR", 405f00f9d0fSMatt Spinler "UseInventoryLocCode": true 406f00f9d0fSMatt Spinler} 407f00f9d0fSMatt Spinler``` 408f00f9d0fSMatt Spinler 409d03d3d91SMatt Spinler## Modifying and Testing 410d03d3d91SMatt Spinler 411d03d3d91SMatt SpinlerThe general process for adding new entries to the message registry is: 412d03d3d91SMatt Spinler 413d03d3d91SMatt Spinler1. Update message_registry.json to add the new errors. 414d03d3d91SMatt Spinler2. If a new component ID is used (usually the first byte of the SRC reason 415*8e823e12SMatt Spinler code), document it in O_component_ids.json. 416d03d3d91SMatt Spinler3. Validate the file. It must be valid JSON and obey the schema. The 417d03d3d91SMatt Spinler `process_registry.py` script in `extensions/openpower-pels/registry/tools` 418d03d3d91SMatt Spinler will validate both, though it requires the python-jsonschema package to do 419d03d3d91SMatt Spinler the schema validation. This script is also run to validate the message 420d03d3d91SMatt Spinler registry as part of CI testing. 421d03d3d91SMatt Spinler 422d03d3d91SMatt Spinler``` 423d03d3d91SMatt Spinler ./tools/process_registry.py -v -s schema/schema.json -r message_registry.json 424d03d3d91SMatt Spinler``` 425d03d3d91SMatt Spinler 426d03d3d91SMatt Spinler4. One can test what PELs are generated from these new entries without writing 427d03d3d91SMatt Spinler any code to create the corresponding event logs: 428d03d3d91SMatt Spinler 1. Copy the modified message_registry.json into `/etc/phosphor-logging/` on 429d03d3d91SMatt Spinler the BMC. That directory may need to be created. 430d03d3d91SMatt Spinler 2. Use busctl to call the Create method to create an event log 431d03d3d91SMatt Spinler corresponding to the message registry entry under test. 432d03d3d91SMatt Spinler 433d03d3d91SMatt Spinler``` 434d03d3d91SMatt Spinlerbusctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging \ 435d03d3d91SMatt Spinlerxyz.openbmc_project.Logging.Create Create ssa{ss} \ 436d03d3d91SMatt Spinlerxyz.openbmc_project.Common.Error.Timeout \ 437d03d3d91SMatt Spinlerxyz.openbmc_project.Logging.Entry.Level.Error 1 "TIMEOUT_IN_MSEC" "5" 438d03d3d91SMatt Spinler``` 439d03d3d91SMatt Spinler 440d03d3d91SMatt Spinler 3. Check the PEL that was created using peltool. 441d03d3d91SMatt Spinler 4. When finished, delete the file from `/etc/phosphor-logging/`. 442