summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add new commit API and deprecate older commit methodMarri Devender Rao2017-04-124-15/+69
| | | | | | | | Added new commit method that accepts an sdbusplus exception Deprecate commit which accepts an exception name Change-Id: I9b5c91eb13466eb576c329ebb7fd00ce33f7dd9f Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* entry: store parent referenceDeepak Kodihalli2017-04-112-3/+12
| | | | | | | | 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>
* entry: implement xyz.openbmc_project.Object.DeleteDeepak Kodihalli2017-04-112-1/+12
| | | | | | | | | Implement xyz.openbmc_project.Object.Delete to delete an entry object. Resolves openbmc/openbmc#1327. Change-Id: I265c26fb9434d0d4cb066fbfa85729782318bd8f Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* manager: define erase methodDeepak Kodihalli2017-04-102-0/+15
| | | | | | | The erase method can erase an entry object specified by id. Change-Id: I86bb2a214b8cf9b951af37f69767ff025f2f5fd0 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Entry: implement setting 'Resolved' propertyDeepak Kodihalli2017-03-311-0/+15
| | | | | | | | | | When an error is marked resolved, delete error associations, if any. When an error is marked un-resolved, re-create error associations, if there were any. Change-Id: I49acd2b6f01810e3b19e3fddbc716eb539fc20c0 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Entry: store associationsDeepak Kodihalli2017-03-311-0/+5
| | | | | | | | Store a copy of the entry object's associations, in case we need to recreate them, for example when marking an error as unresolved. Change-Id: I50001365211325505ed3a72b19a46b1438cc9731 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Entry: default 'Resolved' propertyDeepak Kodihalli2017-03-291-0/+1
| | | | | | | Set the 'Resolved' property of an error as 'false' by default. Change-Id: I0618e1f6ca2f74ce3d06aef9572becfcd78d9b60 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* build: add configure flag for metadata handlersDeepak Kodihalli2017-03-291-0/+6
| | | | | | | | | Error metadata handlers are compiled based on a specific compile flag (-DPROCESS_META), which in turn is set if a configure flag is enabled (--enable-metadata-processing). Change-Id: I77319f38cfd219bb831f9a3ee731441211e7bb9b Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Move object_mapper per dbus path conventions.Leonel Gonzalez2017-03-201-1/+1
| | | | | | | Partial fix for openbmc/openbmc#1112. Change-Id: Id01fdae36576d99d90775e4c2f6443b87c1198ee Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
* Describe a compile flagDeepak Kodihalli2017-03-161-0/+4
| | | | | | | Add a comment to describe the PROCESS_META compile flag. Change-Id: I9dc652fd2f3f7b595177112114b53a650c514772 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Fix incorrect template specializationDeepak Kodihalli2017-03-162-2/+2
| | | | | Change-Id: I15c18d8e241226b1e9fcbf9c36c703b47b488ce5 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Map sdbusplus exception to phosphor exceptionDeepak Kodihalli2017-03-154-26/+104
| | | | | | | | | | | | | Errors will be created by using the sdbusplus error types, which results in an sdbusplus exception being thrown. Error metadata can be verified at compile-time by checking the error against phosphor-logging error types. This commit maps the sdbusplus error type to the phosphor type, for this purpose, via template specializations. Change-Id: Iee37e2a3846cc3acf3a62270a520ff0c395fd36d Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* callouts: implement metadata handlerDeepak Kodihalli2017-03-154-2/+69
| | | | | | | | Implement handler of the metadata CALLOUT_DEVICE_PATH. This handler will convert a device path to an inventory path and call out the latter. Change-Id: Icbf9c841884ec139f35ea2ac94648e355b421bb2 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Update .gitignoreDeepak Kodihalli2017-03-151-0/+11
| | | | | Change-Id: I5171d013f994a3b40f8c8640d4af99d534ffcf71 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* test: add callout-testDeepak Kodihalli2017-03-157-1/+93
| | | | | | | | Add test program which can create callouts based on an input device path. It creates an error, with callouts, with name TestCallout. Change-Id: I96b66b73ae4a9c00daff06222841a13747c07408 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Make generated code to be const and externAdriana Kobylak2017-03-154-6/+22
| | | | | | | | | | | | 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>
* build: add rule to generate callout mappingsDeepak Kodihalli2017-03-152-3/+13
| | | | | | | | | The callout mappings are generated at build time by a script, which needs an input YAML file. This change enables providing such a YAML file by the phosphor-logging recipe. Change-Id: I8e174d60e37eabb6d26ff7822ab5c9f38d35e0a6 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* callouts: add script to generate callout mappingsDeepak Kodihalli2017-03-152-0/+55
| | | | | | | | Add a script that can generate callout mappings. The script needs an input YAML to denote callout mappings. Add an example YAML. Change-Id: I7b49fe4c586bf7abfed2865cfd776de4d5745ef5 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* callouts: add example output YAMLDeepak Kodihalli2017-03-151-0/+1
| | | | | | | | | | YAML is of the form: <sysfs device path>: <inventory path to be called out> This will help generate code to map device paths to inventory objects. Change-Id: I5613e766d0c6b39d9b2c4a6146a747ab321555cb Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Add utility to parse error metadataDeepak Kodihalli2017-03-151-0/+21
| | | | | | | | Add method to parse out the metadata name and value from the error metadata, which is of the format "name=value". Change-Id: I7b6ba790c97faced664a11eb5806f7f87e8166a7 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Invoke metadata handlerDeepak Kodihalli2017-03-152-0/+39
| | | | | | | | 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>
* build: generate elog-process-metadata.cppDeepak Kodihalli2017-03-151-2/+9
| | | | | | | Add rules to generate and build elog-process-metadata.cpp. Change-Id: If9b61dfd2fbd731708e41a48428115ee40b12d6b Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Add example metadata handler implementationDeepak Kodihalli2017-03-151-1/+11
| | | | | | | | Specialize metadata handler function template to depict implementation of this interface. Change-Id: I398db9c0bf1e0649ce7745d67f3345263ef1abcd Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* elog-gen.py : consume metadata 'process' keywordDeepak Kodihalli2017-03-152-5/+37
| | | | | | | | Add a new mako template to aid elog-gen.py to generate code for handling the metadata 'process' keyword. Change-Id: I720ac1e30cf566f5a6bfe090faec6da9742f7423 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* metadata: add interface to build associationsDeepak Kodihalli2017-03-151-0/+39
| | | | | | | | | | | | A metadata field found in the journal corresponding to an error could be special in the sense that it may require building specific error association objects. Add an interface to build such associations. Take advantage of the fact that every metadata has a corresponding type defined. Change-Id: I09e446879667044c009141443fc0dc6fed8a8b18 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* metadata: introduce 'process' keywordDeepak Kodihalli2017-03-151-0/+1
| | | | | | | | | | | | | | | An error metadata field that has the 'process' keyword set to true is an indication that this metadata will have some associated action that will take place after this metadata (and associated error) is logged to the journal and before the associated error is committed. The associated action will have to be implemented when adding the 'process' keyword. Add 'process' keyword to an example error definition. Change-Id: I42ab3fa230479000a88a18046548242c0043ac86 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Entry ctor: accept associationsDeepak Kodihalli2017-03-152-2/+9
| | | | | | | | | 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>
* Entry: implement org.openbmc.Associations APIDeepak Kodihalli2017-03-152-14/+10
| | | | | | | | Have the Entry object implement the org.openbmc.Associations DBus API in order to add inventory callouts to errors. Change-Id: I9c645c90e3de4601cdbb020b591f5da24c733613 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Generate sdbusplus bindingsDeepak Kodihalli2017-03-153-0/+276
| | | | | | | | | | Generate sdbusplus server bindings for the org.openbmc.Associations interface. Add YAML file that describes the org.openbmc.Associations interface. Change-Id: Ic72e372ec817a49f4e6f5305b693173d90ee5e24 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Fix incorrect error namespaceDeepak Kodihalli2017-03-151-3/+3
| | | | | Change-Id: I65894c7acfa75f4601f43de2595e0f1fda89c0bb Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Error log inject toolMichael Tritz2017-03-154-1/+77
| | | | | | | | | This tool adds an option to the logging-test to inject an error as specified by command line. Change-Id: I1028bd3964db23ed5ffa50414f7a6cc2f880c40c Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
* elog-lookup: include inherited metadataDeepak Kodihalli2017-03-091-5/+14
| | | | | | | Include inherited metadata in the code generated for metadata lookup. Change-Id: I9389eb08b0c74c94a377f7434ee358965c2fdf2b Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Match error full name and namespaceDeepak Kodihalli2017-03-092-13/+10
| | | | | | | | | | Remove the addition of the extra "namespace Error" while generating error full names, as the error full name doesn't have the extra "Error". This extra namespace addition was being done to match up sdbusplus error binding generation, but this will have to be re-looked at. Change-Id: Ib99ce8e3a09dd76a23b8cc6fe7e706551a1699d6 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* elog-gen.py: handle absence of metadataDeepak Kodihalli2017-03-093-14/+30
| | | | | | | | | | | An error may just want to inherit metadata from another error, without adding metadata of it's own. In such a case, the metadata file won't have the "meta" keyword, although it will have the "inherits" keyword. Accept metadata files that don't have the "meta" keyword. Change-Id: I4e30e035f19d6af8e0e1f654465d109fe5284a1b 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>
* Include namespaces in the phosphor-logging exception nameAdriana Kobylak2017-03-026-44/+55
| | | | | | | | | | | | | | | | | Currently the phosphor-logging exception name is for example Device for an error file located in xyz/openbmc_project/Error/Callout/. It should instead be named xyz.openbmc_project.Error.Callout.Device following the naming structure of the sdbusplus++ tool to differentiate it from other Device error exceptions. With the full name, the namespaces can be determined, so there's no need to pass the namespace parameter to the template that generates the elog-errors.hpp. As with the name, follow the namespace structure of the sdbusplus exception object. Closes openbmc/phosphor-logging#2 Change-Id: I960d759d90aa18fd43211034ebd6009859113ee7 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* build: Add nobase to the nodist_include_HEADERSAdriana Kobylak2017-03-011-1/+1
| | | | | | | | | | Replace nodist_include_HEADERS with nobase_nodist_include_HEADERS so that the header files retain their directory structure. Without it, phosphor-logging/elog-errors.hpp for example installs in usr/include/ instead of usr/include/phosphor-logging/. Change-Id: Ib2df7d93fd191316f03e4636ee453030d5a318f4 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Use configure option yaml path to generate elog-errors.hppAdriana Kobylak2017-03-016-14/+19
| | | | | | | | | | | | Add a config variable that can be passed via a recipe to point the parser to a directory where the error yaml files are. Rename elog-gen.hpp to elog-errors.hpp, which better matches the exception error log file names. Include elog-gen.hpp in elog.hpp so that callers that need to create and commit error logs only need to include one header file. Change-Id: Ie3cd65ac761c1f7b2c99c50a2273859283a5ab4b 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>
* elog-gen.py: Set INFO as default error log severity levelAdriana Kobylak2017-02-281-1/+5
| | | | | | | | Some error yaml files in the phosphor-dbus-interfaces repo do not specify the error log severity. Default this value to INFO. Change-Id: Ifd335ba7d5e3e8238365036a2bfa7a199e014cfc Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* elog-gen.py: Dynamically determine the namespacesAdriana Kobylak2017-02-282-15/+19
| | | | | | | | Namespaces should be determined by the directory tree where the yaml files are located. Change-Id: I82729728b6aebf4c48a0ec967f2d08c1cbf8b7f3 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* elog-gen.py: Support base and test yaml directoriesAdriana Kobylak2017-02-282-10/+22
| | | | | | | | | Add an additional argument to pass the directory where the unit test yaml files are located. Default the base directory to None as this argument will be passed by the recipe during build time. Change-Id: I1276d74e383e1517595371c3f6e31fa077eac43f Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* elog-gen.py: Support subdirsAdriana Kobylak2017-02-282-10/+10
| | | | | | | | | Add ability for elog-gen.py to find yaml files under subdirectories so that yaml files found in Error/Callout/ and Error/IIC/ for example can be found by the caller just passing the Error/ directory. Change-Id: I91dcd523d2a75deea6266a3ea6885b88cd788206 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Manager: Auto-generate the codeAdriana Kobylak2017-02-275-183/+27
| | | | | | | | | | Auto-generate the Manager code during build time using the sdbus++ tool. Closes: openbmc/phosphor-logging#1 Change-Id: Idb66725dc2b3a919981dc1a0acfebfde16c4420f Signed-off-by: Adriana Kobylak <anoo@linux.vnet.ibm.com>
* Removes header files from base dir of phosphor-loggingSaqib Khan2017-02-242-6/+1
| | | | | | | | | | | Note: The header files have been moved to the phosphor-logging dir and all other repositories must include the header files from there. Resolves openbmc/openbmc#938 Change-Id: I0faf0545a42c571da93fe4f3731ee7c939e3aff8 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* React to logging manager path changeDeepak Kodihalli2017-02-241-1/+1
| | | | | Change-Id: Ic75d30d88d74cd8a7ff85a4a526c85aa20b373a9 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Make phosphor-logging object paths lower-caseAdriana Kobylak2017-02-231-3/+3
| | | | | | | Per design direction, all dbus object paths should be lower-case. Change-Id: I444e981a91b5269b6af3642d5771a64324acfd7c Signed-off-by: Adriana Kobylak <anoo@linux.vnet.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>
OpenPOWER on IntegriCloud