-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix stack mode for stack builtin #3322
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one comment below.
Also, I don't think that this fixes stack mode specifically for maps or map keys. It rather fixes stack mode for kstack
and ustack
used as a builtin variable (i.e. without ()
).
For instance, all of these are currently broken and should be fixed by this PR:
# bpftrace -e 'config = { stack_mode = raw } kprobe:vfs_read { @ = kstack; exit() }'
# bpftrace -e 'config = { stack_mode = raw } kprobe:vfs_read { @[kstack] = 0; exit() }'
# bpftrace -e 'config = { stack_mode = raw } kprobe:vfs_read { $s = kstack; print($s); exit() }'
Perhaps the tests and the commit message should be adjusted to reflect that.
Also this affects released v0.21.0 so a changelog entry would make sense here.
Yes, good call. Will update both. |
a9da163
to
2f6b87b
Compare
2f6b87b
to
1f04426
Compare
1f04426
to
5780653
Compare
The stack mode for kstack and ustack builtin variables (i.e. without ()) were not respecting the stack mode value set by the config block. Example: ``` bpftrace -e 'config = { stack_mode = raw } kprobe:vfs_read { @ = kstack; exit() }' bpftrace -e 'config = { stack_mode = raw } kprobe:vfs_read { @[kstack] = 0; exit() }' bpftrace -e 'config = { stack_mode = raw } kprobe:vfs_read { $s = kstack; print($s); exit() }' ``` All of these would have the default 'bpftrace' stack mode instead of 'raw'.
5780653
to
7947a9d
Compare
The stack mode for kstack and ustack builtin
variables (i.e. without ()) were not respecting
the stack mode value set by the config block.
Example:
All of these would have the default 'bpftrace'
stack mode instead of 'raw'.
Checklist
man/adoc/bpftrace.adoc
CHANGELOG.md