summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* PEL: Put back in the default error log capsMatt Spinler2019-12-101-2/+0
| | | | | | | | | | Since there is no code in place yet to purge old logs after some amount of total space is consumed, it will be safest to put back in the default cap of 200. If more than 200 is needed in the short term, we can use the currently available configure option to increase the cap. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ide1af5432271817f30bfaf0b065c35906aaa05cf
* PEL: Add ExtendedUserHeader section classMatt Spinler2019-12-099-21/+813
| | | | | | | | | | | | | | This is a required PEL section. The section contains: * The machine type/model/SN * The server firmware version * The BMC firmware version * The 'Event Common Reference Time' (not used yet) * The symptom ID (a unique event signature) Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I223041f85965195fccf69542dbe86ce856073b36
* PEL: Add APIs to read the FW versionsMatt Spinler2019-12-093-0/+71
| | | | | | | | | | | | | Add methods to the DataInterface class to read the BMC and server firmware versions. The server firmware version represents the version of all firmware images that are in the flash image, not just the BMC. There is nowhere to get that version yet, so this commit just has a placeholder. These will be used by the ExtendedUserHeader section. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I47389714c987337cb96c72b6bf2b270c78003357
* PEL: Add constructors to BCDTimeMatt Spinler2019-12-091-0/+15
| | | | | | | | Add constructors to set all members to zero initially or pass them all in. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ic28cee19014c739f331fd0498229dfb503b0df88
* PEL: Add Repo API to update transmission statesMatt Spinler2019-12-093-0/+197
| | | | | | | | | Provided APIs for the Repository class to update the host and HMC transmission states on a PEL it contains. It saves the updated PEL data in the filesystem. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iadbc589ee85d4408339e1171c36b8324910f4f0a
* PEL: Reset host transmission state on restartMatt Spinler2019-12-091-0/+17
| | | | | | | | | | When the Repository class starts up, if it finds any existing PELs with a host transmission state of 'sent', set it back to 'new' so that it will get sent again, as the BMC restarted or the daemon crashed before the host could ack it. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ieeca2c1a92eabc0a22051be6b87cecbe0b1d519d
* PEL: Set tran states when PELs are added to repoMatt Spinler2019-12-091-0/+3
| | | | | | | | When a PEL is added to the repository, ensure that the host and HMC transmission states are set to 'new'. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I9edb9d388a61742c28c1df1552b9678d10b9fcc4
* PEL: Save tran states in the repo attributesMatt Spinler2019-12-092-5/+12
| | | | | | | | | Save the host and HMC (Hardware Management Console) transmission states in the PEL attributes map so that external callers can get to them without having to unflatten a PEL from the filesystem. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: If8b396d3c342af2c7a3c34f4f1bb0a7da075e47c
* PEL: Repository: Add write() functionMatt Spinler2019-12-092-12/+26
| | | | | | | | Pull the code that writes a PEL object to a file into a separate function so that it can be called in multiple places. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ic5701fdfb03cca915520222bbbd8bb92a9c47c49
* PEL: Add enums for transmission statesMatt Spinler2019-12-092-0/+51
| | | | | | | | | | So far, the states are new, sent, and acked. Also added PEL object access to getting and setting these on the User Header section object. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I0dfb2d1a39fe69b2a47bf7d461f08e92039a3e03
* PEL: Store transmission states in UserHeaderMatt Spinler2019-12-092-6/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use a reserved word in the UserHeader section to store some PEL states: * Host Transmission State: - States involving the progression of a PEL being sent to the operating system. * HMC Transmission State: - States involving the progression of a PEL being sent to the hardware management console, if there is one attached. - Usually, an HMC refers to a specific set of hardware and software sold by IBM that connects to OpenPower systems which has specific software to deal with receiving PELs. It is possible that there is an implementation that won't need to send PELs to either of these entities, in which case these states will just be unused and left at zero. This is the same location that other service processor implementations have stored transmission states. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I6a2bfee15336dbd564aeaded88effa55ede0d6c4
* PEL: Remove userHeader::getValueAatir2019-12-092-29/+7
| | | | | | | | | getValue function is now being used to get field values for all the different sections. Therefore, it makes sense to remove the older implementation of this function from userHeader class. Change-Id: I041b8c5e0548e9f7ee354f21d2e248ed946df5ec Signed-off-by: Aatir <aatrapps@gmail.com>
* PEL: Print list of PELsAatir2019-12-094-10/+215
| | | | | | | | | | | | | | | | | | | | | | PelTool commands for printing a list of PELs. PEL list sample: { "0x50000004": { "SRC": "BD8D1001", "PLID": "0x50000004", "CreatorID": "BMC", "Subsystem": "bmc_firmware", "Commit Time": "10/24/2019 15:50:08", "Sev": "unrecoverable", "CompID": "0x1000" } } Change-Id: Ifd864a6561c09de098689195edcf107b3fe550e3 Signed-off-by: Aatir <aatrapps@gmail.com>
* PEL: private header in JSONAatir2019-12-094-1/+68
| | | | | | | | | | | | | | | | | | | | | | The PELTool application is able to convert sections to JSON. This commit takes care of converting the private header section to JSON. private header section in JSON sample: "Private Header":[ {"Section Version": "1"}, {"Sub-section type": "0"}, {"Log Committed by": "0x1000"}, {"Entry Creation": "10/24/2019 15:50:08"}, {"Entry Commit": "10/24/2019 15:50:08"}, {"Creator ID": "BMC"}, {"Creator Implementation": ""}, {"Platform Log ID": "0x50000004"}, {"Log Entry ID": "0x50000004"} ] Signed-off-by: Aatir <aatrapps@gmail.com> Change-Id: I8b0d7dc7b70cd2a03f67f7c9a48755803634005d
* Resource leakage on opened file.Troy Lee2019-12-091-2/+2
| | | | | | | | | | The opened file descriptor and inotify won't be released, if the synced file generate in time. This happens occasionally, but the leakage will lead to journal log failure and will not able to use inotify after a long period run. Change-Id: I09cca72c88091ebcf1bb7ddb7df04ee1d2b2d7d6 Signed-off-by: Troy Lee <troy.lee@vertiv.com>
* PEL: Keep PEL attributes in Repository mapMatt Spinler2019-12-033-24/+113
| | | | | | | | | | | | Instead of the Repository class only storing the path to a PEL file for a corresponding PEL ID, change it to a structure that includes the PEL's size and action flags as well as the path. This way, a PEL won't have to be read from the filesystem to find these values every time someone needs them. These new fields will be needed by the code that sends PELs to the host. Change-Id: I7650b6cbad12cc120426854767403f5cba2ee572
* PEL: Add subscriptions for new and deleted PELsMatt Spinler2019-12-033-0/+167
| | | | | | | | | | | Add functionality to the Repository class to be able to call functions provided by others when PELs are added or removed from the repository. This will be used in the future for things like knowing when a new PEL is added so it can be sent to the host. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2effc9d5fa9a38890311a88bcfb07eed1292a453
* PEL: Keep track of if host is runningMatt Spinler2019-12-032-0/+198
| | | | | | | | | | | | | | | | | Use the DataInterface class to keep track of if the host is up and running by keeping track of the OperatingSystemState property on the xyz.openbmc_project.State.OperatingSystem.Status interface on the /xyz/openbmc_project/state/host0 object path. Added a isHostUp() function as well as a subscribeToHostStateChange() function to allow a user to pass in a function to be run when the host changes state. Property values of 'BootComplete' or 'Standby' mean that the host is running, anything else is considered not running. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I096b2bc4014dff9be85a4bbd74ef27193fd338fb
* PEL: Move some functionality into DataIfaceBaseMatt Spinler2019-11-251-36/+23
| | | | | | | | | | | Refactor DataInterface to hold the data members in the base class, and use the derived class for calculating them. This will make it consistent with functionality that will be added in the future. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: If6f2ba1890df296cb612c8a64dd60db72c70c46d
* PEL: Create registry directory for testMatt Spinler2019-11-191-1/+4
| | | | | | | | | The PEL manager test wasn't creating the message registry directory before writing into it, and seemed to have just been lucking out that a previous test had created it. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I122242d65db02d8b80864c938cc28be434774304
* PEL: Support UserData padding in the testcasesMatt Spinler2019-11-192-4/+11
| | | | | | | | Some testcase updates were missed when the fix was made to pad the UserData section to 4 byte boundaries as required by the spec. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I8129a70cfd740155ca05089563dfc5d7e63bdc81
* PEL: Hex dump bug fixAatir2019-11-181-0/+3
| | | | | | | | Hex dump function had a bug where the last line was getting printed incorrectly. Signed-off-by: Aatir <aatrapps@gmail.com> Change-Id: I6acab7b57baf376b66b461c31f91a07377a7354a
* PEL: Pad UserData section to 4 byte boundaryMatt Spinler2019-11-181-0/+6
| | | | | | | | | The spec says that all section sizes must be a multiple of 4 bytes, so pad the User Data section that contains the AdditionalData JSON out to that. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I30b46a34604ee10d67755f51fd7d9c41b2f75c9f
* PEL: Validate the message registry during CIMatt Spinler2019-11-181-0/+3
| | | | | | | | | CI will run any files called run-ci.sh it finds in a repo, so add a script of that name to run process_registry.py against the message registry to check it for errors. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I35da7c1454696b90ec88b3545992414160ae920b
* PEL: user header in JSONAatir Manzur2019-11-154-14/+96
| | | | | | | | | | | | | | | | | | | | The PELTool application is able to convert sections to JSON. This commit takes care of converting the user header section to JSON. user header section in JSON sample: "User Header":[ {"Section Version": "1"}, {"Sub-section type": "0"}, {"Log Committed by": "0x2000"}, {"Subsystem": "bmc_firmware"}, {"Event Scope": "entire_platform"}, {"Event Severity":"unrecoverable"}, {"Event Type": "na"} ] Signed-off-by: Aatir Manzur <aatrapps@gmail.com> Change-Id: I0dca1d87019b9e62d711ee6d034f2e8bc0574c2e
* PEL: Add the 'Common' errors to the registryMatt Spinler2019-11-151-0/+131
| | | | | | | | | | | | | | | Add the xyz.openbmc_project.Common.Error.* errors from xyz/openbmc_project/Common.errors.yaml file in the phosphor-dbus-interfaces repository. It is possible that errors defined in these YAML files never have event logs created out of them, but instead are intended to just be returned on failed D-Bus operations, such as a method failure. Aside from searching the whole OpenBMC code base there is no way to know, so just define PELs for all of them to be safe. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I00ce1e9423c2b260f78d2d3d0aa8a495c3b13504
* PEL: Use libpel.la for log daemon and peltoolMatt Spinler2019-11-121-45/+28
| | | | | | | | | As phosphor-log-manager and peltool share source files, create libpel.la to contain those common files that will then be included by both of them. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ie3882d1b0929bace10ae638a8762e2b804e594c7
* PEL: Registry: Make "Action Flags" optionalMatt Spinler2019-11-122-3/+10
| | | | | | | | | | | | | | | The Action Flags bits in the PEL need to be in agreement with other PEL fields, such as if the severity is informational then the 'report' flag cannot be on. In fact, for most logs all of these flags can be deduced from the other PEL fields. So, to avoid the case of the action flags in the registry not matching the other PEL fields, make them optional and the BMC code will set them appropriately. And when they are specified, the BMC code will still run through the same code to ensure everything is in agreement. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I5bea83d01846d7a2d3307666e6d0758a99229e3f
* PEL: Run a user defined function on every PELMatt Spinler2019-11-123-0/+92
| | | | | | | | | | | | | | | | | | | | | | | Add a for_each() function to the PEL repository that takes a user defined function that will be run on every PEL, unless that function says to stop early. The user defined function is a std::function<bool>(const PEL&); For example, to save up to 100 IDs in the repo into a vector: std::vector<uint32_t> ids; ForEachFunc f = [&ids](const PEL& pel) { ids.push_back(pel.id()); return ids.size() == 100 ? true : false; }; repo.for_each(f); This will be used to find which PELs still need to be sent up to the host after a reboot, among other things. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ic60525a8ab3dd593ba37e43a6cb0b3db8dda7cee
* PEL: Make PEL::flatten() constMatt Spinler2019-11-1216-26/+27
| | | | | | | | This includes making the flatten() method const in the PEL section base class and in all of its derived classes. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I6be787962c6d7dfa01bdced2f9024564e6ac1b08
* PEL: Const flatten for BCDTimeMatt Spinler2019-11-122-2/+2
| | | | | | | It doesn't modify the object, so can be const. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ib3bbe2b8467578b0cddce0284aa6ae95f1ad826a
* PEL: Const flattens for the SRC sub classesMatt Spinler2019-11-1212-12/+12
| | | | | | | | Make the flatten functions const for the various classes that represent the SRC substructures. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I08f4ae6de65e269c9f1b82315115969c8552c782
* PEL: MTMS: Support const flatteningMatt Spinler2019-11-122-6/+33
| | | | | | | | Future commits will eventually make every flatten function const, as they should be since flattening an object should not affect it. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I285963805800b29163c5a3979a33590f64c03d00
* PEL: Validate the Action Flags fieldMatt Spinler2019-11-0811-4/+311
| | | | | | | | | | | | | | | | According to the PEL spec, the Action Flags and Event Type fields in the User Header section must be in agreement with the Severity field. So, when a PEL is being created from an OpenBMC event log, check those values for correctness and fix them up if required. In addition, as those fields are optional in the message registry, this code will also just set these two fields to valid values if they were left out. The rules being followed are documented in the PEL readme. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iad88de5080ba79a9ff31f962ef99bfc11994b9ed
* PEL: Add license prologue to test source filesMatt Spinler2019-11-0627-0/+405
| | | | | Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I67c62ab5ac6e69ad0a84937834581f9a280a9167
* PEL: Add license prologue to source filesMatt Spinler2019-11-0627-0/+405
| | | | | Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I31b12f509d32b79064a8a427af35e6a310273051
* PEL: PELTool ApplicationAatir2019-11-069-1/+351
| | | | | | | | | PELTooL application would be used to interact with PELs. This commit has the first functionality, where a PEL file is passed and all PEL sections are hexdumped in a JSON object. Signed-off-by: Aatir <aatrapps@gmail.com> Change-Id: I155d75bb58cbd14a297b094314f7fd1f271f4f37
* PEL: Move severity type enums to a headerMatt Spinler2019-11-042-20/+22
| | | | | | | Move them to a header file so other files can use them in the future. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Icb604489e9629724a79d2fc8b110e461b6aa6e01
* PEL: Make action flags optional in the registryMatt Spinler2019-11-044-6/+9
| | | | | | | | A future commit will fill in the field if it isn't present. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I67371433162ce2198a362796d274695a1bd6a6dc
* PEL: Const accessors for Private/UserHeaderMatt Spinler2019-11-049-71/+97
| | | | | | | | | | | | | | | | | | | Change the combined non-const accessor/setter functions for the PrivateHeader and UserHeader fields to the standard const accessors, and have separate setters for the fields that need to be modified. In addition, make the 'get PrivateHeader' and 'get UserHeader' functions on the PEL class return a const reference. This allows const enforcement on the PEL class, for things like: void func(const PEL& pel) { auto id = pel.privateHeader().id(); } Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I840170e72b41e9e2465f716617500269244de6d9
* PEL: Document UserData sectionsMatt Spinler2019-11-041-0/+9
| | | | | | | | Add a section in the PEL README to document the UserData sections that will be created in every new PEL. Change-Id: I9ff9a69f1d22b56aa8bb9d559802d0595d787c0a Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* PEL: Save AdditionalData in a UserData sectionMatt Spinler2019-11-046-0/+142
| | | | | | | | | | | | | | | | | | | Save the contents of the AdditionalData OpenBMC event log property as JSON in a UserData PEL section. For example, if the AdditionalData property, which is an array of strings, looks like: ["KEY1=VALUE1", "KEY=VALUE2"] Then the data stored as ASCII text in the UserData section is: {"KEY1":"VALUE1","KEY2":"VALUE2"} If one of the keys is "ESEL", then that entry is removed from the UserData output as that contains a full raw PEL from the host sent down as ASCII text. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ia6ffabb39fdb4315ec2152744414e44f7d2ec4aa
* PEL: Create FailingMTMS section for new PELsMatt Spinler2019-11-045-9/+17
| | | | | | | | | When a PEL is created from an OpenBMC event log, add the FailingMTMS section to the PEL. This contains the machine type, model, and serial number fields. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I8d08e6dda00260efebd2c6ac165270d2aaf98d67
* PEL: Start creating PELs from event logsMatt Spinler2019-11-042-24/+102
| | | | | | | | | | | | Look up incoming OpenBMC event logs in the message registry and create PELs for them if a registry entry is found. What happens when an event log can't be found in the message registry, such as creating a different PEL, will be addressed in a separate commit. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I45c634830021fdf2efb54e3cbfd6d496fd3d7d01
* PEL: Create SRC section from message registryMatt Spinler2019-11-047-27/+320
| | | | | | | | | | | | | | | | | | | | This adds the ability to create an SRC PEL section based on the message registry entry for an OpenBMC event log. The event log's AdditionalData property is used as a source for the user defined data words of the SRC, while the other fields in the SRC's data words are filled in either from the message registry fields or from current system state or configuration. The ASCII string field of the SRC is filled in based on the message registry entry. This commit doesn't fill in every system status field, as many aren't even available anywhere yet. Also, this commit doesn't support adding callouts to an SRC, that will also be handled in the future. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I67fe44e07e4eda6bdeedb4af2eacfc197deb6eb3
* PEL: Check duplicate reason codes in registryMatt Spinler2019-10-251-0/+19
| | | | | | | | | Reason codes must be unique for every error until there is a specific reason for them not to be, so check for that while validating the message registry JSON file. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I74e0e24e1f129ebf94d25aaf5200b30b256b1307
* PEL: Script to validate message registry JSONMatt Spinler2019-10-251-0/+148
| | | | | | | | This script will check the JSON against the schema, as well as do a few other checks that can't be encoded into a schema. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I97c0fc0f69baac3c076b557b67e47ce8abfccf36
* PEL: Add message registry READMEMatt Spinler2019-10-253-0/+244
| | | | | | | | | | | This README describes the message registry in an easier to read way than what is buried in the JSON schema. The commit also provides a file to document which component IDs are used by which repositories/applications. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ibf1109e0a1fb6fff872cfa91d79c007ecf5527b0
* PEL: Add message registry JSON schemaMatt Spinler2019-10-252-0/+394
| | | | | | | | | | | | | | | | | | | | | | The message registry is JSON data that will aid in converting OpenBMC event logs into IBM's Platform Event Log (PEL) format. PELs have more fields than event logs, many with specific IBM defined values, that need to be able to be looked up for an OpenBMC event log so the PEL can be filled in. In addition to aiding in creating PELs, it also contains information to aid in parsing PELs. This schema defines how that JSON will look, and this commit also contains an example registry file. A script will be added in the future to validate the registry JSON against the schema during a bitbake build. Until there is a need, the message registry will be contained in a single JSON file. If there is a need, it can be split up along some predetermined rules in the future. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I98620b263bd1faff27e36da7a0c101a982b58057
* PEL: Install an empty PEL message registryMatt Spinler2019-10-252-0/+9
| | | | | | | | | This will eventually contain the information to create PELs out of OpenBMC event logs. It is installed into /usr/share/phosphor-logging/pels. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iaf67881890a47f605af3ae69b54f186b63915ca6
OpenPOWER on IntegriCloud