Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libbpf-bootstrap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luis Gerhorst
libbpf-bootstrap
Commits
4999ed86
Unverified
Commit
4999ed86
authored
4 years ago
by
Andrii Nakryiko
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
readme: add description of uprobe demo
Add details about `uprobe` demo app.
parent
fbef5c0c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+27
-0
27 additions, 0 deletions
README.md
with
27 additions
and
0 deletions
README.md
+
27
−
0
View file @
4999ed86
...
...
@@ -68,6 +68,33 @@ TIME EVENT COMM PID PPID FILENAME/EXIT CODE
...
```
## Uprobe
`uprobe`
is an example of dealing with user-space entry and exit (return) probes,
`uprobe`
and
`uretprobe`
in libbpf lingo. It attached
`uprobe`
and
`uretprobe`
BPF programs to its own function (
`uprobe_trigger()`
) and logs input arguments
and return result, respectively, using
`bpf_printk()`
macro. The user-space
function is triggered once every second:
```
shell
$
sudo
./uprobe
libbpf: loading object
'uprobe_bpf'
from buffer
...
Successfully started!
...........
```
You can see
`uprobe`
demo output in
`/sys/kernel/debug/tracing/trace_pipe`
:
```
shell
$
sudo cat
/sys/kernel/debug/tracing/trace_pipe
<...>-461101
[
018] d... 505432.345032: bpf_trace_printk: UPROBE ENTRY: a
=
0, b
=
1
<...>-461101
[
018] d... 505432.345042: bpf_trace_printk: UPROBE EXIT:
return
=
1
<...>-461101
[
018] d... 505433.345186: bpf_trace_printk: UPROBE ENTRY: a
=
1, b
=
2
<...>-461101
[
018] d... 505433.345202: bpf_trace_printk: UPROBE EXIT:
return
=
3
<...>-461101
[
018] d... 505434.345342: bpf_trace_printk: UPROBE ENTRY: a
=
2, b
=
3
<...>-461101
[
018] d... 505434.345367: bpf_trace_printk: UPROBE EXIT:
return
=
5
```
# Building
```
shell
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment