summaryrefslogtreecommitdiffstats
path: root/log_manager.hpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement Logging.Create interfaceMatt Spinler2019-08-051-9/+44
| | | | | | | | | | | | | | | | | | | | This adds the xyz.openbmc_project.Logging.Create interface on the /xyz/openbmc_project/logging path. The interface provides a single method, Create, that allows one to create an event log. This is an alternative to using the report/commit functions provided by the phosphor-logging/elog.hpp header file. Unlike those report/commit interfaces, this does not require that the entries in the AdditionalData event log property be defined ahead of time, as the whole AdditionalData contents are just passed in instead of read out of the journal. This means that the error does not need to have been defined in the error and metadata YAML files for an event log to be successfully created. The discussion on if that is still desired anyway is outside the scope of this commit. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Icf3f740ab86605deeaeb955ff51aa2ef292f5af4
* Factor out log creation code common code.Matt Spinler2019-08-051-0/+10
| | | | | | | | | In preparation for adding another function to create a log entry, factor out some common code into a new function that will be able to be called in both spots. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I8881f4ec0d36a2b2e2b1897b63d524022a328286
* Use sdeventplusMatt Spinler2019-07-161-0/+5
| | | | | | | | Start using the sdeventplus event mechanisms so that future code can take advantage of it for things like timers and other events. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I6ffe80266257bfd3512a5b848c47f5ccfb5206e8
* OpenPower PEL Extension support frameworkMatt Spinler2019-07-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | The goal of extensions is to extend phosphor-logging's `xyz.openbmc_project.Logging.Entry` log support to allow other log formats to be created without incurring extra D-Bus call overhead. The README.md change in this commit provides additional documentation on how extensions work. The summary is that they allow code that resides in this repository to provide functions that can be called at certain points (startup, log creation/deletion) such that the code can then create their own logs based on the contents of an OpenBMC log. A specific extension's code is compiled in using a --enable configure option, so platforms that did not use those log formats would incur no performance/size penalties. This commit provides the support for extensions, plus a basic OpenPower PEL (Platform Event Log) extension as the first extension. PELs are event logs used only on some OpenPower systems. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ifbb31325261c157678c29bbebc7f6d32d282582f
* style: local variable entry shadows outer symbolPatrick Venture2018-10-301-2/+2
| | | | | | | | | | | | | | | | | Many functions have a variable entry in a sub namespace to the outer symbol entry from phosphor-logging/log.hpp [phosphor-logging/log.hpp:73] -> [log_manager.hpp:104]: (style) Local variable entry shadows outer symbol [phosphor-logging/log.hpp:73] -> [log_manager.cpp:226]: (style) Local variable entry shadows outer symbol [phosphor-logging/log.hpp:73] -> [log_manager.cpp:243]: (style) Local variable entry shadows outer symbol [phosphor-logging/log.hpp:73] -> [elog_meta.hpp:37]: (style) Local variable entry shadows outer symbol Change-Id: Icf5d585ec05b0a545e515d0afb7d2267645a2f2c Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-10-261-170/+169
| | | | | Change-Id: I2c36b7886a25d0b235693b0776019d29608e1d52 Signed-off-by: Patrick Venture <venture@google.com>
* Add unit tests for the phosphor-logging serverNagaraju Goruganti2018-08-081-0/+12
| | | | | | | -Add unit tests for error wrapping Change-Id: Ib15620d84de8ab5abdc85b8f88dd7c05f83fd6f3 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Add function to read code versionMatt Spinler2018-05-011-1/+11
| | | | | | | | | | | | | | Read the BMC code version once at startup. This will be added to error logs in future commits. The code is getting the version from a file instead of from D-Bus in order to reduce dependencies. Tested: Call the function and check that it returned the correct thing. Change-Id: I9a4729e946a130ec32c375c283fd22a7658121f5 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* log_manager: Create journal sync functionAdriana Kobylak2018-04-171-0/+6
| | | | | | | | | | | | | | | The Synchronize D-Bus method was a systemd patch that calls "journalctl --sync" and will not be upstreamed to systemd. Instead duplicate the function locally in the log_manager so that the patch can be dropped, since the systemd journal service would not start on time if it was idle, leading to missing metadata. Closes openbmc/openbmc#2257 Tested: While printing continously into the journal, verify that a commit request is blocked until the journal is flushed. Change-Id: I8248c4c2e2eaeb041f7876832b395b053409acdd Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Implement ability to override default error levelDeepak Kodihalli2018-04-091-0/+25
| | | | | | | | | | | | | Errors reported by the phosphor-logging app have a default error level, and this level is specified in the error's YAML definition. Enable users of the error's report() API to specify an error level. A user may perceive a different error level for an error scenario, for eg there may be certain host errors (for which we set the level as 'Error') that may just be 'Warnings'. Change-Id: I666a0ddcb099e530c423358a3b1c65f33b0ad01e Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Roll errors after reaching Cap sizeNagaraju Goruganti2017-12-011-12/+4
| | | | | | | | | | | | | | | | Fixes openbmc/openbmc#2687 -cap on error exists to deal with small flashes, right now the cap is 100 for high severity errors and it is 10 for info(and below) severity) errors. -previous policy was to stop logging new errors once cap is reached for high severity errors. -based on feedback from field engineers, it's better to log new errors, external tools will typically periodically read and store errors, so we won't lose them.so the new policy now is to roll errors. Change-Id: I18b509d81c076fcb80667300cbfda050027bb422 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Handle more than 100 error logsNagaraju Goruganti2017-10-241-0/+4
| | | | | | | | | | | Added new Cap for info(and below) severity errors, if cap size reaches, next commited error of severity:info(and below) will replace the first entry of severity:info(and below). Resolves openbmc/openbmc#2381 Change-Id: I2e56c28a934bf3139e57b36d252bd5ad3e1dd90f Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Add implementation for delete all error log entries in one shotNagaraju Goruganti2017-09-131-0/+62
| | | | | | | Resolves openbmc/openbmc#1561. Change-Id: Iac5aaee1bdf9b87ccce9bf8801468ac5a8f9be6c Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Implement a cap on the number of committed errorsMarri Devender Rao2017-08-161-1/+12
| | | | | | | Resolves openbmc/openbmc#1617 Change-Id: I5850e5addb723e6f5102eb4677bb365285c1a633 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Persist error d-bus objectsDeepak Kodihalli2017-06-261-0/+5
| | | | | | | | | | | | Use Cereal to implement serialization and de-serialization of properties of error d-bus objects. Serialize and persist error d-bus objects as they are put on the bus. De-serialize and restore them (if persistent ones exist) when phosphor-log-manager starts up. Change-Id: I1f5df1abbe74bfdb86e3e82a78ff7115e90e2112 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* manager: define erase methodDeepak Kodihalli2017-04-101-0/+6
| | | | | | | The erase method can erase an entry object specified by id. Change-Id: I86bb2a214b8cf9b951af37f69767ff025f2f5fd0 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Make generated code to be const and externAdriana Kobylak2017-03-151-0/+5
| | | | | | | | | | | | Set generated maps to be const so that they don't get accidentally overwritten. Use .find() to access these generated data sets as the [] operator is not const. Declare the generated maps as extern so that there's no need to include the generated .cpp file. Change-Id: I4efdcace099bec738e1fa9b67decbedd515d3dfa Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Invoke metadata handlerDeepak Kodihalli2017-03-151-0/+10
| | | | | | | | Check if error metadata fields have associated handlers, if yes, invoke them before construction the error d-bus object. Change-Id: I197385c5c43242f633274b82289cd70c85c1d6e7 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Entry: Populate propertiesAdriana Kobylak2017-02-141-3/+7
| | | | | | | | Create an Entry dbus object when Commit is called and fill in its properties with the journal data. Change-Id: I155cacbdfdccfa8b1f594503d858710fa71f2026 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Entry: Setup constructorAdriana Kobylak2017-01-301-1/+11
| | | | | | | | | Persist the log manager dbus bus and create a vector of Entry instances to store the Entry dbus objects as they get created. Change-Id: I4add43c4ce6795b6ec6c041e41cd7455d34b3b6b Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* log_manager: Cleanup main functionAdriana Kobylak2017-01-301-23/+10
| | | | | | | | The design direction changed after the commit that added the log_manager main function, so updating it to the correct usage. Change-Id: I88459fb65ba6b8272f0f9f85b55f9f837487ffea Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* log_manager: Use sdbus++Adriana Kobylak2016-12-081-0/+70
Change-Id: Id2ad6a75b6ee3f7226c7cfd274dba24de89f9363 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
OpenPOWER on IntegriCloud