Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
0e558eb0
Commit
0e558eb0
authored
Jan 18, 2018
by
Howard McLauchlan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add docs for bpf_override_return
parent
3d05244e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
docs/reference_guide.md
docs/reference_guide.md
+24
-0
No files found.
docs/reference_guide.md
View file @
0e558eb0
...
...
@@ -22,6 +22,8 @@ This guide is incomplete. If something feels missing, check the bcc and kernel s
-
[
5. bpf_get_current_uid_gid()
](
#5-bpf_get_current_uid_gid
)
-
[
6. bpf_get_current_comm()
](
#6-bpf_get_current_comm
)
-
[
7. bpf_log2l()
](
#7-bpflog2l
)
-
[
Debugging
](
#debugging
)
-
[
1. bpf_override_return()
](
#1-bpf_override_return
)
-
[
Output
](
#output
)
-
[
1. bpf_trace_printk()
](
#1-bpf_trace_printk
)
-
[
2. BPF_PERF_OUTPUT
](
#2-bpf_perf_output
)
...
...
@@ -324,6 +326,28 @@ Examples in situ:
[search /examples](https://github.com/iovisor/bcc/search?q=bpf_log2l+path%3Aexamples&type=Code),
[search /tools](https://github.com/iovisor/bcc/search?q=bpf_log2l+path%3Atools&type=Code)
## Debugging
### 1. bpf_override_return()
Syntax: ```int bpf_override_return(struct pt_regs *, unsigned long rc)```
Return: 0 on success
When used in a program attached to a function entry kprobe, causes the
execution of the function to be skipped, immediately returning `rc` instead.
This is used for targeted error injection.
Note: bpf_override_return will only work when the kprobed function is
whitelisted to allow error injections.
```
C
int kprobe__io_ctl_init(void
*
ctx) {
bpf_override_return(ctx, -ENOMEM);
return 0;
}
```
## Output
### 1. bpf_trace_printk()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment