diff options
author | Daniel Micay <danielmicay@gmail.com> | 2016-07-16 23:55:16 -0400 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2021-09-27 21:17:05 +0800 |
commit | d528b759d06a99b38194bbdd70c6cf796364e0c3 (patch) | |
tree | 1e9e853f65e2cbd74c10337dede6c77e43e19529 | |
parent | 42021c199c896dc5084c849e2b1d109c1517495e (diff) |
[GrapheneOS] replace VLA formatting with dprintf-like function
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
Change-Id: I28e78134218139920a9f44a813dcd3f39523db22
-rw-r--r-- | libc/bionic/bionic_systrace.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/libc/bionic/bionic_systrace.cpp b/libc/bionic/bionic_systrace.cpp index fd9771298..acd9b7681 100644 --- a/libc/bionic/bionic_systrace.cpp +++ b/libc/bionic/bionic_systrace.cpp @@ -27,8 +27,6 @@ #include <async_safe/log.h> #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; @@ -65,15 +63,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 = async_safe_format_buffer(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)); + async_safe_format_fd(trace_marker_fd, "B|%d|%s", getpid(), message); } void bionic_trace_end() { |