Application specific local errors

Devender Rao mdevender at gmail.com
Thu Aug 24 00:16:34 AEST 2017


Hi All,

I'm working this sprint on https://github.com/openbmc/openbmc/issues/1772.

This story is to fix the CI issued noticed when new application specific
error YAML files are added. Fixed this by manually generating elog-errors.hpp
for the newly added error YAML file  by using the parser from
phosphor-logging and adding it as part of the application.

Proposal is to use autotools macro to generate the elog-errors.hpp instead
of manual process but noticed it solves the problem partially.

Recently noticed newer problems when applications use both DBUS errors and
error from the newly added error yaml file.
When <phoshpor-logging/elog-errors.hpp> is included for dbus related errors
and <elog-errors.hpp> for newly generated errors and when the code is
merged and newly added error comes in as part of
<phoshpor-logging/elog-errors.hpp>
we run into "error: redefinition" error.

Capturing below my observations in detail

*Current approach to fix CI failures noticed for newly added errors*
*Adding new application error*
 *  Generate elog-errors.hpp manually for the newly added error yaml and
check-in as part of the repository.
 *  Include "#include <elog-errors.hpp> in the application code.
 *  This approach works until the application does not throw any DBUS errors
*   Need to have follow up commit to remove "#include <elog-errors.hpp>"
and add  "#include <phoshpor-logging/elog-errors.hpp>"

*Adding new application error and also use existing dbus errors in the
application*
 *  Users ran into "error: redefinition" error when manually generated
"elog-errors.hpp" for new error yaml file and
"phosphor-logging/elog-errors.hpp" for DBUS errors is
     included in the same cpp file.
 *  Below specified approach is followed to overcome the problem
 *  Copy the "phosphor-logging/elog-errors.hpp" to the app
 *  Manually generate "elog-errors.hpp" for the newly added error yaml
 *  Merge contents of "phosphor-logging/elog-errors.hpp" and
"elog-errors.hpp" as "elog-errors.hpp".
 *  Include "<elog-errors.hpp>" as part of the application code


*Proposed solution*
*Proposal1 - Fixing the CI issue by timing the commits*
 *  Push first only the newly added error yaml file and the native recipe
that copies the error yaml first.
 *  After the above code is merged, generate new SDK which now has the
newly added error as part of <phosphor-logging/elog-errors.hpp>
 *  Applications can use newly generated <phosphor-logging/elog-errors.hpp>
 *  Users can manually / use auto-conf macro to generate elog-errors.hpp
and do testing till the error yaml and native recipe are merged and new SDK
is built.

*Proposal2 - Using autoconf to generate elog-errors.hpp*
 *  Place all the error yamls used by the app and newly added error yaml in
the app folder
 *  Use auto-conf macro to generate elog-errors.hpp for all the yaml files
placed in the app.
 *  Use generated "elog-errors.hpp" instead of
"<phosphor-logging/elog-errors.hpp>"
 *  Have a follow-up commit that removes "#include <elog-errors.hpp>"   and
add "#include<phosphor-logging/elog-errors.hpp>".
 *  Remove manually generated "elog-errors.hpp" file.

There could be other issues relating to inhering of errors from DBUS and
errors and e.t.c which need to be addressed.

Regards
Devender
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20170823/6a910c4f/attachment.html>


More information about the openbmc mailing list