diff options
author | Jayanth Othayoth <ojayanth@in.ibm.com> | 2017-07-02 06:29:24 -0500 |
---|---|---|
committer | Jayanth Othayoth <ojayanth@in.ibm.com> | 2017-07-18 07:41:44 -0500 |
commit | bcb174bd33a34d47f07dc814dd23fba28ca466f8 (patch) | |
tree | 6b6aca2513c0f5f95698912fa8da8628a24ccc47 /dump_manager.hpp | |
parent | 671fc7f3e3b7f3cad762ff68548fb18559fdf091 (diff) | |
download | phosphor-debug-collector-bcb174bd33a34d47f07dc814dd23fba28ca466f8.tar.gz phosphor-debug-collector-bcb174bd33a34d47f07dc814dd23fba28ca466f8.zip |
Add support for user initiated BMC Dump
Added support for creating new dump entry d-bus objects for
user request dump.
Change-Id: I31d2f478418e312e0aa6cc321a885498cf6ec6d6
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
Diffstat (limited to 'dump_manager.hpp')
-rw-r--r-- | dump_manager.hpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/dump_manager.hpp b/dump_manager.hpp index b4c09c1..55947b2 100644 --- a/dump_manager.hpp +++ b/dump_manager.hpp @@ -9,6 +9,8 @@ #include "xyz/openbmc_project/Dump/Internal/Create/server.hpp" #include "dump_entry.hpp" #include "dump_utils.hpp" +#include "watch.hpp" +#include "config.h" namespace phosphor { @@ -21,6 +23,8 @@ class Manager; } // namespace internal +using UserMap = phosphor::dump::inotify::UserMap; + using Type = sdbusplus::xyz::openbmc_project::Dump::Internal::server::Create::Type; @@ -57,7 +61,16 @@ class Manager : public CreateIface CreateIface(bus, path), bus(bus), eventLoop(event.get()), - lastEntryId(0) + lastEntryId(0), + dumpWatch(eventLoop, + IN_NONBLOCK, + IN_CLOSE_WRITE, + EPOLLIN, + BMC_DUMP_FILE_DIR, + std::bind( + std::mem_fn( + &phosphor::dump::Manager::watchCallback), + this, std::placeholders::_1)) {} /** @brief Implementation for CreateDump @@ -67,6 +80,11 @@ class Manager : public CreateIface */ uint32_t createDump() override; + /** @brief Implementation of dump watch call back + * @param [in] fileInfo - map of file info path:event + */ + void watchCallback(const UserMap& fileInfo); + private: /** @brief Create Dump entry d-bus object * @param[in] fullPath - Full path of the Dump file name @@ -117,6 +135,9 @@ class Manager : public CreateIface /** @brief Id of the last Dump entry */ uint32_t lastEntryId; + + /** @brief Dump watch object */ + phosphor::dump::inotify::Watch dumpWatch; }; } // namespace dump |