[sheepdog] [PATCH] trace: fix deadlock of current code when tracer is enabled

Liu Yuan namei.unix at gmail.com
Fri Feb 1 09:24:50 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

Mark functions that are needed by logger as notrace.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 lib/logger.c |    4 ++--
 lib/util.c   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/logger.c b/lib/logger.c
index c41c90a..f3f03e3 100644
--- a/lib/logger.c
+++ b/lib/logger.c
@@ -268,8 +268,8 @@ static notrace void log_syslog(const struct logmsg *msg)
 		syslog(msg->prio, "%s", str);
 }
 
-static void init_logmsg(struct logmsg *msg, struct timeval *tv, int prio,
-			const char *func, int line)
+static notrace void init_logmsg(struct logmsg *msg, struct timeval *tv,
+				int prio, const char *func, int line)
 {
 	msg->tv = *tv;
 	msg->prio = prio;
diff --git a/lib/util.c b/lib/util.c
index 79249bc..5c94cf3 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -235,7 +235,7 @@ ssize_t xpwrite(int fd, const void *buf, size_t count, off_t offset)
  * @param buf_size size of destination buffer
  * @param str source string
  */
-void pstrcpy(char *buf, int buf_size, const char *str)
+void notrace pstrcpy(char *buf, int buf_size, const char *str)
 {
 	int c;
 	char *q = buf;
-- 
1.7.9.5




More information about the sheepdog mailing list