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
a597f7c9
Commit
a597f7c9
authored
May 01, 2016
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cc: Implement `bcc_resolve_global_addr` helper
parent
7575c64d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
src/cc/bcc_syms.cc
src/cc/bcc_syms.cc
+26
-0
src/cc/bcc_syms.h
src/cc/bcc_syms.h
+2
-0
No files found.
src/cc/bcc_syms.cc
View file @
a597f7c9
...
...
@@ -199,6 +199,32 @@ void bcc_symcache_refresh(void *resolver) {
cache
->
refresh
();
}
struct
mod_st
{
const
char
*
name
;
uint64_t
start
;
};
static
int
_find_module
(
const
char
*
modname
,
uint64_t
start
,
uint64_t
end
,
void
*
p
)
{
struct
mod_st
*
mod
=
(
struct
mod_st
*
)
p
;
if
(
!
strcmp
(
modname
,
mod
->
name
))
{
mod
->
start
=
start
;
return
-
1
;
}
return
0
;
}
int
bcc_resolve_global_addr
(
int
pid
,
const
char
*
module
,
const
uint64_t
address
,
uint64_t
*
global
)
{
struct
mod_st
mod
=
{
module
,
0x0
};
if
(
bcc_procutils_each_module
(
pid
,
_find_module
,
&
mod
)
<
0
||
mod
.
start
==
0x0
)
return
-
1
;
*
global
=
mod
.
start
+
address
;
return
0
;
}
static
int
_find_sym
(
const
char
*
symname
,
uint64_t
addr
,
uint64_t
end
,
int
flags
,
void
*
payload
)
{
struct
bcc_symbol
*
sym
=
(
struct
bcc_symbol
*
)
payload
;
...
...
src/cc/bcc_syms.h
View file @
a597f7c9
...
...
@@ -33,6 +33,8 @@ int bcc_symcache_resolve(void *symcache, uint64_t addr, struct bcc_symbol *sym);
int
bcc_symcache_resolve_name
(
void
*
resolver
,
const
char
*
name
,
uint64_t
*
addr
);
void
bcc_symcache_refresh
(
void
*
resolver
);
int
bcc_resolve_global_addr
(
int
pid
,
const
char
*
module
,
const
uint64_t
address
,
uint64_t
*
global
);
int
bcc_find_symbol_addr
(
struct
bcc_symbol
*
sym
);
int
bcc_resolve_symname
(
const
char
*
module
,
const
char
*
symname
,
const
uint64_t
addr
,
struct
bcc_symbol
*
sym
);
...
...
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