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
76bec4d5
Commit
76bec4d5
authored
Mar 26, 2018
by
yonghong-song
Committed by
GitHub
Mar 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1652 from palmtenor/stack_fixes
Two minor fixes on Stack-trace table
parents
955b55ec
7bfa4a11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
src/cc/api/BPFTable.cc
src/cc/api/BPFTable.cc
+4
-0
src/cc/export/helpers.h
src/cc/export/helpers.h
+2
-1
No files found.
src/cc/api/BPFTable.cc
View file @
76bec4d5
...
@@ -178,6 +178,8 @@ void BPFStackTable::clear_table_non_atomic() {
...
@@ -178,6 +178,8 @@ void BPFStackTable::clear_table_non_atomic() {
std
::
vector
<
uintptr_t
>
BPFStackTable
::
get_stack_addr
(
int
stack_id
)
{
std
::
vector
<
uintptr_t
>
BPFStackTable
::
get_stack_addr
(
int
stack_id
)
{
std
::
vector
<
uintptr_t
>
res
;
std
::
vector
<
uintptr_t
>
res
;
stacktrace_t
stack
;
stacktrace_t
stack
;
if
(
stack_id
<
0
)
return
res
;
if
(
!
lookup
(
&
stack_id
,
&
stack
))
if
(
!
lookup
(
&
stack_id
,
&
stack
))
return
res
;
return
res
;
for
(
int
i
=
0
;
(
i
<
BPF_MAX_STACK_DEPTH
)
&&
(
stack
.
ip
[
i
]
!=
0
);
i
++
)
for
(
int
i
=
0
;
(
i
<
BPF_MAX_STACK_DEPTH
)
&&
(
stack
.
ip
[
i
]
!=
0
);
i
++
)
...
@@ -189,6 +191,8 @@ std::vector<std::string> BPFStackTable::get_stack_symbol(int stack_id,
...
@@ -189,6 +191,8 @@ std::vector<std::string> BPFStackTable::get_stack_symbol(int stack_id,
int
pid
)
{
int
pid
)
{
auto
addresses
=
get_stack_addr
(
stack_id
);
auto
addresses
=
get_stack_addr
(
stack_id
);
std
::
vector
<
std
::
string
>
res
;
std
::
vector
<
std
::
string
>
res
;
if
(
addresses
.
empty
())
return
res
;
res
.
reserve
(
addresses
.
size
());
res
.
reserve
(
addresses
.
size
());
if
(
pid
<
0
)
if
(
pid
<
0
)
...
...
src/cc/export/helpers.h
View file @
76bec4d5
...
@@ -20,6 +20,7 @@ R"********(
...
@@ -20,6 +20,7 @@ R"********(
#include <uapi/linux/bpf.h>
#include <uapi/linux/bpf.h>
#include <uapi/linux/if_packet.h>
#include <uapi/linux/if_packet.h>
#include <linux/version.h>
#include <linux/version.h>
#include <linux/log2.h>
#ifndef CONFIG_BPF_SYSCALL
#ifndef CONFIG_BPF_SYSCALL
#error "
CONFIG_BPF_SYSCALL
is
undefined
,
please
check
your
.
config
or
ask
your
Linux
distro
to
enable
this
feature
"
#error "
CONFIG_BPF_SYSCALL
is
undefined
,
please
check
your
.
config
or
ask
your
Linux
distro
to
enable
this
feature
"
...
@@ -184,7 +185,7 @@ struct bpf_stacktrace {
...
@@ -184,7 +185,7 @@ struct bpf_stacktrace {
};
};
#define BPF_STACK_TRACE(_name, _max_entries) \
#define BPF_STACK_TRACE(_name, _max_entries) \
BPF_TABLE("
stacktrace
", int, struct bpf_stacktrace, _name,
_max_entries
)
BPF_TABLE("
stacktrace
", int, struct bpf_stacktrace, _name,
roundup_pow_of_two(_max_entries)
)
#define BPF_PROG_ARRAY(_name, _max_entries) \
#define BPF_PROG_ARRAY(_name, _max_entries) \
BPF_TABLE("
prog
", u32, u32, _name, _max_entries)
BPF_TABLE("
prog
", u32, u32, _name, _max_entries)
...
...
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