summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* phosphor-rsyslog-conf: implement restoreDeepak Kodihalli2018-08-292-2/+41
| | | | | | | | Upon startup, if a remote logging config exists, relay that information into appropriate D-Bus properties. Change-Id: Ib873667a50f0c8a6af6a3b571f68d6075808ed10 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* rsyslog-conf: add validation and error handlingDeepak Kodihalli2018-08-293-10/+90
| | | | | | | Validate server IP address. Handle exceptions. Change-Id: I6da9949dbf90dd12853afca8050b68b3aaad144e Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* phosphor-ryslog-conf: add way to disable loggingDeepak Kodihalli2018-08-292-4/+27
| | | | | | | | Remote logging via rsyslog can be disabled by writing 0 to the port, or an empty string to the address. Change-Id: I50bce3ff008af1b9c488a09a2b36c01abbe5497d Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Add application to configure rsyslogDeepak Kodihalli2018-08-299-6/+270
| | | | | | | | | | | | | | The application implements the xyz.openbmc_project.Network.Client D-Bus interface to set a remote rsyslog server's address and port in the rsyslog config file. This lets us configure rsyslog to be able to stream out logs. TODO: Exception handling and validation will be handled in subsequent commits. Change-Id: I8917daab3f0de1806d2f1aafe99cb3a872f19184 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* documentation: markdown header level fixupsDeepak Kodihalli2018-08-291-24/+33
| | | | | Change-Id: I5d82f9d784e79fb52026e06bf7c0c771ddac96d6 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Add unit tests for the phosphor-logging serverNagaraju Goruganti2018-08-087-17/+181
| | | | | | | -Add unit tests for error wrapping Change-Id: Ib15620d84de8ab5abdc85b8f88dd7c05f83fd6f3 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* elog-gen: allow inherits from errors without metaLei YU2018-07-202-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, elog-gen only support inherits from errors that have meta, and if we inherit from an error without meta, e.g. Common.InternalFailure, we get build error like: KeyError: 'xyz.openbmc_project.Common.InternalFailure' This commit makes elog-gen to allow such case, so it is possible to allow a base error without meta, and inheriting error with additional error, e.g. # In Common: - name: NotAllowed ## No meta # In Time: - name: NotAllowed inherits: - xyz.openbmc_project.Common.NotAllowed meta: - str: "OWNER=%s" type: string - str: "SYNC_METHOD=%s" type: string Note: the "inherit" here does not mean the the error inherits from base errors in c++ class, it just makes error "logically" inherits base errors. And in future commits we could make it "really" inherits base errors in c++ level. Tested: Verify phosphor-logging builds correctly with above example error interfaces, and service is able to use such errors with elog. Change-Id: I8dccd7112881e3eb77a8f6ec62a532062348d2ef Signed-off-by: Lei YU <mine260309@gmail.com>
* static_assert typeof log message entriesJoseph Reynolds2018-06-221-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | Please wait to commit this review until all of the code that causes static_assert failures is committed. Resolves openbmc/openbmc#2905 Tested: static_assert only phosphor-logging now static_asserts that each item to be converted by the printf-like function has integral, enum, floating_point, or pointer type and each format argument has a type that decays to a char * type. Specifically, std::string fails the assertion because its address would be logged and not the string buffer. You probably want your strings to use s.c_str(). Note that we considered automatically applying c_str() to string objects, but the underlying entry function is constexpr which makes that impossible. Change-Id: I88f6c626d58254eaad9b1a44e6a9c693d2fc6cd9 Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
* Always call close on fd if file has been openedAdriana Kobylak2018-05-231-2/+5
| | | | | | | | | The previous logic only called close if the file had been opened AND there was a valid inotify watch handle. Even if there is not a watch handle, the file should be closed. Change-Id: Id1f6d441129e13c6a48d6156161425082aeba8e8 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Add MAINTAINERS fileAndrew Jeffery2018-05-191-0/+47
| | | | | Change-Id: I8044c620a2175626c60795c9cdadfafe0cbd0da8 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* Add the BMC code version to error logsMatt Spinler2018-05-015-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | Add the xyz.openbmc_project.Software.Version interface to the elog entries. This allows a user to know what BMC code level was running when the error was created. The level is persisted along with the other elog fields. If this code is flashed on a system that was running older code, and there were existing error logs, the version property will be left empty in the restored log entries. Older code is still able to restore logs created by this code as the version property is at the end of the serialized data and so is just ignored by Cereal. Resolves openbmc/openbmc#3133 Tested: Check that new error logs have the code level, and that restarting phosphor-log-manager preserves that property on the existing logs. Various incantations of running the older code with logs created by this code, and running this code with logs created by older code. Change-Id: I682aa3bf97c8352ce6dda05dfdf55d33173de891 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add function to read code versionMatt Spinler2018-05-013-1/+37
| | | | | | | | | | | | | | 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-172-9/+139
| | | | | | | | | | | | | | | 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>
* Spelling fixesGunnar Mills2018-04-131-1/+1
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: Ic91925be70a9577aaf746223320ab704acb9c3aa Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Implement ability to override default error levelDeepak Kodihalli2018-04-095-16/+155
| | | | | | | | | | | | | 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>
* templates: Allow use of -fsanitize=undefinedAndrew Jeffery2018-03-081-3/+7
| | | | | | | | Push down the str member to avoid linker errors about the lack of storage for str when using -fsanitize=undefined. Change-Id: I1a6b1ba9632aa6e4294573a6be3252d5230992b9 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* Add READMEMarri Devender Rao2018-01-182-79/+159
| | | | | | | | | | Captured steps for installing application local error yamls and generating elog-errors.hpp for local repository build Logging REST API is captured in a README document of dbus repo. Change-Id: I47d556372c0696f47988df769356abf71af71199 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Increase maximum log number from 100 to 200Andrew Geissler2017-12-151-1/+1
| | | | | | | | | | Utilization of the persistent filesystem in BMC has shown that there is room to double the number of error logs allowed on BMC systems. This increased size will assist in debugging of intermittent issues that occur over time. Change-Id: I81d5ff4ed42822b6a37779b5d190ad405df1a87d Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Roll errors after reaching Cap sizeNagaraju Goruganti2017-12-012-34/+27
| | | | | | | | | | | | | | | | 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>
* Add Readme fileNagaraju Goruganti2017-11-031-0/+32
| | | | | Change-Id: Ibda92d85a2ff789f896587ff00fb659ad8e96d54 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Spelling fixesGunnar Mills2017-10-312-2/+2
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: Idea8f76487125a7c7334b415a369c73d9fac40c4 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Handle more than 100 error logsNagaraju Goruganti2017-10-244-17/+62
| | | | | | | | | | | 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>
* Remove conditional check to export parser and mako scriptMarri Devender Rao2017-10-132-7/+2
| | | | | | | | | | | | | As part of the CI build noticed elog parser and mako script are not exported becuse of conditional check in the Makefile. Removed conditional check so that files are exported all the time. Conditional check works for bitbake build as the conditional value is set for native recipe build. Change-Id: I65a020757b7176e299af70a8ba9a647b415891be Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Fix configure option for build breakMarri Devender Rao2017-10-121-2/+2
| | | | | Change-Id: I2dc3f5e7c3d104f5d9152b7c44f77068a162e94a Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Install elog parser and mako script for native processingMarri Devender Rao2017-10-112-19/+40
| | | | | | | | Installed elog parser and mako scripts are used by repositories to build elog-errors.hpp for local application specific errors Change-Id: I2353185d28db59b052d2167d6f37f1b385978bb3 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Enable Cereal class versioningVishwanatha Subbanna2017-10-113-7/+36
| | | | | | | | | 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>
* phosphor-log-manager: Fix for deserialize cereal exceptionJayanth Othayoth2017-09-201-6/+17
| | | | | | | | | | | This commit provides a fix for an issue in which the cereal deserialize() would crash the phosphor-log-manager incase persistence file is empty in restore path. Resolves openbmc/openbmc#2337 Change-Id: Id9d8c066d0dc50cba62a67060c1ee8d43d046ff1 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Add implementation for delete all error log entries in one shotNagaraju Goruganti2017-09-135-7/+76
| | | | | | | 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-163-1/+34
| | | | | | | 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>
* Grammar fixes in app-local-errors READMEGunnar Mills2017-08-011-6/+6
| | | | | Change-Id: I217403a4a94f12b692a877418b34ed6a1cf8e142 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Remove elog-errors-HostEvent.hpp from phosphor-logging repoTom Joseph2017-07-253-88/+2
| | | | | | | Resolves openbmc/phosphor-logging#4 Change-Id: I15ccdef0dd63216991bbd113e47beb057df14df8 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Add association intf if there is inventory path metadataTom Joseph2017-07-252-0/+25
| | | | | Change-Id: I7d717d8ea5ccb3186bc18a4d1fea848eb7b0fdff 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>
* update README.mdMarri Devender Rao2017-06-271-1/+16
| | | | | | | | Captured steps for generating application specific elog-errors.hpp file. Change-Id: I8fb7815f2fa86c52843b7eec6d562111d8179b7d Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Move serialization template functionsDeepak Kodihalli2017-06-252-44/+44
| | | | | | | | Move serialization template functions from elog_serialize.hpp to elog.serialize.cpp, since they are called only within the cpp. Change-Id: I8df216e1d4a745d1386fc310fc5d4d9535a8b7c3 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* serialization: add testsDeepak Kodihalli2017-06-264-9/+176
| | | | | | | Resolves openbmc/openbmc#1684. Change-Id: Ia554147001e51b05fe8692ae0b39e3efaf481130 Signed-off-by: Deepak Kodihalli <dkodihal@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 changes to 'Resolved' propertyDeepak Kodihalli2017-06-262-9/+21
| | | | | | | | When an error is marked resolved, serialize and persist the changed 'Resolved' property. Change-Id: I922af84cbb826e1e43a0f0c99740868222ccb1fe Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Persist error d-bus objectsDeepak Kodihalli2017-06-268-13/+198
| | | | | | | | | | | | 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>
* fix checkstop error logged as INFOMarri Devender Rao2017-06-201-1/+10
| | | | | | | | | | Fix lookup mako template to use sdbus++ error name in error level and error meta map. Resolves openbmc/openbmc#1800 Change-Id: Id3bd7d8113ad0305f25a8fc321f6b79ab5033bb0 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* elog-gen: python3 fixes for printPatrick Williams2017-06-031-3/+3
| | | | | | | In python3 print requires () wrapping around parameters. Change-Id: I830ef0d0e8c9e42c1157b708153bf96599346977 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Readme file for handling application specific errorsMarri Devender Rao2017-06-031-0/+52
| | | | | Change-Id: I7f19ab8a2218e826e0c7c89eee0f70de55e8a6eb Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Use sdbusplus errName instead of phosphor errName in commitMarri Devender Rao2017-06-031-1/+1
| | | | | Change-Id: I2e5e1add72ee4fa29ecb8e858b101bbd648aeeec Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Remove inheriting from sdbus exception for error metadataMarri Devender Rao2017-06-031-3/+15
| | | | | | | | | | For logging/reporting exceptions, applications need to use exceptions generated by using sdbus++. For metadata, use header file generated by elog-gen script. Change-Id: Id8f61f8692bfd694d8875359d883465c1124bedf Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Allow parsing of error yaml files without metadata yaml fileMarri Devender Rao2017-06-031-37/+49
| | | | | | | | | | | At present parser throws error if metadata yaml file is not found, modified to not to return error. Restruture the code to loop through the entries in the error yaml file rather than through the meta yaml file. Change-Id: Iaae61690201aeffd8d9caa41515b29b7cc0b59a2 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Host event error should be logged as ERR instead of INFOMarri Devender Rao2017-05-261-2/+2
| | | | | Change-Id: I34555ba7c4a61f8bd7fa423719429e8d990e2488 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
OpenPOWER on IntegriCloud