Skip to content

Commit

Permalink
man: Clarify ++/-- operators can lose updates
Browse files Browse the repository at this point in the history
We already call this out in count() docs. Let's do it for ++/-- as well.
  • Loading branch information
danobi committed May 18, 2024
1 parent 668174c commit 6d260ed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions man/adoc/bpftrace.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,8 @@ $b = --$a; // a = 9; b = 9
Note that maps will be implicitly declared and initialized to 0 if not already declared or defined.
Scratch variables must be initialized before using these operators.

Note `++`/`--` on a shared global variable can lose updates. See <<map-functions-count, `count()`>> for more details.

=== Pointers

Pointers in bpftrace are similar to those found in `C`.
Expand Down

0 comments on commit 6d260ed

Please sign in to comment.