From 1e980b6bc8315d00a07312b25486531247abd98c Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 17 Jan 2013 18:36:06 -0800 Subject: Fix the duplication in the debugging code. We had two copies of the backtrace code, and two copies of the libcorkscrew /proc/pid/maps code. This patch gets us down to one. We also had hacks so we could log in the malloc debugging code. This patch pulls the non-allocating "printf" code out of the dynamic linker so everyone can share. This patch also makes the leak diagnostics easier to read, and makes it possible to paste them directly into the 'stack' tool (by using relative PCs). This patch also fixes the stdio standard stream leak that was causing a leak warning every time tf_daemon ran. Bug: 7291287 Change-Id: I66e4083ac2c5606c8d2737cb45c8ac8a32c7cfe8 --- libc/bionic/pthread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc/bionic/pthread.c') diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c index f29472379..f2a7ebe44 100644 --- a/libc/bionic/pthread.c +++ b/libc/bionic/pthread.c @@ -50,6 +50,7 @@ #include "bionic_pthread.h" #include "bionic_ssp.h" #include "bionic_tls.h" +#include "debug_format.h" #include "pthread_internal.h" #include "thread_private.h" @@ -229,7 +230,7 @@ int _init_thread(pthread_internal_t* thread, pid_t kernel_id, const pthread_attr // For backwards compatibility reasons, we just warn about failures here. // error = errno; const char* msg = "pthread_create sched_setscheduler call failed: %s\n"; - __libc_android_log_print(ANDROID_LOG_WARN, "libc", msg, strerror(errno)); + __libc_format_log(ANDROID_LOG_WARN, "libc", msg, strerror(errno)); } } -- cgit v1.2.3