diff --git a/libc/bionic/bionic_systrace.cpp b/libc/bionic/bionic_systrace.cpp
index 06f4505..fd97712 100644
--- a/libc/bionic/bionic_systrace.cpp
+++ b/libc/bionic/bionic_systrace.cpp
@@ -14,41 +14,36 @@
  * limitations under the License.
  */
 
-#include "private/bionic_systrace.h"
-
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#include "private/bionic_lock.h"
+#include "private/bionic_systrace.h"
+#include "private/CachedProperty.h"
+
 #include <async_safe/log.h>
 #include <cutils/trace.h> // For ATRACE_TAG_BIONIC.
 
-#include "private/CachedProperty.h"
-#include "private/bionic_lock.h"
-
 #define WRITE_OFFSET   32
 
 static Lock g_lock;
+static CachedProperty g_debug_atrace_tags_enableflags("debug.atrace.tags.enableflags");
 static uint64_t g_tags;
 static int g_trace_marker_fd = -1;
 
-static CachedProperty& GetTagsProp() {
-  static CachedProperty cached_property(kTraceTagsProp);
-  return cached_property;
-}
-
-bool should_trace(const uint64_t enable_tags) {
+static bool should_trace() {
   g_lock.lock();
-  if (GetTagsProp().DidChange()) {
-    g_tags = strtoull(GetTagsProp().Get(), nullptr, 0);
+  if (g_debug_atrace_tags_enableflags.DidChange()) {
+    g_tags = strtoull(g_debug_atrace_tags_enableflags.Get(), nullptr, 0);
   }
   g_lock.unlock();
-  return g_tags & enable_tags;
+  return ((g_tags & ATRACE_TAG_BIONIC) != 0);
 }
 
-int get_trace_marker_fd() {
+static int get_trace_marker_fd() {
   g_lock.lock();
   if (g_trace_marker_fd == -1) {
     g_trace_marker_fd = open("/sys/kernel/tracing/trace_marker", O_CLOEXEC | O_WRONLY);
@@ -60,8 +55,11 @@
   return g_trace_marker_fd;
 }
 
-// event could be 'B' for begin or 'E' for end.
-void output_trace(const char* message, const char event) {
+void bionic_trace_begin(const char* message) {
+  if (!should_trace()) {
+    return;
+  }
+
   int trace_marker_fd = get_trace_marker_fd();
   if (trace_marker_fd == -1) {
     return;
@@ -71,22 +69,13 @@
   // kernel trace_marker.
   int length = strlen(message);
   char buf[length + WRITE_OFFSET];
-  size_t len =
-      async_safe_format_buffer(buf, length + WRITE_OFFSET, "%c|%d|%s", event, getpid(), message);
+  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));
 }
 
-void bionic_trace_begin(const char* message) {
-  if (!should_trace()) {
-    return;
-  }
-
-  output_trace(message);
-}
-
 void bionic_trace_end() {
   if (!should_trace()) {
     return;
diff --git a/libc/bionic/system_property_set.cpp b/libc/bionic/system_property_set.cpp
index 6823b6a..212aafc 100644
--- a/libc/bionic/system_property_set.cpp
+++ b/libc/bionic/system_property_set.cpp
@@ -41,13 +41,12 @@
 #include <sys/_system_properties.h>
 #include <unistd.h>
 
-#include <async_safe/CHECK.h>
 #include <async_safe/log.h>
-#include <system_properties/prop_trace.h>
+#include <async_safe/CHECK.h>
 
+#include "private/bionic_defs.h"
 #include "platform/bionic/macros.h"
 #include "private/ScopedFd.h"
-#include "private/bionic_defs.h"
 
 static const char property_service_socket[] = "/dev/socket/" PROP_SERVICE_NAME;
 static const char* kServiceVersionPropertyName = "ro.property_service.version";
@@ -250,8 +249,6 @@
   if (key == nullptr) return -1;
   if (value == nullptr) value = "";
 
-  SyspropTrace trace(key, value, nullptr /* prop_info */, PropertyAction::kPropertySet);
-
   if (g_propservice_protocol_version == 0) {
     detect_protocol_version();
   }
