-
Notifications
You must be signed in to change notification settings - Fork 81
/
ras-events.h
104 lines (84 loc) · 1.98 KB
/
ras-events.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2013 Mauro Carvalho Chehab <[email protected]>
*/
#ifndef __RAS_EVENTS_H
#define __RAS_EVENTS_H
#include <pthread.h>
#include <time.h>
#include "types.h"
extern char *choices_disable;
struct mce_priv;
struct ras_mc_offline_event;
enum {
MC_EVENT,
MCE_EVENT,
AER_EVENT,
NON_STANDARD_EVENT,
ARM_EVENT,
EXTLOG_EVENT,
DEVLINK_EVENT,
DISKERROR_EVENT,
MF_EVENT,
CXL_POISON_EVENT,
CXL_AER_UE_EVENT,
CXL_AER_CE_EVENT,
CXL_OVERFLOW_EVENT,
CXL_GENERIC_EVENT,
CXL_GENERAL_MEDIA_EVENT,
CXL_DRAM_EVENT,
CXL_MEMORY_MODULE_EVENT,
NR_EVENTS
};
struct ras_events {
char debugfs[MAX_PATH + 1];
char tracing[MAX_PATH + 1];
struct tep_handle *pevent;
int page_size;
/* Booleans */
unsigned use_uptime: 1;
unsigned record_events: 1;
/* For timestamp */
time_t uptime_diff;
/* For ras-record */
void *db_priv;
int db_ref_count;
pthread_mutex_t db_lock;
/* For the mce handler */
struct mce_priv *mce_priv;
/* For ABRT socket*/
int socketfd;
struct tep_event_filter *filters[NR_EVENTS];
};
struct pthread_data {
pthread_t thread;
struct tep_handle *pevent;
struct ras_events *ras;
int cpu;
};
/* Should match the code at Kernel's include/linux/edac.c */
enum hw_event_mc_err_type {
HW_EVENT_ERR_CORRECTED,
HW_EVENT_ERR_UNCORRECTED,
HW_EVENT_ERR_FATAL,
HW_EVENT_ERR_INFO,
};
/* Should match the code at Kernel's /drivers/pci/pcie/aer/aerdrv_errprint.c */
enum hw_event_aer_err_type {
HW_EVENT_AER_UNCORRECTED_NON_FATAL,
HW_EVENT_AER_UNCORRECTED_FATAL,
HW_EVENT_AER_CORRECTED,
};
/* Should match the code at Kernel's include/acpi/ghes.h */
enum ghes_severity {
GHES_SEV_NO,
GHES_SEV_CORRECTED,
GHES_SEV_RECOVERABLE,
GHES_SEV_PANIC,
};
/* Function prototypes */
int toggle_ras_mc_event(int enable);
int handle_ras_events(int record_events, int enable_ipmitool);
int ras_offline_mce_event(struct ras_mc_offline_event *event);
int handle_ras_events(int record_events, int enable_ipmitool);
#endif