summaryrefslogtreecommitdiff
path: root/libcutils/trace-dev.cpp
diff options
context:
space:
mode:
authorHridya Valsaraju <hridya@google.com>2020-09-12 15:37:39 -0700
committerHridya Valsaraju <hridya@google.com>2020-09-14 20:04:43 +0000
commit355ff8c7c15310df1159e2a9290c50d24317c600 (patch)
tree4266986481cd15d9f69e3273f8d83668b8c09dce /libcutils/trace-dev.cpp
parent72a0f10f518a981d67612c6832a86f03c586c877 (diff)
libcutils must check /sys/kernel/tracing for tracefs first
Currently it falls back to /sys/kernel/tracing if debugfs is not found. /sys/kernel/tracing must be checked first since debugfs is not allowed to be mounted in user builds starting with Android R launching devices. Test: manual Change-Id: I2fb5ec91bbf7d5304a1a6efcb06530969485e78f
Diffstat (limited to 'libcutils/trace-dev.cpp')
-rw-r--r--libcutils/trace-dev.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcutils/trace-dev.cpp b/libcutils/trace-dev.cpp
index 5a09a2d39..1ab63dc2f 100644
--- a/libcutils/trace-dev.cpp
+++ b/libcutils/trace-dev.cpp
@@ -30,9 +30,9 @@ void atrace_set_tracing_enabled(bool enabled)
static void atrace_init_once()
{
- atrace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_WRONLY | O_CLOEXEC);
+ atrace_marker_fd = open("/sys/kernel/tracing/trace_marker", O_WRONLY | O_CLOEXEC);
if (atrace_marker_fd == -1) {
- atrace_marker_fd = open("/sys/kernel/tracing/trace_marker", O_WRONLY | O_CLOEXEC);
+ atrace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_WRONLY | O_CLOEXEC);
}
if (atrace_marker_fd == -1) {