blob: 700097f7bd4bc34eb464b83b91a9f8973af06566 [file] [log] [blame]
Ben Tyner188f1092021-02-01 09:33:06 -06001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include <util/ffdc_file.hpp>
5
6#include <string>
7
8namespace attn
9{
10
Ben Tyner4bbcb382021-02-22 09:29:00 -060011enum class HostRunningState
12{
13 Unknown,
14 NotStarted,
15 Started
16};
17
Ben Tyner188f1092021-02-01 09:33:06 -060018/**
19 * Create a PEL for the specified event type
20 *
21 * The additional data provided in the map will be placed in a user data
22 * section of the PEL and may additionally contain key words to trigger
23 * certain behaviors by the backend logging code. Each set of data described
24 * in the vector of ffdc data will be placed in additional user data
25 * sections.
26 *
27 * @param i_event - the event type
28 * @param i_additional - map of additional data
29 * @param i_ffdc - vector of ffdc data
30 * @return Platform log id or 0 if error
31 */
32uint32_t createPel(const std::string& i_event,
33 std::map<std::string, std::string>& i_additional,
34 const std::vector<util::FFDCTuple>& i_ffdc);
35
36/**
37 * Create a PEL from raw PEL data
38 *
39 * Create a PEL based on the pel defined in the data buffer specified.
40 *
41 * @param i_buffer - buffer containing a raw PEL
42 */
43void createPelRaw(const std::vector<uint8_t>& i_buffer);
44
45/**
46 * Get file descriptor of exisitng PEL
47 *
48 * The backend logging code will search for a PEL having the provided pel id
49 * and return a file descriptor of a file containing this pel in raw form.
50 *
51 * @param i_pelid - the PEL ID
52 * @return file descriptor or -1 if error
53 */
54int getPel(const uint32_t i_pelId);
55
Ben Tyner4bbcb382021-02-22 09:29:00 -060056/**
57 * Get the host running state
58 *
59 * Use host boot progress to determine if a host has been started. If host
60 * boot progress can not be determined then host state will be unknown.
61 *
62 * @return HostType == "Unknown", "Started or "NotStarted"
63 */
64HostRunningState hostRunningState();
65
Ben Tyner188f1092021-02-01 09:33:06 -060066} // namespace attn