40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
![]() |
From 611e5691f7e48aba8529e49b22885021f322b31e Mon Sep 17 00:00:00 2001
|
||
|
From: Daniel Micay <danielmicay@gmail.com>
|
||
|
Date: Sat, 16 Jul 2016 23:55:16 -0400
|
||
|
Subject: [PATCH] replace VLA formatting buffer with dprintf
|
||
|
|
||
|
---
|
||
|
libc/bionic/bionic_systrace.cpp | 10 +---------
|
||
|
1 file changed, 1 insertion(+), 9 deletions(-)
|
||
|
|
||
|
diff --git a/libc/bionic/bionic_systrace.cpp b/libc/bionic/bionic_systrace.cpp
|
||
|
index bac3d88021..076e10dbfb 100644
|
||
|
--- a/libc/bionic/bionic_systrace.cpp
|
||
|
+++ b/libc/bionic/bionic_systrace.cpp
|
||
|
@@ -26,8 +26,6 @@
|
||
|
|
||
|
#include <cutils/trace.h> // For ATRACE_TAG_BIONIC.
|
||
|
|
||
|
-#define WRITE_OFFSET 32
|
||
|
-
|
||
|
static Lock g_lock;
|
||
|
static CachedProperty g_debug_atrace_tags_enableflags("debug.atrace.tags.enableflags");
|
||
|
static uint64_t g_tags;
|
||
|
@@ -61,15 +59,9 @@ void bionic_trace_begin(const char* message) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
- // If bionic tracing has been enabled, then write the message to the
|
||
|
- // kernel trace_marker.
|
||
|
- int length = strlen(message);
|
||
|
- char buf[length + WRITE_OFFSET];
|
||
|
- size_t len = snprintf(buf, length + WRITE_OFFSET, "B|%d|%s", getpid(), message);
|
||
|
-
|
||
|
// Tracing may stop just after checking property and before writing the message.
|
||
|
// So the write is acceptable to fail. See b/20666100.
|
||
|
- TEMP_FAILURE_RETRY(write(trace_marker_fd, buf, len));
|
||
|
+ dprintf(trace_marker_fd, "B|%d|%s", getpid(), message);
|
||
|
}
|
||
|
|
||
|
void bionic_trace_end() {
|