| 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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>
|
|
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>
|