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
be0d60b4
Commit
be0d60b4
authored
Jan 30, 2017
by
Derek
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mybcc' of
https://github.com/derek0883/bcc
into mybcc
parents
7174d93c
4114d0d8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
src/cc/libbpf.c
src/cc/libbpf.c
+2
-2
src/cc/libbpf.h
src/cc/libbpf.h
+4
-6
No files found.
src/cc/libbpf.c
View file @
be0d60b4
...
@@ -362,7 +362,7 @@ void * bpf_attach_kprobe(int progfd, enum bpf_probe_attach_type attach_type, con
...
@@ -362,7 +362,7 @@ void * bpf_attach_kprobe(int progfd, enum bpf_probe_attach_type attach_type, con
goto
error
;
goto
error
;
}
}
snprintf
(
buf
,
sizeof
(
buf
),
"%c:%ss/%s %s"
,
attach_type
==
BPF_PROBE_ENTRY
?
'p'
:
'r'
,
snprintf
(
buf
,
sizeof
(
buf
),
"%c:%ss/%s %s"
,
attach_type
==
probe_entry
?
'p'
:
'r'
,
event_type
,
new_name
,
fn_name
);
event_type
,
new_name
,
fn_name
);
if
(
write
(
kfd
,
buf
,
strlen
(
buf
))
<
0
)
{
if
(
write
(
kfd
,
buf
,
strlen
(
buf
))
<
0
)
{
if
(
errno
==
EINVAL
)
if
(
errno
==
EINVAL
)
...
@@ -420,7 +420,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con
...
@@ -420,7 +420,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con
goto
error
;
goto
error
;
}
}
n
=
snprintf
(
buf
,
sizeof
(
buf
),
"%c:%ss/%s %s:0x%lx"
,
attach_type
==
BPF_PROBE_ENTRY
?
'p'
:
'r'
,
n
=
snprintf
(
buf
,
sizeof
(
buf
),
"%c:%ss/%s %s:0x%lx"
,
attach_type
==
probe_entry
?
'p'
:
'r'
,
event_type
,
new_name
,
binary_path
,
offset
);
event_type
,
new_name
,
binary_path
,
offset
);
if
(
n
>=
sizeof
(
buf
))
{
if
(
n
>=
sizeof
(
buf
))
{
close
(
kfd
);
close
(
kfd
);
...
...
src/cc/libbpf.h
View file @
be0d60b4
...
@@ -28,8 +28,6 @@ enum bpf_probe_attach_type {
...
@@ -28,8 +28,6 @@ enum bpf_probe_attach_type {
probe_entry
,
probe_entry
,
probe_return
probe_return
};
};
#define BPF_PROBE_ENTRY 0
#define BPF_PROBE_RETURN 1
int
bpf_create_map
(
enum
bpf_map_type
map_type
,
int
key_size
,
int
value_size
,
int
bpf_create_map
(
enum
bpf_map_type
map_type
,
int
key_size
,
int
value_size
,
int
max_entries
,
int
map_flags
);
int
max_entries
,
int
map_flags
);
...
@@ -51,15 +49,15 @@ typedef void (*perf_reader_cb)(void *cb_cookie, int pid, uint64_t callchain_num,
...
@@ -51,15 +49,15 @@ typedef void (*perf_reader_cb)(void *cb_cookie, int pid, uint64_t callchain_num,
void
*
callchain
);
void
*
callchain
);
typedef
void
(
*
perf_reader_raw_cb
)(
void
*
cb_cookie
,
void
*
raw
,
int
raw_size
);
typedef
void
(
*
perf_reader_raw_cb
)(
void
*
cb_cookie
,
void
*
raw
,
int
raw_size
);
void
*
bpf_attach_kprobe
(
int
progfd
,
enum
bpf_probe_attach_type
attach_type
,
const
char
*
ev_name
,
void
*
bpf_attach_kprobe
(
int
progfd
,
enum
bpf_probe_attach_type
attach_type
,
const
char
*
fn_name
,
const
char
*
ev_name
,
const
char
*
fn_name
,
pid_t
pid
,
int
cpu
,
int
group_fd
,
pid_t
pid
,
int
cpu
,
int
group_fd
,
perf_reader_cb
cb
,
void
*
cb_cookie
);
perf_reader_cb
cb
,
void
*
cb_cookie
);
int
bpf_detach_kprobe
(
const
char
*
ev_name
);
int
bpf_detach_kprobe
(
const
char
*
ev_name
);
void
*
bpf_attach_uprobe
(
int
progfd
,
enum
bpf_probe_attach_type
attach_type
,
const
char
*
ev_name
,
void
*
bpf_attach_uprobe
(
int
progfd
,
enum
bpf_probe_attach_type
attach_type
,
const
char
*
binary_path
,
uint64_t
offset
,
const
char
*
ev_name
,
const
char
*
binary_path
,
uint64_t
offset
,
pid_t
pid
,
int
cpu
,
int
group_fd
,
pid_t
pid
,
int
cpu
,
int
group_fd
,
perf_reader_cb
cb
,
void
*
cb_cookie
);
perf_reader_cb
cb
,
void
*
cb_cookie
);
...
...
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