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
0bd29aab
Commit
0bd29aab
authored
Mar 05, 2018
by
Teng Qin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BPFPerfBuffer: Make it more clear that timeout is milliseconds
parent
861bac09
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
src/cc/api/BPF.cc
src/cc/api/BPF.cc
+2
-2
src/cc/api/BPF.h
src/cc/api/BPF.h
+1
-1
src/cc/api/BPFTable.cc
src/cc/api/BPFTable.cc
+2
-2
src/cc/api/BPFTable.h
src/cc/api/BPFTable.h
+1
-1
No files found.
src/cc/api/BPF.cc
View file @
0bd29aab
...
...
@@ -443,11 +443,11 @@ StatusTuple BPF::close_perf_buffer(const std::string& name) {
return
StatusTuple
(
0
);
}
void
BPF
::
poll_perf_buffer
(
const
std
::
string
&
name
,
int
timeout
)
{
void
BPF
::
poll_perf_buffer
(
const
std
::
string
&
name
,
int
timeout
_ms
)
{
auto
it
=
perf_buffers_
.
find
(
name
);
if
(
it
==
perf_buffers_
.
end
())
return
;
it
->
second
->
poll
(
timeout
);
it
->
second
->
poll
(
timeout
_ms
);
}
StatusTuple
BPF
::
load_func
(
const
std
::
string
&
func_name
,
bpf_prog_type
type
,
...
...
src/cc/api/BPF.h
View file @
0bd29aab
...
...
@@ -141,7 +141,7 @@ class BPF {
void
*
cb_cookie
=
nullptr
,
int
page_cnt
=
DEFAULT_PERF_BUFFER_PAGE_CNT
);
StatusTuple
close_perf_buffer
(
const
std
::
string
&
name
);
void
poll_perf_buffer
(
const
std
::
string
&
name
,
int
timeout
=
-
1
);
void
poll_perf_buffer
(
const
std
::
string
&
name
,
int
timeout
_ms
=
-
1
);
StatusTuple
load_func
(
const
std
::
string
&
func_name
,
enum
bpf_prog_type
type
,
int
&
fd
);
...
...
src/cc/api/BPFTable.cc
View file @
0bd29aab
...
...
@@ -295,10 +295,10 @@ StatusTuple BPFPerfBuffer::close_all_cpu() {
return
StatusTuple
(
0
);
}
void
BPFPerfBuffer
::
poll
(
int
timeout
)
{
void
BPFPerfBuffer
::
poll
(
int
timeout
_ms
)
{
if
(
epfd_
<
0
)
return
;
int
cnt
=
epoll_wait
(
epfd_
,
ep_events_
.
get
(),
cpu_readers_
.
size
(),
timeout
);
int
cnt
=
epoll_wait
(
epfd_
,
ep_events_
.
get
(),
cpu_readers_
.
size
(),
timeout
_ms
);
if
(
cnt
<=
0
)
return
;
for
(
int
i
=
0
;
i
<
cnt
;
i
++
)
...
...
src/cc/api/BPFTable.h
View file @
0bd29aab
...
...
@@ -309,7 +309,7 @@ class BPFPerfBuffer : public BPFTableBase<int, int> {
StatusTuple
open_all_cpu
(
perf_reader_raw_cb
cb
,
perf_reader_lost_cb
lost_cb
,
void
*
cb_cookie
,
int
page_cnt
);
StatusTuple
close_all_cpu
();
void
poll
(
int
timeout
);
void
poll
(
int
timeout
_ms
);
private:
StatusTuple
open_on_cpu
(
perf_reader_raw_cb
cb
,
perf_reader_lost_cb
lost_cb
,
...
...
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