From 584de45758df70a8e9084dcfe600a8b967115368 Mon Sep 17 00:00:00 2001 From: Viktor Malik Date: Tue, 16 Apr 2024 16:36:13 +0200 Subject: [PATCH] One-liner tutorial: add note on args access change PR #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. --- docs/tutorial_one_liners.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/tutorial_one_liners.md b/docs/tutorial_one_liners.md index b3fda554e9f3..4f1952b5d339 100644 --- a/docs/tutorial_one_liners.md +++ b/docs/tutorial_one_liners.md @@ -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 ```