mirror of
https://gitee.com/openharmony/third_party_libbpf
synced 2024-12-04 00:52:46 +00:00
update README_OH.md.
Signed-off-by: Chenshi <chenshi51@huawei.com>
This commit is contained in:
parent
7c8ccf4183
commit
788ad1cecd
20
README_OH.md
20
README_OH.md
@ -2,7 +2,7 @@
|
||||
|
||||
仓库包含第三方开源软件libbpf,libbpf是eBPF技术的一种实现,eBPF提供给开发者一种内核事件和用户进程事件发生时安全注入代码的机制,避免开发者直接进行内核编程时可能导致的系统锁定、内存损坏、进程崩溃和安全漏洞等问题。开发者基于libbpf第三方开源库高效便捷开发eBPF程序,应用于网络过滤、程序跟踪、性能分析以及调试等需求场景。
|
||||
|
||||
# 目录结构
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
docs/ 文档
|
||||
@ -15,21 +15,21 @@ README.md 英文说明
|
||||
README_zh.md 中文说明
|
||||
```
|
||||
|
||||
# OpenHarmony如何集成libbpf
|
||||
## OpenHarmony如何集成libbpf
|
||||
|
||||
## 1.头文件引入
|
||||
### 1.头文件引入
|
||||
|
||||
```
|
||||
#include "libbpf.h"
|
||||
#include "bpf.h"
|
||||
```
|
||||
|
||||
## 2.BUILD.gn添加引用
|
||||
### 2.BUILD.gn添加引用
|
||||
|
||||
```
|
||||
deps += ["//third_party/libbpf:libbpf"]
|
||||
```
|
||||
## 3.示例代码
|
||||
### 3.示例代码
|
||||
```
|
||||
# kprobe.bpf.c BPF程序
|
||||
# 指定LICENSE
|
||||
@ -78,14 +78,14 @@ err = kprobe_bpf__attach(skel);
|
||||
/* 销毁和回收资源 */
|
||||
kprobe_bpf__destroy(skel);
|
||||
```
|
||||
# libbpf相关知识文档
|
||||
## libbpf相关知识文档
|
||||
|
||||
bpf参考指南[https://nakryiko.com/posts/bpf-core-reference-guide/](https://nakryiko.com/posts/bpf-core-reference-guide/)
|
||||
[bpf参考指南](https://nakryiko.com/posts/bpf-core-reference-guide/)
|
||||
|
||||
libbpf开发指导[https://nakryiko.com/posts/bcc-to-libbpf-howto-guide/](https://nakryiko.com/posts/bcc-to-libbpf-howto-guide/)
|
||||
[libbpf开发指导](https://nakryiko.com/posts/bcc-to-libbpf-howto-guide/)
|
||||
|
||||
libbpf开发示例[https://github.com/libbpf/libbpf-bootstrap](https://github.com/libbpf/libbpf-bootstrap)
|
||||
# License
|
||||
[libbpf开发示例](https://github.com/libbpf/libbpf-bootstrap)
|
||||
## License
|
||||
|
||||
`SPDX-License-Identifier: BSD-2-Clause OR LGPL-2.1`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user