Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Ben Tyner | 1b1915e | 2020-10-23 15:13:38 -0500 | [diff] [blame] | 3 | #include <util/ffdc_file.hpp> |
| 4 | |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 5 | #include <cstddef> // for size_t |
| 6 | #include <map> |
| 7 | #include <string> |
Ben Tyner | 1b1915e | 2020-10-23 15:13:38 -0500 | [diff] [blame] | 8 | #include <vector> |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 9 | |
| 10 | namespace attn |
| 11 | { |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 12 | constexpr auto pathLogging = "/xyz/openbmc_project/logging"; |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 13 | constexpr auto levelPelError = "xyz.openbmc_project.Logging.Entry.Level.Error"; |
Ben Tyner | 9051685 | 2022-12-14 21:04:18 -0600 | [diff] [blame] | 14 | constexpr auto levelPelInfo = |
| 15 | "xyz.openbmc_project.Logging.Entry.Level.Informational"; |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 16 | constexpr auto eventPelTerminate = "xyz.open_power.Attn.Error.Terminate"; |
| 17 | |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 18 | /** @brief Logging event types */ |
| 19 | enum class EventType |
| 20 | { |
Patrick Williams | 27dd636 | 2023-05-10 07:51:20 -0500 | [diff] [blame] | 21 | Checkstop = 0, |
| 22 | Terminate = 1, |
| 23 | Vital = 2, |
| 24 | HwDiagsFail = 3, |
Ben Tyner | b971517 | 2021-09-29 08:46:19 -0500 | [diff] [blame] | 25 | AttentionFail = 4, |
| 26 | PhalSbeChipop = 5 |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 27 | }; |
| 28 | |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 29 | /** @brief Commit special attention TI event to log */ |
| 30 | void eventTerminate(std::map<std::string, std::string> i_additionalData, |
| 31 | char* i_tiInfoData); |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 32 | |
Ben Tyner | 9051685 | 2022-12-14 21:04:18 -0600 | [diff] [blame] | 33 | /** @brief Commit SBE vital event to log |
| 34 | * |
| 35 | * @param[in] severity - the PEL severity level of the event |
| 36 | * |
| 37 | * @return platform event log (PEL) ID |
| 38 | * */ |
| 39 | uint32_t eventVital(std::string severity); |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 40 | |
Ben Tyner | f5210bb | 2021-01-05 12:58:10 -0600 | [diff] [blame] | 41 | /** @brief Commit attention handler failure event to log */ |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 42 | void eventAttentionFail(int i_error); |
| 43 | |
Ben Tyner | b1ebfcb | 2020-05-08 18:52:48 -0500 | [diff] [blame] | 44 | } // namespace attn |