summaryrefslogtreecommitdiffstats
path: root/tools/elog-gen.py
Commit message (Collapse)AuthorAgeFilesLines
* Spelling fixesGunnar Mills2017-10-311-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: Idea8f76487125a7c7334b415a369c73d9fac40c4 Signed-off-by: Gunnar Mills <gmills@us.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>
* 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>
* elog-gen.py : strip whitespacesDeepak Kodihalli2017-04-201-1/+1
| | | | | | | | | Strip trailing and leading whitespaces from the error description. Resolves openbmc/openbmc#1481. Change-Id: Ia223ab34746e64d87dacd1f23ade7e4fc63ca9df Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* elog-gen.py : consume metadata 'process' keywordDeepak Kodihalli2017-03-151-5/+13
| | | | | | | | 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>
* elog-gen.py: handle absence of metadataDeepak Kodihalli2017-03-091-8/+9
| | | | | | | | | | | 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>
* Include namespaces in the phosphor-logging exception nameAdriana Kobylak2017-03-021-17/+19
| | | | | | | | | | | | | | | | | 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>
* Use configure option yaml path to generate elog-errors.hppAdriana Kobylak2017-03-011-2/+2
| | | | | | | | | | | | 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>
* 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-281-14/+18
| | | | | | | | 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-281-6/+17
| | | | | | | | | 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-281-4/+4
| | | | | | | | | 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>
* Move inherits keyword from errors.yaml to metadata.yamlAdriana Kobylak2017-02-201-7/+7
| | | | | | | | The metadata.yaml file is the correct location for the inherits. Update the elog-gen.py parser to support this change. Change-Id: Iac7f67ec72e761ab3dafbf89c7e4d5495b34f00d Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* elog-gen.py: python3 fixesPatrick Williams2017-02-201-7/+7
| | | | | Change-Id: I4a96fe626c32e0c8078f8875da48eb06d63e763b Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* elog-gen.py : implement error inheritanceDeepak Kodihalli2017-01-271-1/+2
| | | | | | | | | If an error inherits another error (via the error YAML interface), have the child error inherit parent's metadata. Only single inheritance is supported as of now. Change-Id: I9ff295f4db04a9c5389f66e04f5d28287f9628a9 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* elog-gen.py : order inherited errorsDeepak Kodihalli2017-01-271-7/+39
| | | | | | | | | The elog-gen.py script should process errors such that the generated code has definitions for parent errors before their child errors are defined. Change-Id: I035292731346bdba969f549c7e4033066814890f Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* elog-gen.py : check error inheritanceDeepak Kodihalli2017-01-271-0/+12
| | | | | | | | Check if errors that are being inherited from have their interfaces defined. Throw an error if not. Change-Id: I13c6b844ef46eef7fead7a5f8ae1d8b56d914ecf Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* elog-gen.py : get inherited-from errorDeepak Kodihalli2017-01-271-2/+10
| | | | | | | | | | | | Openbmc error interfaces can inherit other error interfaces, thereby allowing to combine metadata across errors. The current implementation would support single inheritance only. This first commit related to error inheritance implementation lets elog-gen.py figure out an error's parent. Change-Id: Ia5c44de755e777e0cb2725afa5988c97283d10f0 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* elog-gen.py : read multiple error yaml filesDeepak Kodihalli2017-01-271-56/+92
| | | | | | | | | | | | | | | | This change enables the elog-gen script to look at more than one error yaml file (and corresponding metadata yaml file). The input to the script had to be changed to a yaml directory, containing error yaml files, instead of a single error yaml file. The reason to support reading multiple error yaml files is that, without this, applications have to all dump their errors in a single big error yaml file. Now it's possible to write application/domain specific error yaml files; they just need to be exported to the same location, from where elog-gen.py can pick them. Change-Id: I9418bf0e0b54a7b7f7701b337649cb8eb4c54913 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Fix types in error-logging YAML to match openbmc standardsDeepak Kodihalli2017-01-211-2/+17
| | | | | Change-Id: If5e2e534740f0675ba9294905ae531e015aed85a Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Rename <Interface>.logging.yaml to <Interface>.metadata.yamlDeepak Kodihalli2017-01-211-2/+2
| | | | | | | This change is just for brevity. Change-Id: Ie2360b19179837a1dc3675e96a4adcc2114f2bc6 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Break elog yaml files into two piecesAndrew Geissler2016-11-231-6/+27
| | | | | | | | | This is the final piece to supporting the phosphor-dbus-interfaces design where the errors are defined in one yaml file and their corresponding meta data is defined within another file. Change-Id: Idd2e18c1fd82fccb1298a2570a484deb382954f8 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Base error log namespaces on yaml file pathAndrew Geissler2016-11-231-7/+28
| | | | | | | | | This is another step in the direction of getting us to support the error yaml file as it will be defined in the phosphor-dbus-interfaces repo. Change-Id: Ib437bea920f511bdbf541c3e2653bbf35a83fe92 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Address new yaml format changes introduced by sdbusplus commit 7d7fda5Andrew Geissler2016-11-221-2/+2
| | | | | | | | Patrick's commit for exceptions had a few tweaks to the yaml file format. This commit updates elog_gen.py to support them. Change-Id: I59261ab0fddefde67304cbb394c74b9c9c5e496f Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Move header generation tool and templates to sub-directoriesAndrew Geissler2016-11-181-0/+101
This is being done to prep for exporting the tools and templates to be used by other repos Change-Id: Ia93166ade2a0361eca86cde123875b95a44a1ef3 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
OpenPOWER on IntegriCloud