unwind: give all exported functions "unwind_" prefix
* unwind.c (init_unwind_addr_space): Rename to unwind_init. (init_libunwind_ui): Rename to unwind_tcb_init. (free_libunwind_ui): Rename to unwind_tcb_fin. (delete_mmap_cache): Rename to unwind_cache_invalidate. (print_stacktrace): Rename to unwind_print_stacktrace. * defs.h: Update prototypes. * mem.c: All callers updated. * process.c: Likewise. * strace.c: Likewise. * syscall.c: Likewise. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This commit is contained in:
10
defs.h
10
defs.h
@@ -732,11 +732,11 @@ extern void tv_mul(struct timeval *, const struct timeval *, int);
|
|||||||
extern void tv_div(struct timeval *, const struct timeval *, int);
|
extern void tv_div(struct timeval *, const struct timeval *, int);
|
||||||
|
|
||||||
#ifdef USE_LIBUNWIND
|
#ifdef USE_LIBUNWIND
|
||||||
extern void init_unwind_addr_space(void);
|
extern void unwind_init(void);
|
||||||
extern void init_libunwind_ui(struct tcb *tcp);
|
extern void unwind_tcb_init(struct tcb *tcp);
|
||||||
extern void free_libunwind_ui(struct tcb *tcp);
|
extern void unwind_tcb_fin(struct tcb *tcp);
|
||||||
extern void delete_mmap_cache(struct tcb* tcp);
|
extern void unwind_cache_invalidate(struct tcb* tcp);
|
||||||
extern void print_stacktrace(struct tcb* tcp);
|
extern void unwind_print_stacktrace(struct tcb* tcp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Strace log generation machinery.
|
/* Strace log generation machinery.
|
||||||
|
|||||||
6
mem.c
6
mem.c
@@ -62,7 +62,7 @@ print_mmap(struct tcb *tcp, long *u_arg, unsigned long long offset)
|
|||||||
if (entering(tcp)) {
|
if (entering(tcp)) {
|
||||||
#ifdef USE_LIBUNWIND
|
#ifdef USE_LIBUNWIND
|
||||||
if (stack_trace_enabled)
|
if (stack_trace_enabled)
|
||||||
delete_mmap_cache(tcp);
|
unwind_cache_invalidate(tcp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* addr */
|
/* addr */
|
||||||
@@ -197,7 +197,7 @@ sys_munmap(struct tcb *tcp)
|
|||||||
#ifdef USE_LIBUNWIND
|
#ifdef USE_LIBUNWIND
|
||||||
else {
|
else {
|
||||||
if (stack_trace_enabled)
|
if (stack_trace_enabled)
|
||||||
delete_mmap_cache(tcp);
|
unwind_cache_invalidate(tcp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
@@ -214,7 +214,7 @@ sys_mprotect(struct tcb *tcp)
|
|||||||
#ifdef USE_LIBUNWIND
|
#ifdef USE_LIBUNWIND
|
||||||
else {
|
else {
|
||||||
if (stack_trace_enabled)
|
if (stack_trace_enabled)
|
||||||
delete_mmap_cache(tcp);
|
unwind_cache_invalidate(tcp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -802,7 +802,7 @@ sys_execve(struct tcb *tcp)
|
|||||||
#ifdef USE_LIBUNWIND
|
#ifdef USE_LIBUNWIND
|
||||||
else {
|
else {
|
||||||
if (stack_trace_enabled)
|
if (stack_trace_enabled)
|
||||||
delete_mmap_cache(tcp);
|
unwind_cache_invalidate(tcp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
6
strace.c
6
strace.c
@@ -706,7 +706,7 @@ alloctcb(int pid)
|
|||||||
|
|
||||||
#ifdef USE_LIBUNWIND
|
#ifdef USE_LIBUNWIND
|
||||||
if (stack_trace_enabled)
|
if (stack_trace_enabled)
|
||||||
init_libunwind_ui(tcp);
|
unwind_tcb_init(tcp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nprocs++;
|
nprocs++;
|
||||||
@@ -747,7 +747,7 @@ droptcb(struct tcb *tcp)
|
|||||||
|
|
||||||
#ifdef USE_LIBUNWIND
|
#ifdef USE_LIBUNWIND
|
||||||
if (stack_trace_enabled) {
|
if (stack_trace_enabled) {
|
||||||
free_libunwind_ui(tcp);
|
unwind_tcb_fin(tcp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
memset(tcp, 0, sizeof(*tcp));
|
memset(tcp, 0, sizeof(*tcp));
|
||||||
@@ -1818,7 +1818,7 @@ init(int argc, char *argv[])
|
|||||||
|
|
||||||
#ifdef USE_LIBUNWIND
|
#ifdef USE_LIBUNWIND
|
||||||
if (stack_trace_enabled)
|
if (stack_trace_enabled)
|
||||||
init_unwind_addr_space();
|
unwind_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!followfork)
|
if (!followfork)
|
||||||
|
|||||||
@@ -2708,7 +2708,7 @@ trace_syscall_exiting(struct tcb *tcp)
|
|||||||
|
|
||||||
#ifdef USE_LIBUNWIND
|
#ifdef USE_LIBUNWIND
|
||||||
if (stack_trace_enabled)
|
if (stack_trace_enabled)
|
||||||
print_stacktrace(tcp);
|
unwind_print_stacktrace(tcp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret:
|
ret:
|
||||||
|
|||||||
12
unwind.c
12
unwind.c
@@ -51,7 +51,7 @@ struct mmap_cache_t {
|
|||||||
static unw_addr_space_t libunwind_as;
|
static unw_addr_space_t libunwind_as;
|
||||||
|
|
||||||
void
|
void
|
||||||
init_unwind_addr_space(void)
|
unwind_init(void)
|
||||||
{
|
{
|
||||||
libunwind_as = unw_create_addr_space(&_UPT_accessors, 0);
|
libunwind_as = unw_create_addr_space(&_UPT_accessors, 0);
|
||||||
if (!libunwind_as)
|
if (!libunwind_as)
|
||||||
@@ -59,7 +59,7 @@ init_unwind_addr_space(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
init_libunwind_ui(struct tcb *tcp)
|
unwind_tcb_init(struct tcb *tcp)
|
||||||
{
|
{
|
||||||
tcp->libunwind_ui = _UPT_create(tcp->pid);
|
tcp->libunwind_ui = _UPT_create(tcp->pid);
|
||||||
if (!tcp->libunwind_ui)
|
if (!tcp->libunwind_ui)
|
||||||
@@ -67,9 +67,9 @@ init_libunwind_ui(struct tcb *tcp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
free_libunwind_ui(struct tcb *tcp)
|
unwind_tcb_fin(struct tcb *tcp)
|
||||||
{
|
{
|
||||||
delete_mmap_cache(tcp);
|
unwind_cache_invalidate(tcp);
|
||||||
_UPT_destroy(tcp->libunwind_ui);
|
_UPT_destroy(tcp->libunwind_ui);
|
||||||
tcp->libunwind_ui = NULL;
|
tcp->libunwind_ui = NULL;
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ alloc_mmap_cache(struct tcb* tcp)
|
|||||||
|
|
||||||
/* deleting the cache */
|
/* deleting the cache */
|
||||||
void
|
void
|
||||||
delete_mmap_cache(struct tcb* tcp)
|
unwind_cache_invalidate(struct tcb* tcp)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (i = 0; i < tcp->mmap_cache_size; i++) {
|
for (i = 0; i < tcp->mmap_cache_size; i++) {
|
||||||
@@ -171,7 +171,7 @@ delete_mmap_cache(struct tcb* tcp)
|
|||||||
|
|
||||||
/* use libunwind to unwind the stack and print a backtrace */
|
/* use libunwind to unwind the stack and print a backtrace */
|
||||||
void
|
void
|
||||||
print_stacktrace(struct tcb* tcp)
|
unwind_print_stacktrace(struct tcb* tcp)
|
||||||
{
|
{
|
||||||
unw_word_t ip;
|
unw_word_t ip;
|
||||||
unw_cursor_t cursor;
|
unw_cursor_t cursor;
|
||||||
|
|||||||
Reference in New Issue
Block a user