Skip to content

Commit

Permalink
[Xiangzhe Zhang]:Add interrupt exception plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangzhe Zhang committed Jul 4, 2022
1 parent 21cb542 commit 6969894
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
65 changes: 65 additions & 0 deletions eBPF_Supermarket/Interrupt_exception/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 基本原理
挂载点选择:内核中以下7种异常中断会在触发后会调用同一函数do_error_trap

在中断发生时,内核会通过DEFINE_IDTENTRY宏调用相关中断处理函数,之后调用do_error_trap去唤醒相关线程进行中断处理

0 | #DE |Divide Error 除0异常 |Fault|NO |DIV and IDIV
```c
DEFINE_IDTENTRY(exc_divide_error)
{
do_error_trap(regs, 0, "divide error", X86_TRAP_DE, SIGFPE,
FPE_INTDIV, error_get_trap_addr(regs));
}
```
4 | #OF |Overflow 溢出异常 |Trap |NO |INTO instruction
```c
DEFINE_IDTENTRY(exc_overflow)
{
do_error_trap(regs, 0, "overflow", X86_TRAP_OF, SIGSEGV, 0, NULL);
}
```
6 | #UD |Invalid Opcode 无效指令异常 |Fault|NO |UD2 instruction

```c
static inline void handle_invalid_op(struct pt_regs *regs)
#endif
{
do_error_trap(regs, 0, "invalid opcode", X86_TRAP_UD, SIGILL,
ILL_ILLOPN, error_get_trap_addr(regs));
}

```
9 | --- |Reserved 协处理器段溢出 |Fault|NO |
```c
DEFINE_IDTENTRY(exc_coproc_segment_overrun)
{
do_error_trap(regs, 0, "coprocessor segment overrun",
X86_TRAP_OLD_MF, SIGFPE, 0, NULL);
}
```
10 | #TS |Invalid TSS 无效TSS |Fault|YES |Task switch or TSS access

```c
DEFINE_IDTENTRY_ERRORCODE(exc_invalid_tss)
{
do_error_trap(regs, error_code, "invalid TSS", X86_TRAP_TS, SIGSEGV,
0, NULL);
}
```
11 | #NP |Segment Not Present 缺段中断 |Fault|NO |Accessing segment register
```c
DEFINE_IDTENTRY_ERRORCODE(exc_segment_not_present)
{
do_error_trap(regs, error_code, "segment not present", X86_TRAP_NP,
SIGBUS, 0, NULL);
}
```
12 | #SS |Stack-Segment Fault 堆栈异常 |Fault|YES |Stack operations
```c
DEFINE_IDTENTRY_ERRORCODE(exc_stack_segment)
{
do_error_trap(regs, error_code, "stack segment", X86_TRAP_SS, SIGBUS,
0, NULL);
}
```
1 change: 1 addition & 0 deletions eBPF_Supermarket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
| eBPF数据收集器 | eBPF_data_collector | eBPF数据收集器 | 赵晨雨 |
| 基于eBPF的网络拥塞观测与排查 | Network congestion observation and troubleshooting based on eBPF | 通过监控内核中的网络延迟抖动、网络拥塞状态机的切换帮忙网络问题排查 | 董旭 |
| eBPF初学者体验环境 | tryebpf | 提供bpftrace、BCC等适合初学者上手使用的线上环境 | 白宇宣 |
| Interrupt Exception | Interrupt_exception | 采集Linux系统异常中断相关信息、包括中断类型号以及函数调用栈等 | 张翔哲 |

0 comments on commit 6969894

Please sign in to comment.