| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Create an empty set when there is no elog lookup meta data instead of
defaulting to add a single empty string entry.
Tested:
Built image and verified empty string no longer in errors where no
meta data is defined.
Change-Id: I7bf1ff2ab18f174d4cfa78cf22eeac4918033148
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A journal entry is produced for failure to find empty string meta data
for elogs due to an empty string entry within the generated elog lookup
source. This empty string is due to error yamls that do not contain any
meta data entry of their own and only inherit from another error yaml.
An example of the journal entry for the empty string meta data that is
removed with this fix::
CODE_LINE=76
CODE_FUNC=helper_log
_SYSTEMD_SLICE=system.slice
CODE_FILE=../git/phosphor-logging/log.hpp
MESSAGE=Failed to find metadata
TRANSACTION_ID=4016514682
META_FIELD=
SYSLOG_IDENTIFIER=phosphor-log-manager
_PID=181
_COMM=phosphor-log-ma
_EXE=/usr/bin/phosphor-log-manager
Tested:
Built image and verified empty string entry no longer generated on
errors without meta data but inherit meta data from other error yaml
Change-Id: I3c8745acd86173873827cd59eb6e8d4f687b0e1b
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
| |
Change-Id: I880cf6793e64db29a6eee74839f5a5bdabb1dff2
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
In python3 print requires () wrapping around parameters.
Change-Id: I830ef0d0e8c9e42c1157b708153bf96599346977
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
Change iteritems to items, which is slightly slower
on python2 but exists in both. None of the maps manipulated
by this program are large enough for the items vs iteritems
to be a concern.
Change-Id: I63032ddde53a116431cc2cbe01828448a4d4f328
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Include inherited metadata in the code generated for metadata lookup.
Change-Id: I9389eb08b0c74c94a377f7434ee358965c2fdf2b
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: I4a96fe626c32e0c8078f8875da48eb06d63e763b
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
| |
Alias metadata inherited from parent errors such that users don't have
to explicitly know which parent provides the metadata :
using metaName = ParentError::metaName
Change-Id: Idd285766b9f831d19391f46cee1ed2ff320b2c30
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Delete unused elog-lookup-template.mako.cpp file and update the
one in the tools directory.
Example of generated code for reference:
std::map<std::string,level> g_errLevelMap = {
{"TestErrorOne",level::INFO},
{"TestErrorTwo",level::ERR},
};
Change-Id: I5dcf47cb4827f80aa7a04bbe2beb181e28d7dafc
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: If5e2e534740f0675ba9294905ae531e015aed85a
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
| |
This change is just for brevity.
Change-Id: Ie2360b19179837a1dc3675e96a4adcc2114f2bc6
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
The real yaml will be defined in the phosphor-dbus-interfaces
repo. This one will be an example one and used for testing.
Future commits will refactor it to separate the error def
from the meta data.
Change-Id: Id05f935cbc24fb030e2ba378423ef3261bf5f7fb
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
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>
|