From 0c44d8d68d56c7aecb828d8d87fba7dcb114f3d9 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Thu, 29 Jun 2023 09:26:09 -0700 Subject: [PATCH] Make atrace_*_body explicitly a part of API. Also, remove leftover atrace_set_debuggable(bool) symbol. Bug: 289151149 Test: it builds Change-Id: Id9fdf9451567d85b64971a6bb409336b12d3f535 --- libcutils/include/cutils/trace.h | 40 ++++++++++++++++++++++++-------- libcutils/trace-host.cpp | 1 - 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/libcutils/include/cutils/trace.h b/libcutils/include/cutils/trace.h index 3867f3469..7f57637ec 100644 --- a/libcutils/include/cutils/trace.h +++ b/libcutils/include/cutils/trace.h @@ -89,6 +89,36 @@ __BEGIN_DECLS #error ATRACE_TAG must be defined to be one of the tags defined in cutils/trace.h #endif +/** Internal implementation detail. Do not use. */ +void atrace_begin_body(const char*); + +/** Internal implementation detail. Do not use. */ +void atrace_end_body(); + +/** Internal implementation detail. Do not use. */ +void atrace_async_begin_body(const char*, int32_t); + +/** Internal implementation detail. Do not use. */ +void atrace_async_end_body(const char*, int32_t); + +/** Internal implementation detail. Do not use. */ +void atrace_async_for_track_begin_body(const char*, const char*, int32_t); + +/** Internal implementation detail. Do not use. */ +void atrace_async_for_track_end_body(const char*, int32_t); + +/** Internal implementation detail. Do not use. */ +void atrace_instant_body(const char*); + +/** Internal implementation detail. Do not use. */ +void atrace_instant_for_track_body(const char*, const char*); + +/** Internal implementation detail. Do not use. */ +void atrace_int_body(const char*, int32_t); + +/** Internal implementation detail. Do not use. */ +void atrace_int64_body(const char*, int64_t); + /** * Opens the trace file for writing and reads the property for initial tags. * The atrace.tags.enableflags property sets the tags to trace. @@ -159,7 +189,6 @@ static inline uint64_t atrace_is_tag_enabled(uint64_t tag) static inline void atrace_begin(uint64_t tag, const char* name) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_begin_body(const char*); atrace_begin_body(name); } } @@ -172,7 +201,6 @@ static inline void atrace_begin(uint64_t tag, const char* name) static inline void atrace_end(uint64_t tag) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_end_body(); atrace_end_body(); } } @@ -190,7 +218,6 @@ static inline void atrace_async_begin(uint64_t tag, const char* name, int32_t cookie) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_async_begin_body(const char*, int32_t); atrace_async_begin_body(name, cookie); } } @@ -203,7 +230,6 @@ static inline void atrace_async_begin(uint64_t tag, const char* name, static inline void atrace_async_end(uint64_t tag, const char* name, int32_t cookie) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_async_end_body(const char*, int32_t); atrace_async_end_body(name, cookie); } } @@ -221,7 +247,6 @@ static inline void atrace_async_end(uint64_t tag, const char* name, int32_t cook static inline void atrace_async_for_track_begin(uint64_t tag, const char* track_name, const char* name, int32_t cookie) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_async_for_track_begin_body(const char*, const char*, int32_t); atrace_async_for_track_begin_body(track_name, name, cookie); } } @@ -235,7 +260,6 @@ static inline void atrace_async_for_track_begin(uint64_t tag, const char* track_ static inline void atrace_async_for_track_end(uint64_t tag, const char* track_name, int32_t cookie) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_async_for_track_end_body(const char*, int32_t); atrace_async_for_track_end_body(track_name, cookie); } } @@ -252,7 +276,6 @@ static inline void atrace_async_for_track_end(uint64_t tag, const char* track_na #define ATRACE_INSTANT(name) atrace_instant(ATRACE_TAG, name) static inline void atrace_instant(uint64_t tag, const char* name) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_instant_body(const char*); atrace_instant_body(name); } } @@ -269,7 +292,6 @@ static inline void atrace_instant(uint64_t tag, const char* name) { static inline void atrace_instant_for_track(uint64_t tag, const char* track_name, const char* name) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_instant_for_track_body(const char*, const char*); atrace_instant_for_track_body(track_name, name); } } @@ -282,7 +304,6 @@ static inline void atrace_instant_for_track(uint64_t tag, const char* track_name static inline void atrace_int(uint64_t tag, const char* name, int32_t value) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_int_body(const char*, int32_t); atrace_int_body(name, value); } } @@ -295,7 +316,6 @@ static inline void atrace_int(uint64_t tag, const char* name, int32_t value) static inline void atrace_int64(uint64_t tag, const char* name, int64_t value) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_int64_body(const char*, int64_t); atrace_int64_body(name, value); } } diff --git a/libcutils/trace-host.cpp b/libcutils/trace-host.cpp index e9f58c356..2bf57ebbe 100644 --- a/libcutils/trace-host.cpp +++ b/libcutils/trace-host.cpp @@ -20,7 +20,6 @@ atomic_bool atrace_is_ready = ATOMIC_VAR_INIT(true); int atrace_marker_fd = -1; uint64_t atrace_enabled_tags = 0; -void atrace_set_debuggable(bool /*debuggable*/) {} void atrace_set_tracing_enabled(bool /*enabled*/) {} void atrace_update_tags() { } void atrace_setup() { }