Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bpftrace
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
bpftrace
Commits
834a8eae
Commit
834a8eae
authored
Aug 07, 2017
by
Alastair Robertson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert BPFtrace::start() to BPFtrace::run() and properly detach BEGIN and END probes
parent
02b11f46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
12 deletions
+5
-12
src/bpftrace.cpp
src/bpftrace.cpp
+3
-7
src/bpftrace.h
src/bpftrace.h
+1
-2
src/main.cpp
src/main.cpp
+1
-3
No files found.
src/bpftrace.cpp
View file @
834a8eae
...
...
@@ -131,7 +131,7 @@ std::unique_ptr<AttachedProbe> BPFtrace::attach_probe(Probe &probe)
return
nullptr
;
}
int
BPFtrace
::
start
()
int
BPFtrace
::
run
()
{
for
(
Probe
&
probe
:
special_probes_
)
{
...
...
@@ -156,10 +156,11 @@ int BPFtrace::start()
}
poll_perf_events
(
epollfd
);
attached_probes_
.
clear
();
END_trigger
();
poll_perf_events
(
epollfd
,
100
);
special_attached_probes_
.
clear
();
return
0
;
}
...
...
@@ -220,11 +221,6 @@ void BPFtrace::poll_perf_events(int epollfd, int timeout)
return
;
}
void
BPFtrace
::
stop
()
{
attached_probes_
.
clear
();
}
int
BPFtrace
::
print_maps
()
const
{
for
(
auto
&
mapmap
:
maps_
)
...
...
src/bpftrace.h
View file @
834a8eae
...
...
@@ -17,8 +17,7 @@ public:
explicit
BPFtrace
(
const
std
::
string
&
path
)
:
bpftrace_path_
(
path
)
{
}
virtual
~
BPFtrace
()
{
}
virtual
int
add_probe
(
ast
::
Probe
&
p
);
int
start
();
void
stop
();
int
run
();
int
print_maps
()
const
;
std
::
string
get_stack
(
uint32_t
stackid
,
bool
ustack
,
int
indent
=
0
)
const
;
...
...
src/main.cpp
View file @
834a8eae
...
...
@@ -97,12 +97,10 @@ int main(int argc, char *argv[])
std
::
cout
<<
"Running... press Ctrl-C to stop"
<<
std
::
endl
;
err
=
bpftrace
.
start
();
err
=
bpftrace
.
run
();
if
(
err
)
return
err
;
bpftrace
.
stop
();
std
::
cout
<<
"
\n\n
"
;
err
=
bpftrace
.
print_maps
();
...
...
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