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

Commit fa3add33 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

logd: report log reader instantiation

Helpful instrumentation to determine who is waiting for logger data.

Test: manual
Bug: 37274132
Bug: 37378309
Change-Id: I14fb1d9d15ae413930121048b770852359f06682
parent 0bdf6539
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */

#include <ctype.h>
#include <inttypes.h>
#include <poll.h>
#include <sys/prctl.h>
#include <sys/socket.h>
@@ -192,6 +193,12 @@ bool LogReader::onDataAvailable(SocketClient* cli) {
        }
    }

    android::prdebug(
        "logdr: UID=%d GID=%d PID=%d %c tail=%lu logMask=%x pid=%d "
        "start=%" PRIu64 "ns timeout=%" PRIu64 "ns\n",
        cli->getUid(), cli->getGid(), cli->getPid(), nonBlock ? 'n' : 'b', tail,
        logMask, (int)pid, sequence.nsec(), timeout);

    FlushCommand command(*this, nonBlock, tail, logMask, pid, sequence, timeout);

    // Set acceptable upper limit to wait for slow reader processing b/27242723