Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 929325dd authored by Primiano Tucci's avatar Primiano Tucci
Browse files

atrace: don't write the clock sync marker if --only_userspace

This CL has no other intended side effect than reducing
spam in logs.
--only_userspace is effectively used only by Perfetto.
Today the unconditional invocation of writeClockSyncMarker()
writes consistently, because perfetto invokes atrace before
writing 1 to tracing_on, and that makes the write to
trace_marker fail.
The failure has always been there and has always been fine.
This CL just silences it. I am planning to bubble up non-fatal
errors coming from atrace to the UI, this would be a confusing
false positive.

Bug: 171085599
Test: manual: perfetto -t 1s bionic am foobar -o trace;
              check logcat (no clock sync errors)
Change-Id: Ic9b9cef42465bae0214e73c0dbce9ed2d288fdc6
parent 3a26ff6d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1340,10 +1340,10 @@ int main(int argc, char **argv)
        // contain entries from only one CPU can cause "begin" entries without a
        // matching "end" entry to show up if a task gets migrated from one CPU to
        // another.
        if (!onlyUserspace)
        if (!onlyUserspace) {
            ok = clearTrace();

            writeClockSyncMarker();
        }
        if (ok && !async && !traceStream) {
            // Sleep to allow the trace to be captured.
            struct timespec timeLeft;