blob: 3b91842929e4940d4bab287287970f1de1c39f6f [file] [log] [blame]
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -05001#include "config.h"
2
3#include "dump-extensions.hpp"
4
Dhruvaraj Subhashchandran796a92e2021-05-05 13:15:24 -05005#include "dump-extensions/openpower-dumps/openpower_dumps_config.h"
6
Dhruvaraj Subhashchandran4a959842021-09-30 02:55:52 -05007#include "com/ibm/Dump/Entry/Hardware/server.hpp"
8#include "com/ibm/Dump/Entry/Hostboot/server.hpp"
9#include "com/ibm/Dump/Entry/SBE/server.hpp"
10#include "dump_manager_hostdump.hpp"
Dhruvaraj Subhashchandran62337a92020-11-22 21:24:30 -060011#include "dump_manager_resource.hpp"
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -050012#include "dump_manager_system.hpp"
Dhruvaraj Subhashchandran4a959842021-09-30 02:55:52 -050013#include "dump_utils.hpp"
14#include "host_dump_entry.hpp"
15
16#include <fmt/core.h>
17
18#include <phosphor-logging/log.hpp>
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -050019
20namespace phosphor
21{
22namespace dump
23{
24
Dhruvaraj Subhashchandran4a959842021-09-30 02:55:52 -050025using namespace phosphor::logging;
26void loadExtensions(sdbusplus::bus::bus& bus,
27 const phosphor::dump::EventPtr& event,
28 DumpManagerList& dumpList)
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -050029{
Dhruvaraj Subhashchandran341d6832021-01-15 06:28:04 -060030 dumpList.push_back(std::make_unique<openpower::dump::system::Manager>(
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -050031 bus, SYSTEM_DUMP_OBJPATH, SYSTEM_DUMP_OBJ_ENTRY));
Dhruvaraj Subhashchandran341d6832021-01-15 06:28:04 -060032 dumpList.push_back(std::make_unique<openpower::dump::resource::Manager>(
Dhruvaraj Subhashchandran62337a92020-11-22 21:24:30 -060033 bus, RESOURCE_DUMP_OBJPATH, RESOURCE_DUMP_OBJ_ENTRY));
Dhruvaraj Subhashchandran4a959842021-09-30 02:55:52 -050034
35 try
36 {
37 std::filesystem::create_directories(HOSTBOOT_DUMP_PATH);
38 }
39 catch (std::exception& e)
40 {
41 log<level::ERR>(
42 fmt::format("Failed to create hostboot dump directory({})",
43 HOSTBOOT_DUMP_PATH)
44 .c_str());
45 throw std::runtime_error("Failed to create hostboot dump directory");
46 }
47 dumpList.push_back(std::make_unique<openpower::dump::hostdump::Manager<
48 sdbusplus::com::ibm::Dump::Entry::server::Hostboot>>(
49 bus, event, HOSTBOOT_DUMP_OBJPATH, HOSTBOOT_DUMP_OBJ_ENTRY,
50 HOSTBOOT_DUMP_PATH, "hbdump", HOSTBOOT_DUMP_TMP_FILE_DIR,
51 HOSTBOOT_DUMP_MAX_SIZE, HOSTBOOT_DUMP_MIN_SPACE_REQD,
52 HOSTBOOT_DUMP_TOTAL_SIZE));
Dhruvaraj Subhashchandran8b9b4692020-09-24 11:59:42 -050053}
54} // namespace dump
55} // namespace phosphor