Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "dump_manager.hpp" |
| 4 | #include "dump_utils.hpp" |
| 5 | #include "xyz/openbmc_project/Dump/NewDump/server.hpp" |
| 6 | |
| 7 | #include <sdbusplus/bus.hpp> |
| 8 | #include <sdbusplus/server/object.hpp> |
Dhruvaraj Subhashchandran | 7040bce | 2020-09-16 00:50:19 -0500 | [diff] [blame] | 9 | #include <xyz/openbmc_project/Dump/Create/server.hpp> |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 10 | |
| 11 | namespace phosphor |
| 12 | { |
| 13 | namespace dump |
| 14 | { |
| 15 | namespace system |
| 16 | { |
| 17 | |
| 18 | using NotifyIface = sdbusplus::server::object::object< |
Dhruvaraj Subhashchandran | 7040bce | 2020-09-16 00:50:19 -0500 | [diff] [blame] | 19 | sdbusplus::xyz::openbmc_project::Dump::server::Create, |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 20 | sdbusplus::xyz::openbmc_project::Dump::server::NewDump>; |
| 21 | |
| 22 | /** @class Manager |
| 23 | * @brief System Dump manager implementation. |
| 24 | * @details A concrete implementation for the |
| 25 | * xyz.openbmc_project.Dump.Notify DBus API |
| 26 | */ |
| 27 | class Manager : virtual public NotifyIface, |
| 28 | virtual public phosphor::dump::Manager |
| 29 | { |
| 30 | public: |
| 31 | Manager() = delete; |
| 32 | Manager(const Manager&) = default; |
| 33 | Manager& operator=(const Manager&) = delete; |
| 34 | Manager(Manager&&) = delete; |
| 35 | Manager& operator=(Manager&&) = delete; |
| 36 | virtual ~Manager() = default; |
| 37 | |
| 38 | /** @brief Constructor to put object onto bus at a dbus path. |
| 39 | * @param[in] bus - Bus to attach to. |
| 40 | * @param[in] event - Dump manager sd_event loop. |
| 41 | * @param[in] path - Path to attach at. |
| 42 | * @param[in] baseEntryPath - Base path of the dump entry. |
| 43 | */ |
| 44 | Manager(sdbusplus::bus::bus& bus, const char* path, |
| 45 | const std::string& baseEntryPath) : |
| 46 | NotifyIface(bus, path), |
| 47 | phosphor::dump::Manager(bus, path, baseEntryPath) |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | void restore() override |
| 52 | { |
| 53 | // TODO #2597 Implement the restore to restore the dump entries |
| 54 | // after the service restart. |
| 55 | } |
| 56 | |
| 57 | /** @brief Notify the system dump manager about creation of a new dump. |
| 58 | * @param[in] dumpType - Type of the Dump. |
| 59 | * @param[in] dumpId - Id from the source of the dump. |
| 60 | * @param[in] size - Size of the dump. |
| 61 | */ |
| 62 | void notify(NewDump::DumpType dumpType, uint32_t dumpId, |
| 63 | uint64_t size) override; |
Dhruvaraj Subhashchandran | 7040bce | 2020-09-16 00:50:19 -0500 | [diff] [blame] | 64 | |
| 65 | /** @brief Implementation for CreateDump |
| 66 | * Method to create Dump. |
| 67 | * |
| 68 | * @return id - The Dump entry id number. |
| 69 | */ |
| 70 | uint32_t createDump() override; |
Dhruvaraj Subhashchandran | fef66a9 | 2020-09-06 13:10:59 -0500 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | } // namespace system |
| 74 | } // namespace dump |
| 75 | } // namespace phosphor |