Skip to content

Commit

Permalink
One-liner tutorial: add note on args access change
Browse files Browse the repository at this point in the history
PR bpftrace#2578 changed the way args fields are accessed. Since then, it is
recommended to use `args.xxx` instead of `args->xxx` which is also
reflected in the one-liner tutorial.

As many distros still have older versions of bpftrace, people keep
stumbling on one-liner tutorial commands throwing errors about
`args.xxx` not being a correct expression. Add a note to the one-liner
tutorial which highlights this change and warns people to use
`args->xxx` for older versions of bpftrace.
  • Loading branch information
viktormalik committed Apr 23, 2024
1 parent 1ccc7a7 commit 584de45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/tutorial_one_liners.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This teaches you bpftrace for Linux in 12 easy lessons, where each lesson is a o

Contributed by Brendan Gregg, Netflix (2018), based on his FreeBSD [DTrace Tutorial](https://wiki.freebsd.org/DTrace/Tutorial).

Note: bpftrace 0.19 changed the way probe arguments are accessed (using
`args.xxx` instead of `args->xxx`). If you are using an older version of
bpftrace, you will need to use `args->xxx` in the below examples.

# Lesson 1. Listing Probes

```
Expand Down

0 comments on commit 584de45

Please sign in to comment.