-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
fw-log-data.h
90 lines (78 loc) · 1.77 KB
/
fw-log-data.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* License: Apache 2.0. See LICENSE file in root directory. */
/* Copyright(c) 2019 Intel Corporation. All Rights Reserved. */
#pragma once
#include <stdint.h>
#include <string>
#include <vector>
namespace fw_logger
{
struct fw_logs_binary_data
{
std::vector<uint8_t> logs_buffer;
};
typedef union
{
uint32_t value;
struct
{
uint32_t magic_number : 8;
uint32_t severity : 5;
uint32_t thread_id : 3;
uint32_t file_id : 11;
uint32_t group_id : 5;
} bits;
} fw_log_header_dword1;
typedef union
{
uint32_t value;
struct
{
uint32_t event_id : 16;
uint32_t line_id : 12;
uint32_t seq_id : 4;
} bits;
} fw_log_header_dword2;
struct fw_log_header_dword3
{
uint16_t p1;
uint16_t p2;
};
struct fw_log_header_dword4
{
uint32_t p3;
};
struct fw_log_header_dword5
{
uint32_t timestamp;
};
struct fw_log_binary
{
fw_log_header_dword1 dword1;
fw_log_header_dword2 dword2;
fw_log_header_dword3 dword3;
fw_log_header_dword4 dword4;
fw_log_header_dword5 dword5;
};
class fw_log_data
{
public:
fw_log_data(void);
~fw_log_data(void);
uint32_t magic_number;
uint32_t severity;
uint32_t file_id;
uint32_t group_id;
uint32_t event_id;
uint32_t line;
uint32_t sequence;
uint32_t p1;
uint32_t p2;
uint32_t p3;
uint64_t timestamp;
double delta;
std::string message;
std::string file_name;
std::string thread_name;
std::string to_string();
};
}