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
a852b36f
Commit
a852b36f
authored
Jun 10, 2017
by
Alastair Robertson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use BCC to resolve ksyms
parent
62303f49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
src/bpftrace.cpp
src/bpftrace.cpp
+11
-3
No files found.
src/bpftrace.cpp
View file @
a852b36f
...
...
@@ -2,6 +2,9 @@
#include <iostream>
#include <sstream>
#include "bcc_syms.h"
#include "syms.h"
#include "bpftrace.h"
#include "attached_probe.h"
...
...
@@ -263,7 +266,7 @@ std::vector<uint8_t> BPFtrace::find_empty_key(Map &map, size_t size) const
std
::
string
BPFtrace
::
get_stack
(
uint64_t
stackid
,
int
indent
)
const
{
auto
stack_trace
=
std
::
vector
<
void
*
>
(
MAX_STACK_SIZE
);
auto
stack_trace
=
std
::
vector
<
uint64_t
>
(
MAX_STACK_SIZE
);
int
err
=
bpf_lookup_elem
(
stackid_map_
->
mapfd_
,
&
stackid
,
stack_trace
.
data
());
if
(
err
)
{
...
...
@@ -273,13 +276,18 @@ std::string BPFtrace::get_stack(uint64_t stackid, int indent) const
std
::
ostringstream
stack
;
std
::
string
padding
(
indent
,
' '
);
struct
bcc_symbol
sym
;
KSyms
ksyms
;
stack
<<
"
\n
"
;
for
(
auto
&
addr
:
stack_trace
)
{
if
(
addr
==
nullptr
)
if
(
addr
==
0
)
break
;
stack
<<
padding
<<
(
void
*
)
addr
<<
std
::
endl
;
if
(
ksyms
.
resolve_addr
(
addr
,
&
sym
))
stack
<<
padding
<<
sym
.
name
<<
"+"
<<
sym
.
offset
<<
std
::
endl
;
else
stack
<<
padding
<<
(
void
*
)
addr
<<
std
::
endl
;
}
return
stack
.
str
();
...
...
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