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
b2e68700
Commit
b2e68700
authored
Apr 02, 2018
by
Andrii Nakryiko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return number of CPUs with data for BPFPerfBufferTable::poll()
parent
41134b10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
src/cc/api/BPFTable.cc
src/cc/api/BPFTable.cc
+3
-4
src/cc/api/BPFTable.h
src/cc/api/BPFTable.h
+1
-1
No files found.
src/cc/api/BPFTable.cc
View file @
b2e68700
...
...
@@ -306,14 +306,13 @@ StatusTuple BPFPerfBuffer::close_all_cpu() {
return
StatusTuple
(
0
);
}
void
BPFPerfBuffer
::
poll
(
int
timeout_ms
)
{
int
BPFPerfBuffer
::
poll
(
int
timeout_ms
)
{
if
(
epfd_
<
0
)
return
;
return
-
1
;
int
cnt
=
epoll_wait
(
epfd_
,
ep_events_
.
get
(),
cpu_readers_
.
size
(),
timeout_ms
);
if
(
cnt
<=
0
)
return
;
for
(
int
i
=
0
;
i
<
cnt
;
i
++
)
perf_reader_event_read
(
static_cast
<
perf_reader
*>
(
ep_events_
[
i
].
data
.
ptr
));
return
cnt
;
}
BPFPerfBuffer
::~
BPFPerfBuffer
()
{
...
...
src/cc/api/BPFTable.h
View file @
b2e68700
...
...
@@ -310,7 +310,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_ms
);
int
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