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
3a65d81c
Commit
3a65d81c
authored
Jun 17, 2015
by
4ast
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #64 from iovisor/bblanco_dev
Automatically compute sizeof in bpf_trace_printk
parents
7679a2e0
71c3638f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
examples/hello_world.py
examples/hello_world.py
+1
-2
src/cc/export/helpers.h
src/cc/export/helpers.h
+3
-1
No files found.
examples/hello_world.py
View file @
3a65d81c
...
...
@@ -10,8 +10,7 @@ from subprocess import call
prog
=
"""
int hello(void *ctx) {
char fmt[] = "Hello, World!
\
\
n";
bpf_trace_printk(fmt, sizeof(fmt));
bpf_trace_printk("Hello, World!
\
\
n");
return 0;
};
"""
...
...
src/cc/export/helpers.h
View file @
3a65d81c
...
...
@@ -67,8 +67,10 @@ static int (*bpf_probe_read)(void *dst, u64 size, void *unsafe_ptr) =
(
void
*
)
BPF_FUNC_probe_read
;
static
u64
(
*
bpf_ktime_get_ns
)(
void
)
=
(
void
*
)
BPF_FUNC_ktime_get_ns
;
static
int
(
*
bpf_trace_printk
)(
const
char
*
fmt
,
u64
fmt_size
,
...)
=
static
int
(
*
bpf_trace_printk
_
)(
const
char
*
fmt
,
u64
fmt_size
,
...)
=
(
void
*
)
BPF_FUNC_trace_printk
;
#define bpf_trace_printk(_fmt, ...) \
({ char fmt[] = _fmt; bpf_trace_printk_(fmt, sizeof(fmt), ##__VA_ARGS__); })
static
u64
(
*
bpf_clone_redirect
)(
void
*
ctx
,
u64
ifindex
,
u64
flags
)
=
(
void
*
)
BPF_FUNC_clone_redirect
;
static
void
bpf_tail_call_
(
u64
map_fd
,
void
*
ctx
,
int
index
)
{
...
...
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