mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-10-28 19:24:04 +08:00
docs: link hardirqs example headers
This commit is contained in:
@@ -35,6 +35,8 @@ By following the above approach, we can use hardirqs and softirqs in eBPF to cap
|
||||
|
||||
The main purpose of the hardirqs program is to obtain the name, execution count, and execution time of interrupt handlers and display the distribution of execution time in the form of a histogram. Let's analyze this code step by step.
|
||||
|
||||
The custom headers used below are part of the complete example rather than system headers. Build from the `src/10-hardirqs` directory, which contains [`hardirqs.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/hardirqs.h), [`bits.bpf.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/bits.bpf.h), and [`maps.bpf.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/maps.bpf.h) alongside the source file.
|
||||
|
||||
```c
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
// Copyright (c) 2020 Wenbo Zhang
|
||||
|
||||
@@ -26,6 +26,8 @@ softirqs 是软件中断处理程序。它们是内核中的一种底层异步
|
||||
|
||||
hardirqs 程序的主要目的是获取中断处理程序的名称、执行次数和执行时间,并以直方图的形式展示执行时间的分布。让我们一步步分析这段代码。
|
||||
|
||||
下面引用的自定义头文件属于完整示例,并不是系统头文件。请在 `src/10-hardirqs` 目录中编译,该目录在源码旁提供了 [`hardirqs.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/hardirqs.h)、[`bits.bpf.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/bits.bpf.h) 和 [`maps.bpf.h`](https://github.com/eunomia-bpf/bpf-developer-tutorial/blob/main/src/10-hardirqs/maps.bpf.h)。
|
||||
|
||||
```c
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
// Copyright (c) 2020 Wenbo Zhang
|
||||
|
||||
Reference in New Issue
Block a user