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
Jan 31, 2017
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:
...
@@ -51,23 +51,23 @@ public:
StatusTuple
attach_kprobe
(
StatusTuple
attach_kprobe
(
const
std
::
string
&
kernel_func
,
const
std
::
string
&
probe_func
,
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
,
pid_t
pid
=
-
1
,
int
cpu
=
0
,
int
group_fd
=
-
1
,
perf_reader_cb
cb
=
nullptr
,
void
*
cb_cookie
=
nullptr
);
perf_reader_cb
cb
=
nullptr
,
void
*
cb_cookie
=
nullptr
);
StatusTuple
detach_kprobe
(
StatusTuple
detach_kprobe
(
const
std
::
string
&
kernel_func
,
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
(
StatusTuple
attach_uprobe
(
const
std
::
string
&
binary_path
,
const
std
::
string
&
symbol
,
const
std
::
string
&
binary_path
,
const
std
::
string
&
symbol
,
const
std
::
string
&
probe_func
,
uint64_t
symbol_addr
=
0
,
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
,
pid_t
pid
=
-
1
,
int
cpu
=
0
,
int
group_fd
=
-
1
,
perf_reader_cb
cb
=
nullptr
,
void
*
cb_cookie
=
nullptr
);
perf_reader_cb
cb
=
nullptr
,
void
*
cb_cookie
=
nullptr
);
StatusTuple
detach_uprobe
(
StatusTuple
detach_uprobe
(
const
std
::
string
&
binary_path
,
const
std
::
string
&
symbol
,
const
std
::
string
&
binary_path
,
const
std
::
string
&
symbol
,
uint64_t
symbol_addr
=
0
,
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
,
StatusTuple
attach_usdt
(
const
USDT
&
usdt
,
pid_t
pid
=
-
1
,
int
cpu
=
0
,
int
group_fd
=
-
1
);
int
group_fd
=
-
1
);
StatusTuple
detach_usdt
(
const
USDT
&
usdt
);
StatusTuple
detach_usdt
(
const
USDT
&
usdt
);
...
@@ -118,9 +118,9 @@ private:
...
@@ -118,9 +118,9 @@ private:
std
::
string
attach_type_debug
(
bpf_probe_attach_type
type
)
{
std
::
string
attach_type_debug
(
bpf_probe_attach_type
type
)
{
switch
(
type
)
{
switch
(
type
)
{
case
probe_entry
:
case
BPF_PROBE_ENTRY
:
return
""
;
return
""
;
case
probe_return
:
case
BPF_PROBE_RETURN
:
return
"return "
;
return
"return "
;
}
}
return
"ERROR"
;
return
"ERROR"
;
...
@@ -128,9 +128,9 @@ private:
...
@@ -128,9 +128,9 @@ private:
std
::
string
attach_type_prefix
(
bpf_probe_attach_type
type
)
{
std
::
string
attach_type_prefix
(
bpf_probe_attach_type
type
)
{
switch
(
type
)
{
switch
(
type
)
{
case
probe_entry
:
case
BPF_PROBE_ENTRY
:
return
"p"
;
return
"p"
;
case
probe_return
:
case
BPF_PROBE_RETURN
:
return
"r"
;
return
"r"
;
}
}
return
"ERROR"
;
return
"ERROR"
;
...
...
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
...
@@ -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
==
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
);
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
==
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
);
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 @
227b5b99
...
@@ -25,8 +25,8 @@ extern "C" {
...
@@ -25,8 +25,8 @@ extern "C" {
#endif
#endif
enum
bpf_probe_attach_type
{
enum
bpf_probe_attach_type
{
probe_entry
,
BPF_PROBE_ENTRY
,
probe_return
BPF_PROBE_RETURN
};
};
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
,
...
...
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