-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsigsegv-monitor.h
More file actions
61 lines (51 loc) · 1.18 KB
/
sigsegv-monitor.h
File metadata and controls
61 lines (51 loc) · 1.18 KB
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
#pragma once
#define MAX_LBR_ENTRIES 32
#define MAX_USER_PF_ENTRIES 16
#define TRACE_PF_CR2
// #define TRACE_PF_CR2_INCREMENTAL
// #define TRACE_KERNEL_SPACE_BRANCHES
struct page_fault_info_t {
u64 cr2;
u64 err;
u64 tai;
};
struct user_regs_t {
u64 rip;
u64 rsp;
u64 rax;
u64 rbx;
u64 rcx;
u64 rdx;
u64 rsi;
u64 rdi;
u64 rbp;
u64 r8;
u64 r9;
u64 r10;
u64 r11;
u64 r12;
u64 r13;
u64 r14;
u64 r15;
u64 flags;
u64 trapno;
u64 err;
u64 cr2;
};
// WARNING: this is for the SENDING process (e.g. pid) of the signal!
struct event_t {
int signal;
int si_code;
u32 tgid; // the PROCESS id!
u32 pidns_tgid; // the PROCESS id within the innermost pid namespace of the process
char tgleader_comm[16]; // the PROCESS name
u32 pid; // the THREAD id!
u32 pidns_pid; // the THREAD id within the innermost pid namespace of the process
char comm[16]; // the THREAD name
u32 lbr_count;
struct user_regs_t regs;
struct perf_branch_entry lbr[MAX_LBR_ENTRIES];
u64 tai; // time atomic international
u32 pf_count;
struct page_fault_info_t pf[MAX_USER_PF_ENTRIES];
};