blob: 3228ff64810e6abe8c4095ac3e49028d5a80bf92 [file] [log] [blame]
Ben Tynerb1ebfcb2020-05-08 18:52:48 -05001#pragma once
2
Ben Tyner1b1915e2020-10-23 15:13:38 -05003#include <util/ffdc_file.hpp>
4
Ben Tynerb1ebfcb2020-05-08 18:52:48 -05005#include <cstddef> // for size_t
6#include <map>
7#include <string>
Ben Tyner1b1915e2020-10-23 15:13:38 -05008#include <vector>
Ben Tynerb1ebfcb2020-05-08 18:52:48 -05009
10namespace attn
11{
Patrick Williams27dd6362023-05-10 07:51:20 -050012constexpr auto pathLogging = "/xyz/openbmc_project/logging";
Ben Tyner188f1092021-02-01 09:33:06 -060013constexpr auto levelPelError = "xyz.openbmc_project.Logging.Entry.Level.Error";
Ben Tyner90516852022-12-14 21:04:18 -060014constexpr auto levelPelInfo =
15 "xyz.openbmc_project.Logging.Entry.Level.Informational";
Ben Tyner188f1092021-02-01 09:33:06 -060016constexpr auto eventPelTerminate = "xyz.open_power.Attn.Error.Terminate";
17
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050018/** @brief Logging event types */
19enum class EventType
20{
Patrick Williams27dd6362023-05-10 07:51:20 -050021 Checkstop = 0,
22 Terminate = 1,
23 Vital = 2,
24 HwDiagsFail = 3,
Ben Tynerb9715172021-09-29 08:46:19 -050025 AttentionFail = 4,
26 PhalSbeChipop = 5
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050027};
28
Ben Tynerf5210bb2021-01-05 12:58:10 -060029/** @brief Commit special attention TI event to log */
30void eventTerminate(std::map<std::string, std::string> i_additionalData,
31 char* i_tiInfoData);
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050032
Ben Tyner90516852022-12-14 21:04:18 -060033/** @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 * */
39uint32_t eventVital(std::string severity);
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050040
Ben Tynerf5210bb2021-01-05 12:58:10 -060041/** @brief Commit attention handler failure event to log */
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050042void eventAttentionFail(int i_error);
43
Ben Tynerb1ebfcb2020-05-08 18:52:48 -050044} // namespace attn