From ee4d83dfc7b6cf3b5979541ab5b1918b68e6bbdb Mon Sep 17 00:00:00 2001 From: Vishwanatha Subbanna Date: Thu, 29 Jun 2017 18:35:00 +0530 Subject: Add support to watch for OCC errors Change-Id: I98d95020a2d01e281e5c8efa825d6b4bd4c6c160 Signed-off-by: Vishwanatha Subbanna --- Makefile.am | 27 +- app.cpp | 50 +- configure.ac | 6 + elog-errors.hpp | 1328 +++++++++++--------------- occ_device.hpp | 37 +- occ_errors.cpp | 145 +++ occ_errors.hpp | 107 +++ occ_events.hpp | 30 + occ_manager.hpp | 16 +- occ_pass_through.cpp | 18 +- occ_status.cpp | 15 +- occ_status.hpp | 13 +- org/open_power/OCC/Device.errors.yaml | 15 + org/open_power/OCC/Device.metadata.yaml | 15 + org/open_power/OCC/PassThrough.errors.yaml | 11 - org/open_power/OCC/PassThrough.metadata.yaml | 11 - test/Makefile.am | 5 +- test/utest.cpp | 14 +- 18 files changed, 1017 insertions(+), 846 deletions(-) create mode 100644 occ_errors.cpp create mode 100644 occ_errors.hpp create mode 100644 occ_events.hpp create mode 100644 org/open_power/OCC/Device.errors.yaml create mode 100644 org/open_power/OCC/Device.metadata.yaml delete mode 100644 org/open_power/OCC/PassThrough.errors.yaml delete mode 100644 org/open_power/OCC/PassThrough.metadata.yaml diff --git a/Makefile.am b/Makefile.am index 25e1358..5042ec5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,19 +2,22 @@ noinst_HEADERS = \ occ_pass_through.hpp \ occ_status.hpp \ - powercap.hpp + powercap.hpp \ + occ_errors.hpp \ + occ_events.hpp sbin_PROGRAMS = openpower-occ-control openpower_occ_control_SOURCES = \ occ_pass_through.cpp \ occ_status.cpp \ occ_device.cpp \ + occ_errors.cpp \ app.cpp \ - org/open_power/OCC/PassThrough/error.cpp \ - powercap.cpp + powercap.cpp \ + org/open_power/OCC/Device/error.cpp -BUILT_SOURCES = org/open_power/OCC/PassThrough/error.hpp \ - org/open_power/OCC/PassThrough/error.cpp +BUILT_SOURCES = org/open_power/OCC/Device/error.hpp \ + org/open_power/OCC/Device/error.cpp CLEANFILES = ${BUILT_SOURCES} @@ -22,19 +25,21 @@ openpower_occ_control_LDFLAGS = \ $(SDBUSPLUS_LIBS) \ $(PHOSPHOR_LOGGING_LIBS) \ $(OPENPOWER_DBUS_INTERFACES_LIBS) \ + $(PHOSPHOR_DBUS_INTERFACES_LIBS) \ -lstdc++fs openpower_occ_control_CXXFLAGS = $(SDBUSPLUS_CFLAGS) \ $(PHOSPHOR_LOGGING_CFLAGS) \ - $(OPENPOWER_DBUS_INTERFACES_CFLAGS) + $(OPENPOWER_DBUS_INTERFACES_CFLAGS) \ + $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) -org/open_power/OCC/PassThrough/error.hpp: ${top_srcdir}/org/open_power/OCC/PassThrough.errors.yaml +org/open_power/OCC/Device/error.hpp: ${top_srcdir}/org/open_power/OCC/Device.errors.yaml @mkdir -p `dirname $@` - $(SDBUSPLUSPLUS) -r $(top_srcdir) error exception-header org.open_power.OCC.PassThrough > $@ + $(SDBUSPLUSPLUS) -r $(top_srcdir) error exception-header org.open_power.OCC.Device > $@ -org/open_power/OCC/PassThrough/error.cpp: ${top_srcdir}/org/open_power/OCC/PassThrough.errors.yaml +org/open_power/OCC/Device/error.cpp: ${top_srcdir}/org/open_power/OCC/Device.errors.yaml @mkdir -p `dirname $@` - $(SDBUSPLUSPLUS) -r $(top_srcdir) error exception-cpp org.open_power.OCC.PassThrough > $@ + $(SDBUSPLUSPLUS) -r $(top_srcdir) error exception-cpp org.open_power.OCC.Device > $@ -SUBDIRS = . test \ No newline at end of file +SUBDIRS = . test diff --git a/app.cpp b/app.cpp index 449bea3..ee02949 100644 --- a/app.cpp +++ b/app.cpp @@ -1,32 +1,44 @@ #include -#include +#include +#include +#include #include "occ_manager.hpp" +#include "occ_events.hpp" +#include "elog-errors.hpp" #include "config.h" +using namespace phosphor::logging; + +using namespace sdbusplus::org::open_power::OCC::Device::Error; +using InternalFailure = sdbusplus::xyz::openbmc_project::Common:: + Error::InternalFailure; + int main(int argc, char* argv[]) { - try + auto bus = sdbusplus::bus::new_default(); + + // Need sd_event to watch for OCC device errors + sd_event* event = nullptr; + auto r = sd_event_default(&event); + if (r < 0) { - auto bus = sdbusplus::bus::new_default(); - bus.request_name(OCC_CONTROL_BUSNAME); + log("Error creating a default sd_event handler"); + return r; + } + open_power::occ::EventPtr eventP{event}; + event = nullptr; - sdbusplus::server::manager::manager objManager(bus, - OCC_CONTROL_ROOT); + // Attach the bus to sd_event to service user requests + bus.attach_event(eventP.get(), SD_EVENT_PRIORITY_NORMAL); - open_power::occ::Manager mgr(bus); + sdbusplus::server::manager::manager objManager(bus, OCC_CONTROL_ROOT); + open_power::occ::Manager mgr(bus, eventP); - while (true) - { - bus.process_discard(); - bus.wait(); - } - } - catch (const std::exception& e) - { - using namespace phosphor::logging; - log(e.what()); - return -1; - } + // Claim the bus since all the house keeping is done now + bus.request_name(OCC_CONTROL_BUSNAME); + + // Wait for requests + sd_event_loop(eventP.get()); return 0; } diff --git a/configure.ac b/configure.ac index e20fe7f..dadc118 100644 --- a/configure.ac +++ b/configure.ac @@ -43,6 +43,8 @@ PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\ AC_MSG_ERROR(["Requires phosphor-logging package."])) PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces],,\ AC_MSG_ERROR(["Requires openpower-dbus-interfaces package."])) +PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\ + AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."])) # Check for sdbusplus PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR(["sdbusplus packaged required and not found"])]) @@ -91,6 +93,10 @@ AC_ARG_VAR(OCC_HWMON_PATH, [The OCC hwmon path]) AS_IF([test "x$OCC_HWMON_PATH" == "x"], [OCC_HWMON_PATH="/sys/bus/platform/drivers/occ-hwmon/"]) AC_DEFINE_UNQUOTED([OCC_HWMON_PATH], ["$OCC_HWMON_PATH"], [The OCC hwmon path]) +AC_ARG_VAR(DEV_PATH, [The device path]) +AS_IF([test "x$DEV_PATH" == "x"], [DEV_PATH="/sys/bus/platform/devices/"]) +AC_DEFINE_UNQUOTED([DEV_PATH], ["$DEV_PATH"], [The device path]) + AC_ARG_VAR(PS_DERATING_FACTOR, [The power supply derating factor]) AS_IF([test "x$PS_DERATING_FACTOR" == "x"], [PS_DERATING_FACTOR=90]) AC_DEFINE_UNQUOTED([PS_DERATING_FACTOR], [$PS_DERATING_FACTOR], [The power supply derating factor]) diff --git a/elog-errors.hpp b/elog-errors.hpp index c9abdfa..823ffdb 100644 --- a/elog-errors.hpp +++ b/elog-errors.hpp @@ -63,6 +63,26 @@ namespace Error } // namespace xyz } // namespace sdbusplus +namespace sdbusplus +{ +namespace org +{ +namespace open_power +{ +namespace OCC +{ +namespace Device +{ +namespace Error +{ + struct WriteFailure; +} // namespace Error +} // namespace Device +} // namespace OCC +} // namespace open_power +} // namespace org +} // namespace sdbusplus + namespace sdbusplus { namespace xyz @@ -206,58 +226,58 @@ namespace xyz { namespace openbmc_project { -namespace Common +namespace Sensor { -namespace File +namespace Device { namespace Error { - struct Seek; + struct ReadFailure; } // namespace Error -} // namespace File -} // namespace Common +} // namespace Device +} // namespace Sensor } // namespace openbmc_project } // namespace xyz } // namespace sdbusplus namespace sdbusplus { -namespace org +namespace xyz { -namespace open_power +namespace openbmc_project { -namespace OCC +namespace Common { -namespace PassThrough +namespace File { namespace Error { - struct OpenFailure; + struct Seek; } // namespace Error -} // namespace PassThrough -} // namespace OCC -} // namespace open_power -} // namespace org +} // namespace File +} // namespace Common +} // namespace openbmc_project +} // namespace xyz } // namespace sdbusplus namespace sdbusplus { -namespace xyz +namespace org { -namespace openbmc_project +namespace open_power { -namespace Sensor +namespace OCC { namespace Device { namespace Error { - struct ReadFailure; + struct ConfigFailure; } // namespace Error } // namespace Device -} // namespace Sensor -} // namespace openbmc_project -} // namespace xyz +} // namespace OCC +} // namespace open_power +} // namespace org } // namespace sdbusplus namespace sdbusplus @@ -268,13 +288,13 @@ namespace open_power { namespace OCC { -namespace PassThrough +namespace Device { namespace Error { - struct ReadFailure; + struct OpenFailure; } // namespace Error -} // namespace PassThrough +} // namespace Device } // namespace OCC } // namespace open_power } // namespace org @@ -308,13 +328,13 @@ namespace open_power { namespace OCC { -namespace PassThrough +namespace Device { namespace Error { - struct WriteFailure; + struct ReadFailure; } // namespace Error -} // namespace PassThrough +} // namespace Device } // namespace OCC } // namespace open_power } // namespace org @@ -351,47 +371,25 @@ namespace xyz { namespace openbmc_project { -namespace Common +namespace Control { -namespace _Timeout +namespace Host { - -struct TIMEOUT_IN_MSEC +namespace _CommandNotSupported { - static constexpr auto str = "TIMEOUT_IN_MSEC=%llu"; - static constexpr auto str_short = "TIMEOUT_IN_MSEC"; - using type = std::tuple,uint64_t>; - explicit constexpr TIMEOUT_IN_MSEC(uint64_t a) : _entry(entry(str, a)) {}; - type _entry; -}; -} // namespace _Timeout - -struct Timeout : public sdbusplus::exception_t -{ - static constexpr auto errName = "xyz.openbmc_project.Common.Timeout"; - static constexpr auto errDesc = "Operation timed out."; - static constexpr auto L = level::INFO; - using TIMEOUT_IN_MSEC = _Timeout::TIMEOUT_IN_MSEC; - using metadata_types = std::tuple; - const char* name() const noexcept - { - return errName; - } +} // namespace _CommandNotSupported - const char* description() const noexcept - { - return errDesc; - } +struct CommandNotSupported +{ + static constexpr auto L = level::ERR; + using metadata_types = std::tuple<>; - const char* what() const noexcept - { - return errName; - } }; -} // namespace Common +} // namespace Host +} // namespace Control } // namespace openbmc_project } // namespace xyz @@ -400,9 +398,9 @@ namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = xyz::openbmc_project::Common::Timeout; + using type = xyz::openbmc_project::Control::Host::CommandNotSupported; }; } @@ -413,51 +411,26 @@ namespace openbmc_project { namespace Common { -namespace _InvalidArgument +namespace _Timeout { -struct ARGUMENT_NAME -{ - static constexpr auto str = "ARGUMENT_NAME=%s"; - static constexpr auto str_short = "ARGUMENT_NAME"; - using type = std::tuple,const char*>; - explicit constexpr ARGUMENT_NAME(const char* a) : _entry(entry(str, a)) {}; - type _entry; -}; -struct ARGUMENT_VALUE +struct TIMEOUT_IN_MSEC { - static constexpr auto str = "ARGUMENT_VALUE=%s"; - static constexpr auto str_short = "ARGUMENT_VALUE"; - using type = std::tuple,const char*>; - explicit constexpr ARGUMENT_VALUE(const char* a) : _entry(entry(str, a)) {}; + static constexpr auto str = "TIMEOUT_IN_MSEC=%llu"; + static constexpr auto str_short = "TIMEOUT_IN_MSEC"; + using type = std::tuple,uint64_t>; + explicit constexpr TIMEOUT_IN_MSEC(uint64_t a) : _entry(entry(str, a)) {}; type _entry; }; -} // namespace _InvalidArgument +} // namespace _Timeout -struct InvalidArgument : public sdbusplus::exception_t +struct Timeout { - static constexpr auto errName = "xyz.openbmc_project.Common.InvalidArgument"; - static constexpr auto errDesc = "Invalid argument was given."; - static constexpr auto L = level::INFO; - using ARGUMENT_NAME = _InvalidArgument::ARGUMENT_NAME; - using ARGUMENT_VALUE = _InvalidArgument::ARGUMENT_VALUE; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } + static constexpr auto L = level::ERR; + using TIMEOUT_IN_MSEC = _Timeout::TIMEOUT_IN_MSEC; + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; } // namespace Common @@ -469,9 +442,9 @@ namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = xyz::openbmc_project::Common::InvalidArgument; + using type = xyz::openbmc_project::Common::Timeout; }; } @@ -488,27 +461,11 @@ namespace _InternalFailure } // namespace _InternalFailure -struct InternalFailure : public sdbusplus::exception_t +struct InternalFailure { - static constexpr auto errName = "xyz.openbmc_project.Common.InternalFailure"; - static constexpr auto errDesc = "The operation failed internally."; static constexpr auto L = level::ERR; using metadata_types = std::tuple<>; - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } - - const char* what() const noexcept - { - return errName; - } }; } // namespace Common @@ -533,56 +490,37 @@ namespace openbmc_project { namespace Common { -namespace Callout -{ -namespace _Device +namespace _InvalidArgument { -struct CALLOUT_ERRNO +struct ARGUMENT_NAME { - static constexpr auto str = "CALLOUT_ERRNO=%d"; - static constexpr auto str_short = "CALLOUT_ERRNO"; - using type = std::tuple,int32_t>; - explicit constexpr CALLOUT_ERRNO(int32_t a) : _entry(entry(str, a)) {}; + static constexpr auto str = "ARGUMENT_NAME=%s"; + static constexpr auto str_short = "ARGUMENT_NAME"; + using type = std::tuple,const char*>; + explicit constexpr ARGUMENT_NAME(const char* a) : _entry(entry(str, a)) {}; type _entry; }; -struct CALLOUT_DEVICE_PATH +struct ARGUMENT_VALUE { - static constexpr auto str = "CALLOUT_DEVICE_PATH=%s"; - static constexpr auto str_short = "CALLOUT_DEVICE_PATH"; + static constexpr auto str = "ARGUMENT_VALUE=%s"; + static constexpr auto str_short = "ARGUMENT_VALUE"; using type = std::tuple,const char*>; - explicit constexpr CALLOUT_DEVICE_PATH(const char* a) : _entry(entry(str, a)) {}; + explicit constexpr ARGUMENT_VALUE(const char* a) : _entry(entry(str, a)) {}; type _entry; }; -} // namespace _Device +} // namespace _InvalidArgument -struct Device : public sdbusplus::exception_t +struct InvalidArgument { - static constexpr auto errName = "xyz.openbmc_project.Common.Callout.Device"; - static constexpr auto errDesc = "Generic device callout"; - static constexpr auto L = level::INFO; - using CALLOUT_ERRNO = _Device::CALLOUT_ERRNO; - using CALLOUT_DEVICE_PATH = _Device::CALLOUT_DEVICE_PATH; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } + static constexpr auto L = level::ERR; + using ARGUMENT_NAME = _InvalidArgument::ARGUMENT_NAME; + using ARGUMENT_VALUE = _InvalidArgument::ARGUMENT_VALUE; + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; -} // namespace Callout } // namespace Common } // namespace openbmc_project } // namespace xyz @@ -592,9 +530,9 @@ namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = xyz::openbmc_project::Common::Callout::Device; + using type = xyz::openbmc_project::Common::InvalidArgument; }; } @@ -605,49 +543,40 @@ namespace openbmc_project { namespace Common { -namespace Callout +namespace File { -namespace _GPIO +namespace _Open { -struct CALLOUT_GPIO_NUM +struct ERRNO { - static constexpr auto str = "CALLOUT_GPIO_NUM=%u"; - static constexpr auto str_short = "CALLOUT_GPIO_NUM"; - using type = std::tuple,uint32_t>; - explicit constexpr CALLOUT_GPIO_NUM(uint32_t a) : _entry(entry(str, a)) {}; + static constexpr auto str = "ERRNO=%d"; + static constexpr auto str_short = "ERRNO"; + using type = std::tuple,int32_t>; + explicit constexpr ERRNO(int32_t a) : _entry(entry(str, a)) {}; + type _entry; +}; +struct PATH +{ + static constexpr auto str = "PATH=%s"; + static constexpr auto str_short = "PATH"; + using type = std::tuple,const char*>; + explicit constexpr PATH(const char* a) : _entry(entry(str, a)) {}; type _entry; }; -} // namespace _GPIO +} // namespace _Open -struct GPIO : public sdbusplus::exception_t +struct Open { - static constexpr auto errName = "xyz.openbmc_project.Common.Callout.GPIO"; - static constexpr auto errDesc = "Callout GPIO pin"; - static constexpr auto L = level::INFO; - using CALLOUT_GPIO_NUM = _GPIO::CALLOUT_GPIO_NUM; - using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; - using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; - using metadata_types = std::tuple; + static constexpr auto L = level::ERR; + using ERRNO = _Open::ERRNO; + using PATH = _Open::PATH; + using metadata_types = std::tuple; - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } - - const char* what() const noexcept - { - return errName; - } }; -} // namespace Callout +} // namespace File } // namespace Common } // namespace openbmc_project } // namespace xyz @@ -657,9 +586,9 @@ namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = xyz::openbmc_project::Common::Callout::GPIO; + using type = xyz::openbmc_project::Common::File::Open; }; } @@ -670,58 +599,58 @@ namespace openbmc_project { namespace Common { -namespace Callout +namespace File { -namespace _IIC +namespace _Seek { -struct CALLOUT_IIC_BUS +struct OFFSET { - static constexpr auto str = "CALLOUT_IIC_BUS=%s"; - static constexpr auto str_short = "CALLOUT_IIC_BUS"; - using type = std::tuple,const char*>; - explicit constexpr CALLOUT_IIC_BUS(const char* a) : _entry(entry(str, a)) {}; + static constexpr auto str = "OFFSET=%ll"; + static constexpr auto str_short = "OFFSET"; + using type = std::tuple,int64_t>; + explicit constexpr OFFSET(int64_t a) : _entry(entry(str, a)) {}; type _entry; }; -struct CALLOUT_IIC_ADDR +struct WHENCE { - static constexpr auto str = "CALLOUT_IIC_ADDR=0x%hx"; - static constexpr auto str_short = "CALLOUT_IIC_ADDR"; - using type = std::tuple,uint16_t>; - explicit constexpr CALLOUT_IIC_ADDR(uint16_t a) : _entry(entry(str, a)) {}; + static constexpr auto str = "WHENCE=%d"; + static constexpr auto str_short = "WHENCE"; + using type = std::tuple,int32_t>; + explicit constexpr WHENCE(int32_t a) : _entry(entry(str, a)) {}; type _entry; }; - -} // namespace _IIC - -struct IIC : public sdbusplus::exception_t +struct ERRNO { - static constexpr auto errName = "xyz.openbmc_project.Common.Callout.IIC"; - static constexpr auto errDesc = "Callout IIC device"; - static constexpr auto L = level::INFO; - using CALLOUT_IIC_BUS = _IIC::CALLOUT_IIC_BUS; - using CALLOUT_IIC_ADDR = _IIC::CALLOUT_IIC_ADDR; - using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; - using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; - using metadata_types = std::tuple; + static constexpr auto str = "ERRNO=%d"; + static constexpr auto str_short = "ERRNO"; + using type = std::tuple,int32_t>; + explicit constexpr ERRNO(int32_t a) : _entry(entry(str, a)) {}; + type _entry; +}; +struct PATH +{ + static constexpr auto str = "PATH=%s"; + static constexpr auto str_short = "PATH"; + using type = std::tuple,const char*>; + explicit constexpr PATH(const char* a) : _entry(entry(str, a)) {}; + type _entry; +}; - const char* name() const noexcept - { - return errName; - } +} // namespace _Seek - const char* description() const noexcept - { - return errDesc; - } +struct Seek +{ + static constexpr auto L = level::ERR; + using OFFSET = _Seek::OFFSET; + using WHENCE = _Seek::WHENCE; + using ERRNO = _Seek::ERRNO; + using PATH = _Seek::PATH; + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; -} // namespace Callout +} // namespace File } // namespace Common } // namespace openbmc_project } // namespace xyz @@ -731,42 +660,62 @@ namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = xyz::openbmc_project::Common::Callout::IIC; + using type = xyz::openbmc_project::Common::File::Seek; }; } +namespace example +{ namespace xyz { namespace openbmc_project { -namespace Common +namespace Example { -namespace Callout +namespace Elog { -namespace _Inventory +namespace _TestErrorTwo { -struct CALLOUT_INVENTORY_PATH +struct DEV_ADDR { - static constexpr auto str = "CALLOUT_INVENTORY_PATH=%s"; - static constexpr auto str_short = "CALLOUT_INVENTORY_PATH"; + static constexpr auto str = "DEV_ADDR=0x%.8X"; + static constexpr auto str_short = "DEV_ADDR"; + using type = std::tuple,uint32_t>; + explicit constexpr DEV_ADDR(uint32_t a) : _entry(entry(str, a)) {}; + type _entry; +}; +struct DEV_ID +{ + static constexpr auto str = "DEV_ID=%u"; + static constexpr auto str_short = "DEV_ID"; + using type = std::tuple,uint32_t>; + explicit constexpr DEV_ID(uint32_t a) : _entry(entry(str, a)) {}; + type _entry; +}; +struct DEV_NAME +{ + static constexpr auto str = "DEV_NAME=%s"; + static constexpr auto str_short = "DEV_NAME"; using type = std::tuple,const char*>; - explicit constexpr CALLOUT_INVENTORY_PATH(const char* a) : _entry(entry(str, a)) {}; + explicit constexpr DEV_NAME(const char* a) : _entry(entry(str, a)) {}; type _entry; }; -} // namespace _Inventory +} // namespace _TestErrorTwo -struct Inventory : public sdbusplus::exception_t +struct TestErrorTwo : public sdbusplus::exception_t { - static constexpr auto errName = "xyz.openbmc_project.Common.Callout.Inventory"; - static constexpr auto errDesc = "Inventory item callout"; - static constexpr auto L = level::INFO; - using CALLOUT_INVENTORY_PATH = _Inventory::CALLOUT_INVENTORY_PATH; - using metadata_types = std::tuple; + static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.TestErrorTwo"; + static constexpr auto errDesc = "This is test error two"; + static constexpr auto L = level::ERR; + using DEV_ADDR = _TestErrorTwo::DEV_ADDR; + using DEV_ID = _TestErrorTwo::DEV_ID; + using DEV_NAME = _TestErrorTwo::DEV_NAME; + using metadata_types = std::tuple; const char* name() const noexcept { @@ -784,52 +733,45 @@ struct Inventory : public sdbusplus::exception_t } }; -} // namespace Callout -} // namespace Common +} // namespace Elog +} // namespace Example } // namespace openbmc_project } // namespace xyz +} // namespace example -namespace details -{ -template <> -struct map_exception_type +namespace example { - using type = xyz::openbmc_project::Common::Callout::Inventory; -}; - -} - namespace xyz { namespace openbmc_project { -namespace Common +namespace Example { -namespace Callout +namespace Elog { -namespace _IPMISensor +namespace _AutoTestSimple { -struct CALLOUT_IPMI_SENSOR_NUM +struct STRING { - static constexpr auto str = "CALLOUT_IPMI_SENSOR_NUM=%u"; - static constexpr auto str_short = "CALLOUT_IPMI_SENSOR_NUM"; - using type = std::tuple,uint32_t>; - explicit constexpr CALLOUT_IPMI_SENSOR_NUM(uint32_t a) : _entry(entry(str, a)) {}; + static constexpr auto str = "STRING=%s"; + static constexpr auto str_short = "STRING"; + using type = std::tuple,const char*>; + explicit constexpr STRING(const char* a) : _entry(entry(str, a)) {}; type _entry; }; -} // namespace _IPMISensor +} // namespace _AutoTestSimple -struct IPMISensor : public sdbusplus::exception_t +struct AutoTestSimple : public sdbusplus::exception_t { - static constexpr auto errName = "xyz.openbmc_project.Common.Callout.IPMISensor"; - static constexpr auto errDesc = "Callout IPMI sensor"; - static constexpr auto L = level::INFO; - using CALLOUT_IPMI_SENSOR_NUM = _IPMISensor::CALLOUT_IPMI_SENSOR_NUM; - using metadata_types = std::tuple; + static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.AutoTestSimple"; + static constexpr auto errDesc = "This is a simple test error."; + static constexpr auto L = level::ERR; + using STRING = _AutoTestSimple::STRING; + using metadata_types = std::tuple; const char* name() const noexcept { @@ -847,43 +789,54 @@ struct IPMISensor : public sdbusplus::exception_t } }; -} // namespace Callout -} // namespace Common +} // namespace Elog +} // namespace Example } // namespace openbmc_project } // namespace xyz +} // namespace example -namespace details -{ -template <> -struct map_exception_type +namespace example { - using type = xyz::openbmc_project::Common::Callout::IPMISensor; -}; - -} - namespace xyz { namespace openbmc_project { -namespace Control +namespace Example { -namespace Host +namespace Device { -namespace _CommandNotSupported +namespace _Callout { +struct CALLOUT_ERRNO_TEST +{ + static constexpr auto str = "CALLOUT_ERRNO_TEST=%d"; + static constexpr auto str_short = "CALLOUT_ERRNO_TEST"; + using type = std::tuple,int32_t>; + explicit constexpr CALLOUT_ERRNO_TEST(int32_t a) : _entry(entry(str, a)) {}; + type _entry; +}; +struct CALLOUT_DEVICE_PATH_TEST +{ + static constexpr auto str = "CALLOUT_DEVICE_PATH_TEST=%s"; + static constexpr auto str_short = "CALLOUT_DEVICE_PATH_TEST"; + using type = std::tuple,const char*>; + explicit constexpr CALLOUT_DEVICE_PATH_TEST(const char* a) : _entry(entry(str, a)) {}; + type _entry; +}; -} // namespace _CommandNotSupported +} // namespace _Callout -struct CommandNotSupported : public sdbusplus::exception_t +struct Callout : public sdbusplus::exception_t { - static constexpr auto errName = "xyz.openbmc_project.Control.Host.CommandNotSupported"; - static constexpr auto errDesc = "Command is not supported"; + static constexpr auto errName = "example.xyz.openbmc_project.Example.Device.Callout"; + static constexpr auto errDesc = "Generic device callout"; static constexpr auto L = level::ERR; - using metadata_types = std::tuple<>; + using CALLOUT_ERRNO_TEST = _Callout::CALLOUT_ERRNO_TEST; + using CALLOUT_DEVICE_PATH_TEST = _Callout::CALLOUT_DEVICE_PATH_TEST; + using metadata_types = std::tuple; const char* name() const noexcept { @@ -901,187 +854,115 @@ struct CommandNotSupported : public sdbusplus::exception_t } }; -} // namespace Host -} // namespace Control +} // namespace Device +} // namespace Example } // namespace openbmc_project } // namespace xyz +} // namespace example -namespace details -{ - -template <> -struct map_exception_type -{ - using type = xyz::openbmc_project::Control::Host::CommandNotSupported; -}; - -} -namespace org +namespace xyz { -namespace open_power +namespace openbmc_project { -namespace OCC +namespace Common { -namespace PassThrough +namespace Callout { -namespace _OpenFailure +namespace _Device { - -} // namespace _OpenFailure - -struct OpenFailure : public sdbusplus::exception_t +struct CALLOUT_ERRNO { - static constexpr auto errName = "org.open_power.OCC.PassThrough.OpenFailure"; - static constexpr auto errDesc = "Opening OCC device failed."; - static constexpr auto L = level::INFO; - using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; - using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } - - const char* what() const noexcept - { - return errName; - } + static constexpr auto str = "CALLOUT_ERRNO=%d"; + static constexpr auto str_short = "CALLOUT_ERRNO"; + using type = std::tuple,int32_t>; + explicit constexpr CALLOUT_ERRNO(int32_t a) : _entry(entry(str, a)) {}; + type _entry; }; - -} // namespace PassThrough -} // namespace OCC -} // namespace open_power -} // namespace org - - -namespace details -{ - -template <> -struct map_exception_type +struct CALLOUT_DEVICE_PATH { - using type = org::open_power::OCC::PassThrough::OpenFailure; + static constexpr auto str = "CALLOUT_DEVICE_PATH=%s"; + static constexpr auto str_short = "CALLOUT_DEVICE_PATH"; + using type = std::tuple,const char*>; + explicit constexpr CALLOUT_DEVICE_PATH(const char* a) : _entry(entry(str, a)) {}; + type _entry; }; -} - -namespace org -{ -namespace open_power -{ -namespace OCC -{ -namespace PassThrough -{ -namespace _ReadFailure -{ - - -} // namespace _ReadFailure +} // namespace _Device -struct ReadFailure : public sdbusplus::exception_t +struct Device { - static constexpr auto errName = "org.open_power.OCC.PassThrough.ReadFailure"; - static constexpr auto errDesc = "Reading from OCC failed."; - static constexpr auto L = level::INFO; - using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; - using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; + static constexpr auto L = level::ERR; + using CALLOUT_ERRNO = _Device::CALLOUT_ERRNO; + using CALLOUT_DEVICE_PATH = _Device::CALLOUT_DEVICE_PATH; using metadata_types = std::tuple; - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } - - const char* what() const noexcept - { - return errName; - } }; -} // namespace PassThrough -} // namespace OCC -} // namespace open_power -} // namespace org +} // namespace Callout +} // namespace Common +} // namespace openbmc_project +} // namespace xyz namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = org::open_power::OCC::PassThrough::ReadFailure; + using type = xyz::openbmc_project::Common::Callout::Device; }; } -namespace org +namespace xyz { -namespace open_power +namespace openbmc_project { -namespace OCC +namespace Common { -namespace PassThrough +namespace Callout { -namespace _WriteFailure +namespace _GPIO { +struct CALLOUT_GPIO_NUM +{ + static constexpr auto str = "CALLOUT_GPIO_NUM=%u"; + static constexpr auto str_short = "CALLOUT_GPIO_NUM"; + using type = std::tuple,uint32_t>; + explicit constexpr CALLOUT_GPIO_NUM(uint32_t a) : _entry(entry(str, a)) {}; + type _entry; +}; -} // namespace _WriteFailure +} // namespace _GPIO -struct WriteFailure : public sdbusplus::exception_t +struct GPIO { - static constexpr auto errName = "org.open_power.OCC.PassThrough.WriteFailure"; - static constexpr auto errDesc = "Writing to OCC failed."; - static constexpr auto L = level::INFO; + static constexpr auto L = level::ERR; + using CALLOUT_GPIO_NUM = _GPIO::CALLOUT_GPIO_NUM; using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; -} // namespace PassThrough -} // namespace OCC -} // namespace open_power -} // namespace org +} // namespace Callout +} // namespace Common +} // namespace openbmc_project +} // namespace xyz namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = org::open_power::OCC::PassThrough::WriteFailure; + using type = xyz::openbmc_project::Common::Callout::GPIO; }; } @@ -1090,43 +971,45 @@ namespace xyz { namespace openbmc_project { -namespace Control +namespace Common { -namespace Device +namespace Callout { -namespace _WriteFailure +namespace _IIC { +struct CALLOUT_IIC_BUS +{ + static constexpr auto str = "CALLOUT_IIC_BUS=%s"; + static constexpr auto str_short = "CALLOUT_IIC_BUS"; + using type = std::tuple,const char*>; + explicit constexpr CALLOUT_IIC_BUS(const char* a) : _entry(entry(str, a)) {}; + type _entry; +}; +struct CALLOUT_IIC_ADDR +{ + static constexpr auto str = "CALLOUT_IIC_ADDR=0x%hx"; + static constexpr auto str_short = "CALLOUT_IIC_ADDR"; + using type = std::tuple,uint16_t>; + explicit constexpr CALLOUT_IIC_ADDR(uint16_t a) : _entry(entry(str, a)) {}; + type _entry; +}; -} // namespace _WriteFailure +} // namespace _IIC -struct WriteFailure : public sdbusplus::exception_t +struct IIC { - static constexpr auto errName = "xyz.openbmc_project.Control.Device.WriteFailure"; - static constexpr auto errDesc = "Failed to write to device."; - static constexpr auto L = level::INFO; + static constexpr auto L = level::ERR; + using CALLOUT_IIC_BUS = _IIC::CALLOUT_IIC_BUS; + using CALLOUT_IIC_ADDR = _IIC::CALLOUT_IIC_ADDR; using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; -} // namespace Device -} // namespace Control +} // namespace Callout +} // namespace Common } // namespace openbmc_project } // namespace xyz @@ -1135,323 +1018,171 @@ namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = xyz::openbmc_project::Control::Device::WriteFailure; + using type = xyz::openbmc_project::Common::Callout::IIC; }; } -namespace example -{ namespace xyz { namespace openbmc_project { -namespace Example +namespace Common { -namespace Device +namespace Callout { -namespace _Callout +namespace _Inventory { -struct CALLOUT_ERRNO_TEST -{ - static constexpr auto str = "CALLOUT_ERRNO_TEST=%d"; - static constexpr auto str_short = "CALLOUT_ERRNO_TEST"; - using type = std::tuple,int32_t>; - explicit constexpr CALLOUT_ERRNO_TEST(int32_t a) : _entry(entry(str, a)) {}; - type _entry; -}; -struct CALLOUT_DEVICE_PATH_TEST +struct CALLOUT_INVENTORY_PATH { - static constexpr auto str = "CALLOUT_DEVICE_PATH_TEST=%s"; - static constexpr auto str_short = "CALLOUT_DEVICE_PATH_TEST"; + static constexpr auto str = "CALLOUT_INVENTORY_PATH=%s"; + static constexpr auto str_short = "CALLOUT_INVENTORY_PATH"; using type = std::tuple,const char*>; - explicit constexpr CALLOUT_DEVICE_PATH_TEST(const char* a) : _entry(entry(str, a)) {}; + explicit constexpr CALLOUT_INVENTORY_PATH(const char* a) : _entry(entry(str, a)) {}; type _entry; }; -} // namespace _Callout +} // namespace _Inventory -struct Callout : public sdbusplus::exception_t +struct Inventory { - static constexpr auto errName = "example.xyz.openbmc_project.Example.Device.Callout"; - static constexpr auto errDesc = "Generic device callout"; - static constexpr auto L = level::INFO; - using CALLOUT_ERRNO_TEST = _Callout::CALLOUT_ERRNO_TEST; - using CALLOUT_DEVICE_PATH_TEST = _Callout::CALLOUT_DEVICE_PATH_TEST; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } + static constexpr auto L = level::ERR; + using CALLOUT_INVENTORY_PATH = _Inventory::CALLOUT_INVENTORY_PATH; + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; -} // namespace Device -} // namespace Example +} // namespace Callout +} // namespace Common } // namespace openbmc_project } // namespace xyz -} // namespace example +namespace details +{ -namespace example +template <> +struct map_exception_type { + using type = xyz::openbmc_project::Common::Callout::Inventory; +}; + +} + namespace xyz { namespace openbmc_project { -namespace Example +namespace Common { -namespace Elog +namespace Callout { -namespace _TestErrorTwo +namespace _IPMISensor { -struct DEV_ADDR -{ - static constexpr auto str = "DEV_ADDR=0x%.8X"; - static constexpr auto str_short = "DEV_ADDR"; - using type = std::tuple,uint32_t>; - explicit constexpr DEV_ADDR(uint32_t a) : _entry(entry(str, a)) {}; - type _entry; -}; -struct DEV_ID +struct CALLOUT_IPMI_SENSOR_NUM { - static constexpr auto str = "DEV_ID=%u"; - static constexpr auto str_short = "DEV_ID"; + static constexpr auto str = "CALLOUT_IPMI_SENSOR_NUM=%u"; + static constexpr auto str_short = "CALLOUT_IPMI_SENSOR_NUM"; using type = std::tuple,uint32_t>; - explicit constexpr DEV_ID(uint32_t a) : _entry(entry(str, a)) {}; - type _entry; -}; -struct DEV_NAME -{ - static constexpr auto str = "DEV_NAME=%s"; - static constexpr auto str_short = "DEV_NAME"; - using type = std::tuple,const char*>; - explicit constexpr DEV_NAME(const char* a) : _entry(entry(str, a)) {}; + explicit constexpr CALLOUT_IPMI_SENSOR_NUM(uint32_t a) : _entry(entry(str, a)) {}; type _entry; }; -} // namespace _TestErrorTwo +} // namespace _IPMISensor -struct TestErrorTwo : public sdbusplus::exception_t +struct IPMISensor { - static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.TestErrorTwo"; - static constexpr auto errDesc = "This is test error two"; static constexpr auto L = level::ERR; - using DEV_ADDR = _TestErrorTwo::DEV_ADDR; - using DEV_ID = _TestErrorTwo::DEV_ID; - using DEV_NAME = _TestErrorTwo::DEV_NAME; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } + using CALLOUT_IPMI_SENSOR_NUM = _IPMISensor::CALLOUT_IPMI_SENSOR_NUM; + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; -} // namespace Elog -} // namespace Example +} // namespace Callout +} // namespace Common } // namespace openbmc_project } // namespace xyz -} // namespace example +namespace details +{ -namespace example +template <> +struct map_exception_type { + using type = xyz::openbmc_project::Common::Callout::IPMISensor; +}; + +} + namespace xyz { namespace openbmc_project { -namespace Example +namespace State { -namespace Elog +namespace Host { -namespace _AutoTestSimple +namespace _SoftOffTimeout { -struct STRING -{ - static constexpr auto str = "STRING=%s"; - static constexpr auto str_short = "STRING"; - using type = std::tuple,const char*>; - explicit constexpr STRING(const char* a) : _entry(entry(str, a)) {}; - type _entry; -}; -} // namespace _AutoTestSimple +} // namespace _SoftOffTimeout -struct AutoTestSimple : public sdbusplus::exception_t +struct SoftOffTimeout { - static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.AutoTestSimple"; - static constexpr auto errDesc = "This is a simple test error."; static constexpr auto L = level::ERR; - using STRING = _AutoTestSimple::STRING; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } + using TIMEOUT_IN_MSEC = xyz::openbmc_project::Common::Timeout::TIMEOUT_IN_MSEC; + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; -} // namespace Elog -} // namespace Example +} // namespace Host +} // namespace State } // namespace openbmc_project } // namespace xyz -} // namespace example - -namespace example -{ -namespace xyz -{ -namespace openbmc_project -{ -namespace Example -{ -namespace Elog -{ -namespace _TestCallout -{ - -struct DEV_ADDR +namespace details { - static constexpr auto str = "DEV_ADDR=0x%.8X"; - static constexpr auto str_short = "DEV_ADDR"; - using type = std::tuple,uint32_t>; - explicit constexpr DEV_ADDR(uint32_t a) : _entry(entry(str, a)) {}; - type _entry; -}; - -} // namespace _TestCallout -struct TestCallout : public sdbusplus::exception_t +template <> +struct map_exception_type { - static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.TestCallout"; - static constexpr auto errDesc = "This is test error TestCallout"; - static constexpr auto L = level::ERR; - using DEV_ADDR = _TestCallout::DEV_ADDR; - using CALLOUT_ERRNO_TEST = example::xyz::openbmc_project::Example::Device::Callout::CALLOUT_ERRNO_TEST; - using CALLOUT_DEVICE_PATH_TEST = example::xyz::openbmc_project::Example::Device::Callout::CALLOUT_DEVICE_PATH_TEST; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } - - const char* what() const noexcept - { - return errName; - } + using type = xyz::openbmc_project::State::Host::SoftOffTimeout; }; -} // namespace Elog -} // namespace Example -} // namespace openbmc_project -} // namespace xyz -} // namespace example - - +} namespace xyz { namespace openbmc_project { -namespace Common +namespace Control { -namespace File +namespace Device { -namespace _Open +namespace _WriteFailure { -struct ERRNO -{ - static constexpr auto str = "ERRNO=%d"; - static constexpr auto str_short = "ERRNO"; - using type = std::tuple,int32_t>; - explicit constexpr ERRNO(int32_t a) : _entry(entry(str, a)) {}; - type _entry; -}; -struct PATH -{ - static constexpr auto str = "PATH=%s"; - static constexpr auto str_short = "PATH"; - using type = std::tuple,const char*>; - explicit constexpr PATH(const char* a) : _entry(entry(str, a)) {}; - type _entry; -}; -} // namespace _Open +} // namespace _WriteFailure -struct Open : public sdbusplus::exception_t +struct WriteFailure { - static constexpr auto errName = "xyz.openbmc_project.Common.File.Open"; - static constexpr auto errDesc = "Failed to open a file"; - static constexpr auto L = level::INFO; - using ERRNO = _Open::ERRNO; - using PATH = _Open::PATH; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } - - const char* what() const noexcept - { - return errName; - } + static constexpr auto L = level::ERR; + using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; + using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; + using metadata_types = std::tuple; + }; -} // namespace File -} // namespace Common +} // namespace Device +} // namespace Control } // namespace openbmc_project } // namespace xyz @@ -1460,154 +1191,169 @@ namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = xyz::openbmc_project::Common::File::Open; + using type = xyz::openbmc_project::Control::Device::WriteFailure; }; } -namespace xyz +namespace org { -namespace openbmc_project +namespace open_power { -namespace Common +namespace OCC { -namespace File +namespace Device { -namespace _Seek +namespace _OpenFailure { -struct OFFSET + +} // namespace _OpenFailure + +struct OpenFailure { - static constexpr auto str = "OFFSET=%ll"; - static constexpr auto str_short = "OFFSET"; - using type = std::tuple,int64_t>; - explicit constexpr OFFSET(int64_t a) : _entry(entry(str, a)) {}; - type _entry; + static constexpr auto L = level::ERR; + using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; + using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; + using metadata_types = std::tuple; + }; -struct WHENCE + +} // namespace Device +} // namespace OCC +} // namespace open_power +} // namespace org + + +namespace details { - static constexpr auto str = "WHENCE=%d"; - static constexpr auto str_short = "WHENCE"; - using type = std::tuple,int32_t>; - explicit constexpr WHENCE(int32_t a) : _entry(entry(str, a)) {}; - type _entry; + +template <> +struct map_exception_type +{ + using type = org::open_power::OCC::Device::OpenFailure; }; -struct ERRNO + +} + +namespace org { - static constexpr auto str = "ERRNO=%d"; - static constexpr auto str_short = "ERRNO"; - using type = std::tuple,int32_t>; - explicit constexpr ERRNO(int32_t a) : _entry(entry(str, a)) {}; - type _entry; +namespace open_power +{ +namespace OCC +{ +namespace Device +{ +namespace _ReadFailure +{ + + +} // namespace _ReadFailure + +struct ReadFailure +{ + static constexpr auto L = level::ERR; + using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; + using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; + using metadata_types = std::tuple; + }; -struct PATH + +} // namespace Device +} // namespace OCC +} // namespace open_power +} // namespace org + + +namespace details { - static constexpr auto str = "PATH=%s"; - static constexpr auto str_short = "PATH"; - using type = std::tuple,const char*>; - explicit constexpr PATH(const char* a) : _entry(entry(str, a)) {}; - type _entry; + +template <> +struct map_exception_type +{ + using type = org::open_power::OCC::Device::ReadFailure; }; -} // namespace _Seek +} -struct Seek : public sdbusplus::exception_t +namespace org +{ +namespace open_power +{ +namespace OCC +{ +namespace Device +{ +namespace _WriteFailure { - static constexpr auto errName = "xyz.openbmc_project.Common.File.Seek"; - static constexpr auto errDesc = "Failed to seek a file"; - static constexpr auto L = level::INFO; - using OFFSET = _Seek::OFFSET; - using WHENCE = _Seek::WHENCE; - using ERRNO = _Seek::ERRNO; - using PATH = _Seek::PATH; - using metadata_types = std::tuple; - const char* name() const noexcept - { - return errName; - } - const char* description() const noexcept - { - return errDesc; - } +} // namespace _WriteFailure + +struct WriteFailure +{ + static constexpr auto L = level::ERR; + using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; + using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; -} // namespace File -} // namespace Common -} // namespace openbmc_project -} // namespace xyz +} // namespace Device +} // namespace OCC +} // namespace open_power +} // namespace org namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = xyz::openbmc_project::Common::File::Seek; + using type = org::open_power::OCC::Device::WriteFailure; }; } -namespace xyz +namespace org { -namespace openbmc_project +namespace open_power { -namespace State +namespace OCC { -namespace Host +namespace Device { -namespace _SoftOffTimeout +namespace _ConfigFailure { -} // namespace _SoftOffTimeout +} // namespace _ConfigFailure -struct SoftOffTimeout : public sdbusplus::exception_t +struct ConfigFailure { - static constexpr auto errName = "xyz.openbmc_project.State.Host.SoftOffTimeout"; - static constexpr auto errDesc = "Host did not shutdown within configured time."; - static constexpr auto L = level::INFO; - using TIMEOUT_IN_MSEC = xyz::openbmc_project::Common::Timeout::TIMEOUT_IN_MSEC; - using metadata_types = std::tuple; - - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } + static constexpr auto L = level::ERR; + using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; + using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; + using metadata_types = std::tuple; - const char* what() const noexcept - { - return errName; - } }; -} // namespace Host -} // namespace State -} // namespace openbmc_project -} // namespace xyz +} // namespace Device +} // namespace OCC +} // namespace open_power +} // namespace org namespace details { template <> -struct map_exception_type +struct map_exception_type { - using type = xyz::openbmc_project::State::Host::SoftOffTimeout; + using type = org::open_power::OCC::Device::ConfigFailure; }; } @@ -1626,29 +1372,13 @@ namespace _ReadFailure } // namespace _ReadFailure -struct ReadFailure : public sdbusplus::exception_t +struct ReadFailure { - static constexpr auto errName = "xyz.openbmc_project.Sensor.Device.ReadFailure"; - static constexpr auto errDesc = "Failed to read from device."; - static constexpr auto L = level::INFO; + static constexpr auto L = level::ERR; using CALLOUT_ERRNO = xyz::openbmc_project::Common::Callout::Device::CALLOUT_ERRNO; using CALLOUT_DEVICE_PATH = xyz::openbmc_project::Common::Callout::Device::CALLOUT_DEVICE_PATH; using metadata_types = std::tuple; - const char* name() const noexcept - { - return errName; - } - - const char* description() const noexcept - { - return errDesc; - } - - const char* what() const noexcept - { - return errName; - } }; } // namespace Device @@ -1745,6 +1475,64 @@ struct TestErrorOne : public sdbusplus::exception_t +namespace example +{ +namespace xyz +{ +namespace openbmc_project +{ +namespace Example +{ +namespace Elog +{ +namespace _TestCallout +{ + +struct DEV_ADDR +{ + static constexpr auto str = "DEV_ADDR=0x%.8X"; + static constexpr auto str_short = "DEV_ADDR"; + using type = std::tuple,uint32_t>; + explicit constexpr DEV_ADDR(uint32_t a) : _entry(entry(str, a)) {}; + type _entry; +}; + +} // namespace _TestCallout + +struct TestCallout : public sdbusplus::exception_t +{ + static constexpr auto errName = "example.xyz.openbmc_project.Example.Elog.TestCallout"; + static constexpr auto errDesc = "This is test error TestCallout"; + static constexpr auto L = level::ERR; + using DEV_ADDR = _TestCallout::DEV_ADDR; + using CALLOUT_ERRNO_TEST = example::xyz::openbmc_project::Example::Device::Callout::CALLOUT_ERRNO_TEST; + using CALLOUT_DEVICE_PATH_TEST = example::xyz::openbmc_project::Example::Device::Callout::CALLOUT_DEVICE_PATH_TEST; + using metadata_types = std::tuple; + + const char* name() const noexcept + { + return errName; + } + + const char* description() const noexcept + { + return errDesc; + } + + const char* what() const noexcept + { + return errName; + } +}; + +} // namespace Elog +} // namespace Example +} // namespace openbmc_project +} // namespace xyz +} // namespace example + + + namespace example { namespace xyz diff --git a/occ_device.hpp b/occ_device.hpp index dc057be..6538597 100644 --- a/occ_device.hpp +++ b/occ_device.hpp @@ -2,6 +2,8 @@ #include #include +#include "occ_events.hpp" +#include "occ_errors.hpp" #include "config.h" namespace open_power { @@ -25,10 +27,16 @@ class Device /** @brief Constructs the Device object * - * @param[in] name - OCC instance name + * @param[in] event - Unique ptr reference to sd_event + * @param[in] name - OCC instance name + * @param[in] callback - Optional callback on errors */ - Device(const std::string& name) : - config(name + '-' + "dev0") + Device(EventPtr& event, + const std::string& name, + std::function callBack = nullptr) : + config(name + '-' + "dev0"), + errorFile(fs::path(config) / "occ_error"), + error(event, errorFile, callBack) { // Nothing to do here } @@ -36,20 +44,38 @@ class Device /** @brief Binds device to the OCC driver */ inline void bind() { + // Bind the device return write(bindPath, config); } /** @brief Un-binds device from the OCC driver */ inline void unBind() { - return write(unBindPath, config); + // Unbind the device + return write(unBindPath, config); + } + + /** @brief Starts to monitor for errors */ + inline void addErrorWatch() + { + return error.addWatch(); + } + + /** @brief stops monitoring for errors */ + inline void removeErrorWatch() + { + return error.removeWatch(); } private: /** @brief Config value to be used to do bind and unbind */ const std::string config; + /** @brief This file contains 0 for success, non-zero for errors */ + const fs::path errorFile; + /** @brief To bind the device to the OCC driver, do: + * * Write occ<#>-dev0 to: /sys/bus/platform/drivers/occ-hwmon/bind */ static fs::path bindPath; @@ -59,6 +85,9 @@ class Device */ static fs::path unBindPath; + /** Abstraction of error monitoring */ + Error error; + /** @brief file writer to achieve bind and unbind * * @param[in] filename - Name of file to be written diff --git a/occ_errors.cpp b/occ_errors.cpp new file mode 100644 index 0000000..f2da49f --- /dev/null +++ b/occ_errors.cpp @@ -0,0 +1,145 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "occ_errors.hpp" +#include "elog-errors.hpp" +namespace open_power +{ +namespace occ +{ + +// Value in error file indicating success +constexpr auto NO_ERROR = '0'; + +using namespace phosphor::logging; +using namespace sdbusplus::org::open_power::OCC::Device::Error; +using InternalFailure = sdbusplus::xyz::openbmc_project::Common:: + Error::InternalFailure; + +// Populate the file descriptor on the error file +void Error::openFile() +{ + using namespace phosphor::logging; + + fd = open(file.c_str(), O_RDONLY | O_NONBLOCK); + if (fd < 0) + { + elog( + phosphor::logging::org::open_power::OCC::Device:: + OpenFailure::CALLOUT_ERRNO(errno), + phosphor::logging::org::open_power::OCC::Device:: + OpenFailure::CALLOUT_DEVICE_PATH(file.c_str())); + } +} + +// Attaches the FD to event loop and registers the callback handler +void Error::registerCallBack() +{ + decltype(eventSource.get()) sourcePtr = nullptr; + auto r = sd_event_add_io(event.get(), &sourcePtr, fd, + EPOLLIN, processEvents, this); + eventSource.reset(sourcePtr); + + if (r < 0) + { + log("Failed to register callback handler", + entry("ERROR=%s", strerror(-r))); + elog(); + } +} + +// Starts to watch for errors +void Error::addWatch() +{ + // Open the file + openFile(); + + // register the callback handler + registerCallBack(); +} + +// Stops watching for errors +void Error::removeWatch() +{ + // Close the file + if (fd >= 0) + { + close(fd); + } + + // Reduce the reference count. Since there is only one instances + // of add_io, this will result empty loop + eventSource.reset(); +} + +// Callback handler when there is an activity on the FD +int Error::processEvents(sd_event_source* es, int fd, + uint32_t revents, void* userData) +{ + log("Error file updated"); + auto error = static_cast(userData); + + error->analyzeEvent(); + return 0; +} + +// Reads the error file and analyzes the data +void Error::analyzeEvent() +{ + // Get the number of bytes to read + int len = -1; + auto r = ioctl(fd, FIONREAD, &len); + if (r < 0) + { + elog( + phosphor::logging::org::open_power::OCC::Device:: + ConfigFailure::CALLOUT_ERRNO(errno), + phosphor::logging::org::open_power::OCC::Device:: + ConfigFailure::CALLOUT_DEVICE_PATH(file.c_str())); + } + + // A non-zero data indicates an error condition + // Let the caller take appropriate action on this + auto data = readFile(len); + if (data.empty() || + data.front() == NO_ERROR) + { + return; + } + + // This must be an error + if (callBack) + { + callBack(); + } + return; +} + +// Reads so many bytes as passed in +std::string Error::readFile(int len) const +{ + auto data = std::make_unique(len+1); + + // This file get created soon after binding. A value of 0 is + // deemed success and anything else is a Failure + // Since all the sysfs files would have size of 4096, if we read 0 + // bytes -or- value '0', then it just means we are fine + auto r = read(fd, data.get(), len); + if (r < 0) + { + elog( + phosphor::logging::org::open_power::OCC::Device:: + ReadFailure::CALLOUT_ERRNO(errno), + phosphor::logging::org::open_power::OCC::Device:: + ReadFailure::CALLOUT_DEVICE_PATH(file.c_str())); + } + return std::string(data.get()); +} + +} // namespace occ +} // namespace open_power diff --git a/occ_errors.hpp b/occ_errors.hpp new file mode 100644 index 0000000..1e66ffc --- /dev/null +++ b/occ_errors.hpp @@ -0,0 +1,107 @@ +#pragma once + +#include +#include +#include +#include "occ_events.hpp" +#include "config.h" +namespace open_power +{ +namespace occ +{ + +namespace fs = std::experimental::filesystem; + +/** @class Error + * @brief Monitors for OCC device error condition + */ +class Error +{ + public: + Error() = delete; + Error(const Error&) = delete; + Error& operator=(const Error&) = delete; + Error(Error&&) = default; + Error& operator=(Error&&) = default; + + /** @brief Constructs the Error object + * + * @param[in] event - reference to sd_event unique_ptr + * @param[in] file - File used by driver to communicate errors + * @param[in] callBack - Optional function callback on error condition + */ + Error(EventPtr& event, + const fs::path& file, + std::function callBack = nullptr) : + event(event), + file(fs::path(DEV_PATH) / file), + callBack(callBack) + { + // Nothing to do here. + } + + ~Error() + { + if (fd>= 0) + { + close(fd); + } + } + + /** @brief Starts to monitor for error conditions */ + void addWatch(); + + /** @brief Removes error watch */ + void removeWatch(); + + private: + /** @brief sd_event wrapped in unique_ptr */ + EventPtr& event; + + /** @brief event source wrapped in unique_ptr */ + EventSourcePtr eventSource; + + /** Error file */ + const fs::path file; + + /** @brief Optional function to call on error scenario */ + std::function callBack; + + /** @brief File descriptor to watch for errors */ + int fd = -1; + + /** @brief attaches FD to events and sets up callback handler */ + void registerCallBack(); + + /** @brief Opens the file and populates fd */ + void openFile(); + + /** @brief Reads file data + * + * @return data read. Since its a /sysfs entry, + * it would be a string + */ + std::string readFile(int) const; + + /** @brief Callback handler when the FD has some activity on it + * + * @param[in] es - Populated event source + * @param[in] fd - Associated File descriptor + * @param[in] revents - Type of event + * @param[in] userData - User data that was passed during registration + * + * @return - 0 or positive number on success and negative + * errno otherwise + */ + static int processEvents(sd_event_source* es, int fd, + uint32_t revents, void* userData); + + /** @brief When the error event is received, analyzes it + * and makes a callback to error handler if the + * content denotes an error condition + */ + void analyzeEvent(); +}; + +} // namespace occ +} // namespace open_power diff --git a/occ_events.hpp b/occ_events.hpp new file mode 100644 index 0000000..cc6f616 --- /dev/null +++ b/occ_events.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include +namespace open_power +{ +namespace occ +{ + +/* Need a custom deleter for freeing up sd_event */ +struct EventDeleter +{ + void operator()(sd_event* event) const + { + event = sd_event_unref(event); + } +}; +using EventPtr = std::unique_ptr; + +/* Need a custom deleter for freeing up sd_event_source */ +struct EventSourceDeleter +{ + void operator()(sd_event_source* eventSource) const + { + eventSource = sd_event_source_unref(eventSource); + } +}; +using EventSourcePtr = std::unique_ptr; + +} // namespace occ +} // namespace open_power diff --git a/occ_manager.hpp b/occ_manager.hpp index 48cd9c8..4430d74 100644 --- a/occ_manager.hpp +++ b/occ_manager.hpp @@ -32,10 +32,14 @@ struct Manager /** @brief Adds OCC pass-through and status objects on the bus * when corresponding CPU inventory is created. - * @param[in] bus - handle to the bus + * + * @param[in] bus - handle to the bus + * @param[in] event - Unique ptr reference to sd_event */ - Manager(sdbusplus::bus::bus& bus): - bus(bus) + Manager(sdbusplus::bus::bus& bus, + EventPtr& event) : + bus(bus), + event(event) { for (auto id = 0; id < MAX_CPUS; ++id) { @@ -50,7 +54,7 @@ struct Manager } /** @brief Callback that responds to cpu creation in the inventory - - * by creating the occ passthrough and status objects. + * by creating the needed objects. * * @param[in] msg - bus message * @@ -78,6 +82,7 @@ struct Manager statusObjects.emplace_back( std::make_unique( bus, + event, path.c_str())); // Create the power cap monitor object for master occ (0) @@ -94,6 +99,9 @@ struct Manager /** @brief reference to the bus */ sdbusplus::bus::bus& bus; + /** @brief reference to sd_event wrapped in unique_ptr */ + EventPtr& event; + /** @brief OCC pass-through objects */ std::vector> passThroughObjects; diff --git a/occ_pass_through.cpp b/occ_pass_through.cpp index fbb98c2..2846dda 100644 --- a/occ_pass_through.cpp +++ b/occ_pass_through.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include "occ_pass_through.hpp" #include "elog-errors.hpp" namespace open_power @@ -25,7 +25,7 @@ PassThrough::PassThrough( int PassThrough::openDevice() { using namespace phosphor::logging; - using namespace sdbusplus::org::open_power::OCC::PassThrough::Error; + using namespace sdbusplus::org::open_power::OCC::Device::Error; // Device instance number starts from 1. devicePath.append(std::to_string((this->path.back() - '0') + 1)); @@ -35,9 +35,9 @@ int PassThrough::openDevice() { // This would log and terminate since its not handled. elog( - phosphor::logging::org::open_power::OCC::PassThrough:: + phosphor::logging::org::open_power::OCC::Device:: OpenFailure::CALLOUT_ERRNO(errno), - phosphor::logging::org::open_power::OCC::PassThrough:: + phosphor::logging::org::open_power::OCC::Device:: OpenFailure::CALLOUT_DEVICE_PATH(devicePath.c_str())); } return fd; @@ -46,7 +46,7 @@ int PassThrough::openDevice() std::vector PassThrough::send(std::vector command) { using namespace phosphor::logging; - using namespace sdbusplus::org::open_power::OCC::PassThrough::Error; + using namespace sdbusplus::org::open_power::OCC::Device::Error; std::vector response {}; @@ -65,9 +65,9 @@ std::vector PassThrough::send(std::vector command) { // This would log and terminate since its not handled. elog( - phosphor::logging::org::open_power::OCC::PassThrough:: + phosphor::logging::org::open_power::OCC::Device:: WriteFailure::CALLOUT_ERRNO(errno), - phosphor::logging::org::open_power::OCC::PassThrough:: + phosphor::logging::org::open_power::OCC::Device:: WriteFailure::CALLOUT_DEVICE_PATH(devicePath.c_str())); } @@ -95,9 +95,9 @@ std::vector PassThrough::send(std::vector command) { // This would log and terminate since its not handled. elog( - phosphor::logging::org::open_power::OCC::PassThrough:: + phosphor::logging::org::open_power::OCC::Device:: ReadFailure::CALLOUT_ERRNO(errno), - phosphor::logging::org::open_power::OCC::PassThrough:: + phosphor::logging::org::open_power::OCC::Device:: ReadFailure::CALLOUT_DEVICE_PATH(devicePath.c_str())); } } diff --git a/occ_status.cpp b/occ_status.cpp index ca8a1f9..83825c5 100644 --- a/occ_status.cpp +++ b/occ_status.cpp @@ -13,15 +13,28 @@ bool Status::occActive(bool value) { // Bind the device device.bind(); + + // And watch for errors + device.addErrorWatch(); } else { - // Do the unbind + // Stop watching for errors + device.removeErrorWatch(); + + // Do the unbind. device.unBind(); } } return Base::Status::occActive(value); } +// Callback handler when a device error is reported. +void Status::deviceErrorHandler() +{ + // This would deem OCC inactive + this->occActive(false); +} + } // namespace occ } // namespace open_power diff --git a/occ_status.hpp b/occ_status.hpp index 5d092b7..f426048 100644 --- a/occ_status.hpp +++ b/occ_status.hpp @@ -3,6 +3,7 @@ #include #include #include +#include "occ_events.hpp" #include "occ_device.hpp" namespace open_power { @@ -25,15 +26,18 @@ class Status : public Interface Status(Status&&) = default; Status& operator=(Status&&) = default; - /** @brief Constructs the Status object + /** @brief Constructs the Status object and + * the underlying device object * * @param[in] bus - DBus bus to attach to * @param[in] path - DBus object path */ - Status(sdbusplus::bus::bus& bus, const char* path) + Status(sdbusplus::bus::bus& bus, EventPtr& event, const char* path) : Interface(bus, path), path(path), - device(name + std::to_string((this->path.back() - '0') + 1)) + device(event, + name + std::to_string((this->path.back() - '0') + 1), + std::bind(&Status::deviceErrorHandler, this)) { // Nothing to do here } @@ -61,6 +65,9 @@ class Status : public Interface /** @brief OCC device object to do bind and unbind */ Device device; + + /** @brief Callback handler when device errors are detected */ + void deviceErrorHandler(); }; } // namespace occ diff --git a/org/open_power/OCC/Device.errors.yaml b/org/open_power/OCC/Device.errors.yaml new file mode 100644 index 0000000..9e8d09a --- /dev/null +++ b/org/open_power/OCC/Device.errors.yaml @@ -0,0 +1,15 @@ +# org.open_power.OCC.Device.OpenFailure +- name: OpenFailure + description: Opening OCC device failed. + +# org.open_power.OCC.Device.ReadFailure +- name: ReadFailure + description: Reading from OCC failed. + +# org.open_power.OCC.Device.WriteFailure +- name: WriteFailure + description: Writing to OCC failed. + +# org.open_power.OCC.Device.ConfigFailure +- name: ConfigFailure + description: Configuring device failed. diff --git a/org/open_power/OCC/Device.metadata.yaml b/org/open_power/OCC/Device.metadata.yaml new file mode 100644 index 0000000..ee79e2d --- /dev/null +++ b/org/open_power/OCC/Device.metadata.yaml @@ -0,0 +1,15 @@ +- name: OpenFailure + inherits: + - xyz.openbmc_project.Common.Callout.Device + +- name: ReadFailure + inherits: + - xyz.openbmc_project.Common.Callout.Device + +- name: WriteFailure + inherits: + - xyz.openbmc_project.Common.Callout.Device + +- name: ConfigFailure + inherits: + - xyz.openbmc_project.Common.Callout.Device diff --git a/org/open_power/OCC/PassThrough.errors.yaml b/org/open_power/OCC/PassThrough.errors.yaml deleted file mode 100644 index 4be6325..0000000 --- a/org/open_power/OCC/PassThrough.errors.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# org.open_power.OCC.PassThrough.OpenFailure -- name: OpenFailure - description: Opening OCC device failed. - -# org.open_power.OCC.PassThrough.ReadFailure -- name: ReadFailure - description: Reading from OCC failed. - -# org.open_power.OCC.PassThrough.WriteFailure -- name: WriteFailure - description: Writing to OCC failed. diff --git a/org/open_power/OCC/PassThrough.metadata.yaml b/org/open_power/OCC/PassThrough.metadata.yaml deleted file mode 100644 index 0b1c4f5..0000000 --- a/org/open_power/OCC/PassThrough.metadata.yaml +++ /dev/null @@ -1,11 +0,0 @@ -- name: OpenFailure - inherits: - - xyz.openbmc_project.Common.Callout.Device - -- name: ReadFailure - inherits: - - xyz.openbmc_project.Common.Callout.Device - -- name: WriteFailure - inherits: - - xyz.openbmc_project.Common.Callout.Device diff --git a/test/Makefile.am b/test/Makefile.am index 6022c65..a680245 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -13,8 +13,11 @@ utest_LDFLAGS = -lgtest_main -lgtest \ $(SYSTEMD_LIBS) \ ${SDBUSPLUS_LIBS} \ $(OPENPOWER_DBUS_INTERFACES_LIBS) \ + $(PHOSPHOR_DBUS_INTERFACES_LIBS) \ -lstdc++fs utest_SOURCES = utest.cpp utest_LDADD = $(top_builddir)/powercap.o \ $(top_builddir)/occ_status.o \ - $(top_builddir)/occ_device.o + $(top_builddir)/occ_device.o \ + $(top_builddir)/occ_errors.o \ + $(top_builddir)/org/open_power/OCC/Device/error.o diff --git a/test/utest.cpp b/test/utest.cpp index e99d996..44691c2 100644 --- a/test/utest.cpp +++ b/test/utest.cpp @@ -1,4 +1,5 @@ #include +#include #include "powercap.hpp" using namespace open_power::occ; @@ -8,13 +9,22 @@ class VerifyOccInput : public ::testing::Test public: VerifyOccInput() : bus(sdbusplus::bus::new_default()), - occStatus(bus,"/test/path"), + rc(sd_event_default(&event)), + eventP(event), + occStatus(bus, eventP, "/test/path"), pcap(bus,occStatus) - {} + { + EXPECT_GE(rc, 0); + event = nullptr; + } ~VerifyOccInput() {} sdbusplus::bus::bus bus; + sd_event* event; + int rc; + open_power::occ::EventPtr eventP; + Status occStatus; powercap::PowerCap pcap; }; -- cgit v1.2.1