Skip to content
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

Add %rh option to print buffer as hex without \x #2445

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

lenticularis39
Copy link
Contributor

@lenticularis39 lenticularis39 commented Dec 7, 2022

The new option serves as a more readable variant of %rx. In addition to omitting %rx, it puts spaces between the bytes.

Closes #2305

Example:

# bpftrace -e 'BEGIN { printf("%rh", buf("Hello world", 11)); }'
Attaching 1 probe...
48 65 6c 6c 6f 20 77 6f 72 6c 64
Checklist
  • Language changes are updated in man/adoc/bpftrace.adoc and if needed in docs/reference_guide.md
  • User-visible and non-trivial changes updated in CHANGELOG.md
  • The new behaviour is covered by tests

The new option serves as a more readable variant of %rx. In addition
to omitting `%rx`, it puts spaces between the bytes.

Closes bpftrace#2305
Copy link
Contributor

@viktormalik viktormalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks useful to me, thanks!

@fbs fbs merged commit d605c69 into bpftrace:master Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hex dump
3 participants