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
af98a1d0
Commit
af98a1d0
authored
Jul 24, 2016
by
Brendan Gregg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return 0 on hello_worlds
parent
6f2b589d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
README.md
README.md
+1
-1
examples/hello_world.py
examples/hello_world.py
+1
-1
No files found.
README.md
View file @
af98a1d0
...
...
@@ -189,7 +189,7 @@ The BPF program always takes at least one argument, which is a pointer to the
context for this type of program. Different program types have different calling
conventions, but for this one we don't care so
`void *`
is fine.
```
python
BPF
(
text
=
'
void kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!
\
\
n")
; }'
).
trace_print
()
BPF
(
text
=
'
int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!
\
\
n"); return 0
; }'
).
trace_print
()
```
For this example, we will call the program every time
`fork()`
is called by a
...
...
examples/hello_world.py
View file @
af98a1d0
...
...
@@ -8,4 +8,4 @@
from
bcc
import
BPF
BPF
(
text
=
'
void kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!
\
\
n")
; }'
).
trace_print
()
BPF
(
text
=
'
int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!
\
\
n"); return 0
; }'
).
trace_print
()
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