Skip to content

Errata - more idiomatic addressing for arrays, tidy string output #55

Merged
lizrice merged 9 commits into
mainfrom
errata
Mar 23, 2026
Merged

Errata - more idiomatic addressing for arrays, tidy string output #55
lizrice merged 9 commits into
mainfrom
errata

Conversation

@lizrice
Copy link
Copy Markdown
Owner

@lizrice lizrice commented Mar 23, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 23, 2026 12:31
@lizrice
Copy link
Copy Markdown
Owner Author

lizrice commented Mar 23, 2026

As an experiment: @copilot what do you think?

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@lizrice I've opened a new pull request, #56, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR applies small “errata” cleanups across the eBPF examples, mainly making array handling more idiomatic when passing stack buffers to BPF helpers and slightly tidying user-space output formatting.

Changes:

  • Remove unnecessary address-of (&) when passing array fields (e.g., data.message, data.command, data.path) into BPF helper calls across multiple examples.
  • Minor user-space output tweak in find-map.c to print a more readable label.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
chapter7/hello.bpf.c Updates helper-call buffer arguments to use array decay instead of &array.
chapter6/hello-verifier.bpf.c Same array-argument cleanup for helper calls.
chapter5/hello-buffer-config.bpf.c Same array-argument cleanup for comm/path/message reads.
chapter5/find-map.c Adjusts printed label for map name output.
chapter4/hello-ring-buffer-config.py Updates embedded BPF C program to pass arrays without &.
chapter4/hello-buffer-config.py Updates embedded BPF C program to pass arrays without &.
chapter2/hello-file-ring-buffer.py Updates embedded BPF C program to pass arrays without &.
chapter2/hello-buffer.py Updates embedded BPF C program to pass arrays without &.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread chapter7/hello.bpf.c Outdated
Comment thread chapter7/hello.bpf.c
Comment thread chapter7/hello.bpf.c Outdated
Comment thread chapter6/hello-verifier.bpf.c
lizrice and others added 2 commits March 23, 2026 13:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Liz Rice <liz@lizrice.com>
Ensure path is null-terminated

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Liz Rice <liz@lizrice.com>
Comment thread chapter7/hello.bpf.c Outdated
Comment thread chapter6/hello-verifier.bpf.c Outdated
lizrice added 2 commits March 23, 2026 13:42
Signed-off-by: Liz Rice <liz@lizrice.com>
Signed-off-by: Liz Rice <liz@lizrice.com>
@lizrice
Copy link
Copy Markdown
Owner Author

lizrice commented Mar 23, 2026

@copilot any more comments?

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

@lizrice I've opened a new pull request, #57, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 23, 2026 13:45
Use bpf_probe_read_*_str for all string buffer reads
@lizrice lizrice merged commit 1ccef6e into main Mar 23, 2026
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.

3 participants