summaryrefslogtreecommitdiffstats
path: root/log_manager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Roll errors after reaching Cap sizeNagaraju Goruganti2017-12-011-22/+23
| | | | | | | | | | | | | | | | 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>
* Perform sanity check while restoring error entriesMarri Devender Rao2017-11-191-5/+22
| | | | | | | | | | Check if the data in the persisted files is valid before restoring the error entries Resolves openbmc/openbmc#2646 Change-Id: Iff0846a3366a27e59484113b7020f540087aa994 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Avoid unnecessary call to id() in ::eraseMarri Devender Rao2017-11-171-2/+6
| | | | | Change-Id: I21e0cd5a03ee06db17b8d3ed7b712b3d350b6a5f Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Handle more than 100 error logsNagaraju Goruganti2017-10-241-17/+46
| | | | | | | | | | | 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>
* Enable Cereal class versioningVishwanatha Subbanna2017-10-111-1/+4
| | | | | | | | | Cereal class versioning helps to handle data de-serialization across different class versions that differ in the way, a particular data is serialized. Change-Id: Ica01c4cb0c213e0dca8824fcfcfaa5cb43c5bc2e Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add implementation for delete all error log entries in one shotNagaraju Goruganti2017-09-131-1/+3
| | | | | | | Resolves openbmc/openbmc#1561. Change-Id: Iac5aaee1bdf9b87ccce9bf8801468ac5a8f9be6c Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Add _PID information in elog AdditionalDataJayanth Othayoth2017-09-121-0/+3
| | | | | | | | dreport need PID information to collect process specific journal for InternalFailure type error triggered dump. Change-Id: I313caa4795f7c0d47c1f42dae0653008cdbd5967 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Implement a cap on the number of committed errorsMarri Devender Rao2017-08-161-0/+18
| | | | | | | Resolves openbmc/openbmc#1617 Change-Id: I5850e5addb723e6f5102eb4677bb365285c1a633 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* commit: Add call to Synchronize journal dbus methodAdriana Kobylak2017-08-071-0/+9
| | | | | | | | | | | Call the Synchronize method at the beginning of the Commit function to request that all pending messages are written into the journal. Fixes: openbmc/openbmc#1297 Change-Id: Id0ab04ff0cb9b7eeac3b7c2aaeb8730a3b4ed524 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Remove elog-errors-HostEvent.hpp from phosphor-logging repoTom Joseph2017-07-251-10/+1
| | | | | | | Resolves openbmc/phosphor-logging#4 Change-Id: I15ccdef0dd63216991bbd113e47beb057df14df8 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Fix host error logged as INFOMarri Devender Rao2017-07-131-1/+1
| | | | | | | | | | | At present org.open_power.Error.Host.Event.Event is handcoded and is not part of the error map used by log manager to identify the type of the error. Resolves openbmc/openbmc#1953 Change-Id: I2f390c29c9b47adcf20efc32bbb02cf026d55758 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Remove persisted error file upon error deletionDeepak Kodihalli2017-06-261-0/+6
| | | | | Change-Id: If2418ad9350d7f3bdbfe28a00728f431f08baf9f Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Persist error d-bus objectsDeepak Kodihalli2017-06-261-11/+43
| | | | | | | | | | | | 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>
* entry: store parent referenceDeepak Kodihalli2017-04-111-1/+2
| | | | | | | | Have the entry object store a reference to the error manager, passed via the entry ctor. Change-Id: I2c4a8c4c95929ab7005620f44ac17e9654d8e906 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* manager: define erase methodDeepak Kodihalli2017-04-101-0/+9
| | | | | | | 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-4/+13
| | | | | | | | | | | | 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/+29
| | | | | | | | 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 ctor: accept associationsDeepak Kodihalli2017-03-151-1/+3
| | | | | | | | | Pass a list of associations to the Entry ctor. This enables to create associations between the error object and other objects, if such associations exist. Change-Id: I88a517efc0ead0a62b2e6558822d94b8fc1c6070 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Ensure using correct string length when using transaction id journal dataAdriana Kobylak2017-03-071-4/+16
| | | | | | | | | | | journald does not guarantee that sd_journal_get() returns NULL terminated strings. Specify the actual length of the string (instead of relying on functions that look for NULL terminators to determine the length) to compare the transaction id number, otherwise intermittent errors can occur. Change-Id: I58c34f377866f002a09b07810065b4e064f216b9 Closes: openbmc/openbmc#1217 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Look for an exact match of transaction idAdriana Kobylak2017-03-021-2/+5
| | | | | | | | | | Currently the code would search for a matching string in the whole TRANSACTION_ID=1234 string, but there may cases that this could result in a false match. Change to extract the id number out of the string to do an exact compare. Change-Id: I2cc0e6b42937a36e9afb942c07c91c0b4469a963 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* commit(): Make function more efficientAdriana Kobylak2017-02-281-38/+43
| | | | | | | | | | | Change the logic of the commit function from searching the journal for each metadata variable, to looking for all metadata variables in each journal entry. This change reduces the number of times that we search through the journal from N to 1 time. Change-Id: I47143e746dafb06bdce25dfd0009933494f4d25d Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* commit: Search for all metadata variables in the journalAdriana Kobylak2017-02-221-49/+46
| | | | | | | | Fix the TODO to search for all the metadata variables in the journal. Change-Id: I62e01e5923b3d29317ef94b5b340153bbb8967a7 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* commit: Remove unused codeAdriana Kobylak2017-02-221-30/+0
| | | | | | | | | | | Remove the code that writes data to a tmp file. The error log entry will be saved via dbus property caching openbmc/openbmc#1055 Remove the code that gets the MESSAGE field from the journal, the error log entry doesn't have a use for it as it uses the exception name. Change-Id: Ie400acadc4a34f0d558808af47b41795f0ce8e2c Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Moved log.hpp and elog.hpp to a folder under phosphor-loggingSaqib Khan2017-02-201-2/+2
| | | | | | | | | | Now these files are copied to a folder under phosphor-logging, other repositories will need to be fixed. I'm leaving the files in the base dir as well until I work on fixing all projects that utilizes log.hpp and elog.hpp Change-Id: Ie4640852727c1572325e974548737bc70a6db7c2 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Add HostEvent support to Commit interfaceAdriana Kobylak2017-02-161-0/+22
| | | | | | | | Temporary support for the HostEvent data that is checked in instead of auto-generated. Change-Id: I34e0c8d91dd51b26efaadbe0cd8be951f0e4bc01 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Populate Timestamp when error entry is committedAdriana Kobylak2017-02-151-1/+5
| | | | | | | | | Populate the Entry Timestamp property which is described as the time when the error log entry is committed in milliseconds since 1970. Change-Id: Id47fb974cf8220975eef0cc226581d0603a798a9 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Entry: Populate propertiesAdriana Kobylak2017-02-141-1/+17
| | | | | | | | 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>
* log_manager: Cleanup main functionAdriana Kobylak2017-01-301-27/+0
| | | | | | | | 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>
* logging: Commit: Use transaction id and metadata lookupAdriana Kobylak2017-01-301-17/+19
| | | | | | | | | | Add the lookup mako target to the makefile to get it built. Use the lookup map to find the metadata that needs to be added to the error log. Use the transaction id to filter for the desired journal entries. Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> Change-Id: Ia57dc83aab4f7ee35f8de32a799c862be28113f7
* log_manager: Use sdbus++Adriana Kobylak2016-12-081-112/+36
| | | | | Change-Id: Id2ad6a75b6ee3f7226c7cfd274dba24de89f9363 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Add error/event log commit dbus methodAdriana Kobylak2016-11-091-11/+123
| | | | | | | | Create error/event log based on message id (process id) and metadata values. Change-Id: Iaf944130c4075ae2d2c192e5ef840451561791bc Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Create log manager serverAdriana Kobylak2016-11-081-0/+102
Error/event log dbus object with a placeholder method. Change-Id: Icfa3f0dcddb3f47a62d8480a936bd8baa4b49760 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
OpenPOWER on IntegriCloud