Skip to content

Commit

Permalink
Consolidate reference_guide and adoc (#2994)
Browse files Browse the repository at this point in the history
Instead of having to duplicate text in two documents,
merge the documentation into the adoc.

In doing this, a lot of changes were made to the adoc:
- alphabetize all subsections
- add missing documentation from the reference_guide
into the adoc
- standardize code examples (where it made sense)
- text editing for clarification and correctness
- add starting reference tables for builtins, probes,
functions, map functions (with links and anchors)
- reorganization of sections (where it made sense)
- Environment Variables -> Config Variables (separate
section for Environment Variables that are env only)
- Added "Advanced Topics" section
- Added "Options Expanded" section

bpftrace/bpftrace#2753

Didn't include from reference_doc:
- SIGUSR1 (maps print by default)

Co-authored-by: Jordan Rome <jordalgo@fedoraproject.org>
  • Loading branch information
jordalgo and Jordan Rome authored Feb 26, 2024
1 parent 7e04b1c commit 63e360f
Show file tree
Hide file tree
Showing 7 changed files with 2,107 additions and 5,126 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Useful contribution guidelines and tips are in docs/developers.md.

##### Checklist

- [ ] Language changes are updated in `man/adoc/bpftrace.adoc` and if needed in `docs/reference_guide.md`
- [ ] Language changes are updated in `man/adoc/bpftrace.adoc`
- [ ] User-visible and non-trivial changes updated in `CHANGELOG.md`
- [ ] The new behaviour is covered by tests
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

bpftrace is a high-level tracing language for Linux enhanced Berkeley Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses LLVM as a backend to compile scripts to BPF-bytecode and makes use of [BCC](https://github.com/iovisor/bcc) for interacting with the Linux BPF system, as well as existing Linux tracing capabilities: kernel dynamic tracing (kprobes), user-level dynamic tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was created by [Alastair Robertson](https://github.com/ajor).

To learn more about bpftrace, see the [Manual](man/adoc/bpftrace.adoc) the [Reference Guide](docs/reference_guide.md) and [One-Liner Tutorial](docs/tutorial_one_liners.md).
To learn more about bpftrace, see the [Manual](man/adoc/bpftrace.adoc) and [One-Liner Tutorial](docs/tutorial_one_liners.md).

We are also holding regular [office hours](https://docs.google.com/document/d/1nt010RfL4s4gydhCPSJ-Z5mnFMFuD4NrcpVmUcyvu2E/edit?usp=sharing) open to the public.

Expand Down Expand Up @@ -100,7 +100,7 @@ For more eBPF observability tools, see [bcc tools](https://github.com/iovisor/bc
## Probe types
<center><a href="images/bpftrace_probes_2018.png"><img src="images/bpftrace_probes_2018.png" border=0 width=700></a></center>

See the [Reference Guide](docs/reference_guide.md) for more detail.
See the [Manual](man/adoc/bpftrace.adoc) for more details.

## Plugins

Expand Down
4,008 changes: 2 additions & 4,006 deletions docs/reference_guide.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/tutorial_one_liners.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,4 @@ This uses kernel dynamic tracing of the vfs_open() function, which has a (struct

The kernel struct support is the same as bcc, making use of kernel headers. This means that many structs are available, but not everything, and sometimes it might be necessary to manually include a struct. For an example of this, see the [dcsnoop tool](../tools/dcsnoop.bt), which includes a portion of struct nameidata manually as it wasn't in the available headers. If the kernel has BTF data, all kernel structs are always available.

At this point you understand much of bpftrace, and can begin to use and write powerful one-liners. See the [Reference Guide](reference_guide.md) for more capabilities.
At this point you understand much of bpftrace, and can begin to use and write powerful one-liners. See the [Manual](../man/adoc/bpftrace.adoc) for more capabilities.
2 changes: 1 addition & 1 deletion docs/tutorial_one_liners_chinese.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,4 @@ open path: retrans_time_ms

bpftrace对内核结构跟踪的支持和bcc是一样的,允许使用内核头文件。这意味着大多数结构是可用的,但是并不是所有的,有时需要手动增加某些结构的声明。例如这个例子,见[dcsnoop tool](../tools/dcsnoop.bt),包含struct nameidata的声明。倘若内核有提供BTF数据,则所有结构都可用。

现在,你已经理解了bpftrace的大部分功能,你可以开始使用和编写强大的一行命令。查阅[参考手册](reference_guide.md)更多的功能。
现在,你已经理解了bpftrace的大部分功能,你可以开始使用和编写强大的一行命令。查阅[使用说明书](../man/adoc/bpftrace.adoc)更多的功能。
4 changes: 2 additions & 2 deletions docs/tutorial_one_liners_japanese.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bpftrace ワンライナーチュートリアル

12個の簡単なレッスンで Linux の bpftrace を学びましょう.各レッスンはワンライナーです.すぐに試すことができ,一連のワンライナーで bpftrace の要点が分かります.bpftrace の詳細は[リファレンスガイド](reference_guide.md)を参照して下さい.
12個の簡単なレッスンで Linux の bpftrace を学びましょう.各レッスンはワンライナーです.すぐに試すことができ,一連のワンライナーで bpftrace の要点が分かります.bpftrace の詳細は[インストラクションマニュアル](../man/adoc/bpftrace.adoc)を参照して下さい.

- 執筆:Brendan Gregg, Netflix (2018).FreeBSD [DTrace Tutorial](https://wiki.freebsd.org/DTrace/Tutorial)(Brendan Gregg 著)に基づく.
- 原文:[The bpftrace One-Liner Tutorial](https://github.com/bpftrace/bpftrace/blob/master/docs/tutorial_one_liners.md)
Expand Down Expand Up @@ -324,5 +324,5 @@ open path: retrans_time_ms

カーネル構造体のサポートは bcc と同様にカーネルヘッダを利用します.したがって多くの構造体が利用可能ですが,全てではありません.場合によっては手動で構造体を定義する必要があります.例えば [dcsnoop tool](../tools/dcsnoop.bt) では nameidata 構造体の一部を手動で定義しています.これはこの構造体がヘッダ内で定義されていないためです.LinuxカーネルのBTFデータがある場合,全ての構造体が利用可能です.

ここまでで bpftrace の多くを理解し,強力なワンライナーを作成・利用することができます.bpftrace のその他の機能については [リファレンスガイド](reference_guide.md) を参照して下さい.
ここまでで bpftrace の多くを理解し,強力なワンライナーを作成・利用することができます.bpftrace のその他の機能については [インストラクションマニュアル](../man/adoc/bpftrace.adoc) を参照して下さい.

Loading

0 comments on commit 63e360f

Please sign in to comment.