[PATCH 4/9] unwind: rename public functions object-oriented

Masatake YAMATO yamato at redhat.com
Tue Mar 13 17:28:09 UTC 2018


This change renames functions exported to strace core part from unwind
subsystem.

The new names implies unwind subsystem exports two types of functions.
One is for manipulating back-end itself. "unwind_" prefix is for this type.
The another is for manipulating back-end private data structure (unwind_ctx)
attached to tcb. "unwind_tcb_" is for this type.

The name helps people understand unwind subsystem and the relation between
unwind subsystem and back-ends.

* defs.h (unwind_tcb_print): is renamed from `unwind_print_stacktrace'.
(unwind_tcb_capture): is renamed from `unwind_capture_stacktrace`.
* unwind.c: Ditto.
* syscall.c (syscall_entering_trace): Use the new names.
(syscall_exiting_trace): Ditto.

Signed-off-by: Masatake YAMATO <yamato at redhat.com>
---
 defs.h    | 4 ++--
 syscall.c | 4 ++--
 unwind.c  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/defs.h b/defs.h
index b456791e..e7bb537c 100644
--- a/defs.h
+++ b/defs.h
@@ -735,8 +735,8 @@ extern void tv_div(struct timeval *, const struct timeval *, int);
 extern void unwind_init(void);
 extern void unwind_tcb_init(struct tcb *);
 extern void unwind_tcb_fin(struct tcb *);
-extern void unwind_print_stacktrace(struct tcb *);
-extern void unwind_capture_stacktrace(struct tcb *);
+extern void unwind_tcb_print(struct tcb *);
+extern void unwind_tcb_capture(struct tcb *);
 #endif
 
 static inline int
diff --git a/syscall.c b/syscall.c
index c72beda9..aba7883c 100644
--- a/syscall.c
+++ b/syscall.c
@@ -693,7 +693,7 @@ syscall_entering_trace(struct tcb *tcp, unsigned int *sig)
 #ifdef CAN_UNWIND
 	if (stack_trace_enabled) {
 		if (tcp->s_ent->sys_flags & STACKTRACE_CAPTURE_ON_ENTER)
-			unwind_capture_stacktrace(tcp);
+			unwind_tcb_capture(tcp);
 	}
 #endif
 
@@ -952,7 +952,7 @@ syscall_exiting_trace(struct tcb *tcp, struct timeval tv, int res)
 
 #ifdef CAN_UNWIND
 	if (stack_trace_enabled)
-		unwind_print_stacktrace(tcp);
+		unwind_tcb_print(tcp);
 #endif
 	return 0;
 }
diff --git a/unwind.c b/unwind.c
index 14a656a4..f5b25fa3 100644
--- a/unwind.c
+++ b/unwind.c
@@ -385,7 +385,7 @@ queue_print(struct unwind_queue_t *queue)
  * printing stack
  */
 void
-unwind_print_stacktrace(struct tcb *tcp)
+unwind_tcb_print(struct tcb *tcp)
 {
 	struct unwind_queue_t *queue;
 
@@ -417,7 +417,7 @@ unwind_print_stacktrace(struct tcb *tcp)
  * capturing stack
  */
 void
-unwind_capture_stacktrace(struct tcb *tcp)
+unwind_tcb_capture(struct tcb *tcp)
 {
 	struct unwind_queue_t *queue;
 
-- 
2.14.3



More information about the Strace-devel mailing list