bionic: Check /sys/kernel/tracing for tracefs

tracefs will be mounted at /sys/kernel/tracing when debugfs
is not mounted.

Bug: 134669095
Test: atest bionic-unit-tests-static
Change-Id: Ic224cf13500efc570da8b6a27ce925bbcf068fdd
This commit is contained in:
Hridya Valsaraju 2020-02-07 11:53:08 -08:00
parent f7c40da307
commit ad5f772dba
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,10 @@ static bool should_trace() {
static int get_trace_marker_fd() {
g_lock.lock();
if (g_trace_marker_fd == -1) {
g_trace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_CLOEXEC | O_WRONLY);
g_trace_marker_fd = open("/sys/kernel/tracing/trace_marker", O_CLOEXEC | O_WRONLY);
if (g_trace_marker_fd == -1) {
g_trace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_CLOEXEC | O_WRONLY);
}
}
g_lock.unlock();
return g_trace_marker_fd;