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
040df7d3
Commit
040df7d3
authored
May 04, 2016
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cc: Style fixes
parent
10436451
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
30 deletions
+28
-30
src/cc/bcc_syms.cc
src/cc/bcc_syms.cc
+2
-3
src/cc/frontends/clang/b_frontend_action.cc
src/cc/frontends/clang/b_frontend_action.cc
+13
-13
src/cc/usdt.cc
src/cc/usdt.cc
+13
-14
No files found.
src/cc/bcc_syms.cc
View file @
040df7d3
...
...
@@ -31,9 +31,8 @@ ino_t ProcStat::getinode_() {
return
(
!
stat
(
procfs_
.
c_str
(),
&
s
))
?
s
.
st_ino
:
-
1
;
}
ProcStat
::
ProcStat
(
int
pid
)
:
procfs_
(
tfm
::
format
(
"/proc/%d/exe"
,
pid
)),
inode_
(
getinode_
())
{}
ProcStat
::
ProcStat
(
int
pid
)
:
procfs_
(
tfm
::
format
(
"/proc/%d/exe"
,
pid
)),
inode_
(
getinode_
())
{}
void
KSyms
::
_add_symbol
(
const
char
*
symname
,
uint64_t
addr
,
void
*
p
)
{
KSyms
*
ks
=
static_cast
<
KSyms
*>
(
p
);
...
...
src/cc/frontends/clang/b_frontend_action.cc
View file @
040df7d3
...
...
@@ -481,8 +481,8 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
rewriter_
.
ReplaceText
(
SourceRange
(
Call
->
getLocStart
(),
Call
->
getLocEnd
()),
text
);
}
else
if
(
Decl
->
getName
()
==
"bpf_usdt_readarg"
)
{
text
=
"_bpf_readarg_"
+
current_fn_
+
"_"
+
args
[
0
]
+
"("
+
args
[
1
]
+
", "
+
args
[
2
]
+
", sizeof(*("
+
args
[
2
]
+
")))"
;
text
=
"_bpf_readarg_"
+
current_fn_
+
"_"
+
args
[
0
]
+
"("
+
args
[
1
]
+
", "
+
args
[
2
]
+
", sizeof(*("
+
args
[
2
]
+
")))"
;
rewriter_
.
ReplaceText
(
SourceRange
(
Call
->
getLocStart
(),
Call
->
getLocEnd
()),
text
);
}
...
...
src/cc/usdt.cc
View file @
040df7d3
...
...
@@ -53,8 +53,8 @@ bool Probe::in_shared_object() {
bool
Probe
::
resolve_global_address
(
uint64_t
*
global
,
const
uint64_t
addr
)
{
if
(
in_shared_object
())
{
return
(
pid_
&&
!
bcc_resolve_global_addr
(
*
pid_
,
bin_path_
.
c_str
(),
addr
,
global
));
return
(
pid_
&&
!
bcc_resolve_global_addr
(
*
pid_
,
bin_path_
.
c_str
(),
addr
,
global
));
}
*
global
=
addr
;
...
...
@@ -162,8 +162,8 @@ bool Probe::usdt_getarg(std::ostream &stream) {
if
(
locations_
.
size
()
==
1
)
{
Location
&
location
=
locations_
.
front
();
stream
<<
" "
;
if
(
!
location
.
arguments_
[
arg_n
].
assign_to_local
(
stream
,
cptr
,
bin_path_
,
pid_
))
if
(
!
location
.
arguments_
[
arg_n
].
assign_to_local
(
stream
,
cptr
,
bin_path_
,
pid_
))
return
false
;
stream
<<
"
\n
return 0;
\n
}
\n
"
;
}
else
{
...
...
@@ -175,8 +175,8 @@ bool Probe::usdt_getarg(std::ostream &stream) {
return
false
;
tfm
::
format
(
stream
,
" case 0x%xULL: "
,
global_address
);
if
(
!
location
.
arguments_
[
arg_n
].
assign_to_local
(
stream
,
cptr
,
bin_path_
,
pid_
))
if
(
!
location
.
arguments_
[
arg_n
].
assign_to_local
(
stream
,
cptr
,
bin_path_
,
pid_
))
return
false
;
stream
<<
" return 0;
\n
"
;
...
...
@@ -211,8 +211,8 @@ void Context::add_probe(const char *binpath, const struct bcc_elf_usdt *probe) {
}
}
probes_
.
emplace_back
(
new
Probe
(
binpath
,
probe
->
provider
,
probe
->
name
,
probe
->
semaphore
,
pid_
));
probes_
.
emplace_back
(
new
Probe
(
binpath
,
probe
->
provider
,
probe
->
name
,
probe
->
semaphore
,
pid_
));
probes_
.
back
()
->
add_location
(
probe
->
pc
,
probe
->
arg_fmt
);
}
...
...
@@ -282,8 +282,7 @@ Context::Context(int pid) : pid_(pid), pid_stat_(pid), loaded_(false) {
Context
::~
Context
()
{
if
(
pid_stat_
&&
!
pid_stat_
->
is_stale
())
{
for
(
auto
&
p
:
probes_
)
p
->
disable
();
for
(
auto
&
p
:
probes_
)
p
->
disable
();
}
}
}
...
...
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