Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 1 | #include "system_dump_entry.hpp" |
| 2 | |
Ramesh Iyyar | 2279386 | 2020-12-04 04:03:03 -0600 | [diff] [blame] | 3 | #include "dump_utils.hpp" |
Ramesh Iyyar | 131994b | 2020-12-03 08:35:36 -0600 | [diff] [blame] | 4 | #include "host_transport_exts.hpp" |
Dhruvaraj Subhashchandran | ad50d42 | 2022-01-18 05:54:02 -0600 | [diff] [blame] | 5 | #include "op_dump_consts.hpp" |
Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 6 | |
Dhruvaraj Subhashchandran | 6a54d9a | 2020-12-17 22:24:37 -0600 | [diff] [blame] | 7 | #include <phosphor-logging/elog-errors.hpp> |
| 8 | #include <xyz/openbmc_project/Common/error.hpp> |
| 9 | |
Dhruvaraj Subhashchandran | 341d683 | 2021-01-15 06:28:04 -0600 | [diff] [blame] | 10 | namespace openpower |
Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 11 | { |
| 12 | namespace dump |
| 13 | { |
| 14 | namespace system |
| 15 | { |
Dhruvaraj Subhashchandran | 4c63ce5 | 2020-12-18 02:07:22 -0600 | [diff] [blame] | 16 | // TODO #ibm-openbmc/issues/2859 |
| 17 | // Revisit host transport impelementation |
| 18 | // This value is used to identify the dump in the transport layer to host, |
| 19 | constexpr auto TRANSPORT_DUMP_TYPE_IDENTIFIER = 3; |
Dhruvaraj Subhashchandran | 6a54d9a | 2020-12-17 22:24:37 -0600 | [diff] [blame] | 20 | using namespace phosphor::logging; |
Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 21 | |
| 22 | void Entry::initiateOffload(std::string uri) |
| 23 | { |
| 24 | phosphor::dump::Entry::initiateOffload(uri); |
Dhruvaraj Subhashchandran | 59642e2 | 2020-03-19 03:37:44 -0500 | [diff] [blame] | 25 | phosphor::dump::host::requestOffload(sourceDumpId()); |
Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 26 | } |
| 27 | |
Ramesh Iyyar | 2279386 | 2020-12-04 04:03:03 -0600 | [diff] [blame] | 28 | void Entry::delete_() |
| 29 | { |
| 30 | auto srcDumpID = sourceDumpId(); |
| 31 | |
| 32 | // Remove Dump entry D-bus object |
| 33 | phosphor::dump::Entry::delete_(); |
| 34 | |
| 35 | // Remove host system dump when host is up by using source dump id |
| 36 | // which is present in system dump entry dbus object as a property. |
Dhruvaraj Subhashchandran | ad50d42 | 2022-01-18 05:54:02 -0600 | [diff] [blame] | 37 | if ((phosphor::dump::isHostRunning()) && (srcDumpID != INVALID_SOURCE_ID)) |
Ramesh Iyyar | 2279386 | 2020-12-04 04:03:03 -0600 | [diff] [blame] | 38 | { |
Dhruvaraj Subhashchandran | 4c63ce5 | 2020-12-18 02:07:22 -0600 | [diff] [blame] | 39 | phosphor::dump::host::requestDelete(srcDumpID, |
| 40 | TRANSPORT_DUMP_TYPE_IDENTIFIER); |
Ramesh Iyyar | 2279386 | 2020-12-04 04:03:03 -0600 | [diff] [blame] | 41 | } |
| 42 | } |
Dhruvaraj Subhashchandran | 69e6152 | 2020-02-04 06:39:11 -0600 | [diff] [blame] | 43 | } // namespace system |
| 44 | } // namespace dump |
Dhruvaraj Subhashchandran | 341d683 | 2021-01-15 06:28:04 -0600 | [diff] [blame] | 45 | } // namespace openpower |