summaryrefslogtreecommitdiff
path: root/libcutils/trace-dev.cpp
diff options
context:
space:
mode:
authorHridya Valsaraju <hridya@google.com>2020-01-30 17:34:46 -0800
committerHridya Valsaraju <hridya@google.com>2020-01-30 17:38:51 -0800
commit6a879b25d9cab14e4fd2880f711ab26c6aa99e1c (patch)
treeb9af86c5098c8d3491ba5444f571e5c9fd568f45 /libcutils/trace-dev.cpp
parentb2066fda6dba2be06992e046f3219dc89a9a64c3 (diff)
Check /sys/kernel/tracing for tracefs
When debugfs is not mounted, atrace should look for tracefs in /sys/kernel/tracing. Test: CtsAtraceHostTestCases Bug: 148436518 Change-Id: I45c0e664892bcda277fd9612106ad5216aea0a1b
Diffstat (limited to 'libcutils/trace-dev.cpp')
-rw-r--r--libcutils/trace-dev.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcutils/trace-dev.cpp b/libcutils/trace-dev.cpp
index 2ee39d328..9ca172973 100644
--- a/libcutils/trace-dev.cpp
+++ b/libcutils/trace-dev.cpp
@@ -32,6 +32,10 @@ static void atrace_init_once()
{
atrace_marker_fd = open("/sys/kernel/debug/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);
+ }
+
+ if (atrace_marker_fd == -1) {
ALOGE("Error opening trace file: %s (%d)", strerror(errno), errno);
atrace_enabled_tags = 0;
} else {