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
227b5b99
Commit
227b5b99
authored
8 years ago
by
Derek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enum bpf_probe_attach_type to CAPITAL
parent
a112514c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
src/cc/BPF.h
src/cc/BPF.h
+8
-8
src/cc/libbpf.c
src/cc/libbpf.c
+2
-2
src/cc/libbpf.h
src/cc/libbpf.h
+2
-2
No files found.
src/cc/BPF.h
View file @
227b5b99
...
...
@@ -51,23 +51,23 @@ public:
StatusTuple
attach_kprobe
(
const
std
::
string
&
kernel_func
,
const
std
::
string
&
probe_func
,
bpf_probe_attach_type
=
probe_entry
,
bpf_probe_attach_type
=
BPF_PROBE_ENTRY
,
pid_t
pid
=
-
1
,
int
cpu
=
0
,
int
group_fd
=
-
1
,
perf_reader_cb
cb
=
nullptr
,
void
*
cb_cookie
=
nullptr
);
StatusTuple
detach_kprobe
(
const
std
::
string
&
kernel_func
,
bpf_probe_attach_type
attach_type
=
probe_entry
);
bpf_probe_attach_type
attach_type
=
BPF_PROBE_ENTRY
);
StatusTuple
attach_uprobe
(
const
std
::
string
&
binary_path
,
const
std
::
string
&
symbol
,
const
std
::
string
&
probe_func
,
uint64_t
symbol_addr
=
0
,
bpf_probe_attach_type
attach_type
=
probe_entry
,
bpf_probe_attach_type
attach_type
=
BPF_PROBE_ENTRY
,
pid_t
pid
=
-
1
,
int
cpu
=
0
,
int
group_fd
=
-
1
,
perf_reader_cb
cb
=
nullptr
,
void
*
cb_cookie
=
nullptr
);
StatusTuple
detach_uprobe
(
const
std
::
string
&
binary_path
,
const
std
::
string
&
symbol
,
uint64_t
symbol_addr
=
0
,
bpf_probe_attach_type
attach_type
=
probe_entry
);
bpf_probe_attach_type
attach_type
=
BPF_PROBE_ENTRY
);
StatusTuple
attach_usdt
(
const
USDT
&
usdt
,
pid_t
pid
=
-
1
,
int
cpu
=
0
,
int
group_fd
=
-
1
);
StatusTuple
detach_usdt
(
const
USDT
&
usdt
);
...
...
@@ -118,9 +118,9 @@ private:
std
::
string
attach_type_debug
(
bpf_probe_attach_type
type
)
{
switch
(
type
)
{
case
probe_entry
:
case
BPF_PROBE_ENTRY
:
return
""
;
case
probe_return
:
case
BPF_PROBE_RETURN
:
return
"return "
;
}
return
"ERROR"
;
...
...
@@ -128,9 +128,9 @@ private:
std
::
string
attach_type_prefix
(
bpf_probe_attach_type
type
)
{
switch
(
type
)
{
case
probe_entry
:
case
BPF_PROBE_ENTRY
:
return
"p"
;
case
probe_return
:
case
BPF_PROBE_RETURN
:
return
"r"
;
}
return
"ERROR"
;
...
...
This diff is collapsed.
Click to expand it.
src/cc/libbpf.c
View file @
227b5b99
...
...
@@ -362,7 +362,7 @@ void * bpf_attach_kprobe(int progfd, enum bpf_probe_attach_type attach_type, con
goto
error
;
}
snprintf
(
buf
,
sizeof
(
buf
),
"%c:%ss/%s %s"
,
attach_type
==
probe_entry
?
'p'
:
'r'
,
snprintf
(
buf
,
sizeof
(
buf
),
"%c:%ss/%s %s"
,
attach_type
==
BPF_PROBE_ENTRY
?
'p'
:
'r'
,
event_type
,
new_name
,
fn_name
);
if
(
write
(
kfd
,
buf
,
strlen
(
buf
))
<
0
)
{
if
(
errno
==
EINVAL
)
...
...
@@ -420,7 +420,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con
goto
error
;
}
n
=
snprintf
(
buf
,
sizeof
(
buf
),
"%c:%ss/%s %s:0x%lx"
,
attach_type
==
probe_entry
?
'p'
:
'r'
,
n
=
snprintf
(
buf
,
sizeof
(
buf
),
"%c:%ss/%s %s:0x%lx"
,
attach_type
==
BPF_PROBE_ENTRY
?
'p'
:
'r'
,
event_type
,
new_name
,
binary_path
,
offset
);
if
(
n
>=
sizeof
(
buf
))
{
close
(
kfd
);
...
...
This diff is collapsed.
Click to expand it.
src/cc/libbpf.h
View file @
227b5b99
...
...
@@ -25,8 +25,8 @@ extern "C" {
#endif
enum
bpf_probe_attach_type
{
probe_entry
,
probe_return
BPF_PROBE_ENTRY
,
BPF_PROBE_RETURN
};
int
bpf_create_map
(
enum
bpf_map_type
map_type
,
int
key_size
,
int
value_size
,
...
...
This diff is collapsed.
Click to expand it.
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