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

Commit 388d5714 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Rename logWriterTLS to tlNBLogWriter

Bug: 37153050
Test: builds OK
Change-Id: I6b6d673fc02942d4ea7d2022fce06ec2b0e42c2e
parent 1c446273
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -91,9 +91,9 @@ FastThread::~FastThread()

bool FastThread::threadLoop()
{
    // LOGT now works even if logWriterTLS is nullptr, but we're considering changing that,
    // LOGT now works even if tlNBLogWriter is nullptr, but we're considering changing that,
    // so this initialization permits a future change to remove the check for nullptr.
    logWriterTLS = &mDummyNBLogWriter;
    tlNBLogWriter = &mDummyNBLogWriter;
    for (;;) {

        // either nanosleep, sched_yield, or busy wait
@@ -125,7 +125,7 @@ bool FastThread::threadLoop()
            mDumpState = next->mDumpState != NULL ? next->mDumpState : mDummyDumpState;
            mNBLogWriter = next->mNBLogWriter != NULL ? next->mNBLogWriter : &mDummyNBLogWriter;
            setNBLogWriter(mNBLogWriter);   // FastMixer informs its AudioMixer, FastCapture ignores
            logWriterTLS = mNBLogWriter;
            tlNBLogWriter = mNBLogWriter;

            // We want to always have a valid reference to the previous (non-idle) state.
            // However, the state queue only guarantees access to current and previous states.
+1 −1
Original line number Diff line number Diff line
@@ -2930,7 +2930,7 @@ void AudioFlinger::PlaybackThread::detachAuxEffect_l(int effectId)

bool AudioFlinger::PlaybackThread::threadLoop()
{
    logWriterTLS = mNBLogWriter.get();
    tlNBLogWriter = mNBLogWriter.get();

    Vector< sp<Track> > tracksToRemove;

+1 −1
Original line number Diff line number Diff line
@@ -23,5 +23,5 @@
#include "TypedLogger.h"

namespace android {
thread_local NBLog::Writer *logWriterTLS;
thread_local NBLog::Writer *tlNBLogWriter;
}
+4 −4
Original line number Diff line number Diff line
@@ -82,21 +82,21 @@ constexpr uint64_t hash(const char (&file)[n], uint32_t line) {
//      slower than nullptr check when logging is enabled at compile-time and disabled at runtime.

// Write formatted entry to log
#define LOGT(fmt, ...) do { NBLog::Writer *x = logWriterTLS; if (x != nullptr) \
#define LOGT(fmt, ...) do { NBLog::Writer *x = tlNBLogWriter; if (x != nullptr) \
                                x->logFormat((fmt), hash(__FILE__, __LINE__), ##__VA_ARGS__); } \
                                while (0)

// Write histogram timestamp entry
#define LOG_HIST_TS() do { NBLog::Writer *x = logWriterTLS; if (x != nullptr) \
#define LOG_HIST_TS() do { NBLog::Writer *x = tlNBLogWriter; if (x != nullptr) \
                                x->logHistTS(hash(__FILE__, __LINE__)); } while(0)

// flush all histogram
#define LOG_HIST_FLUSH() do { NBLog::Writer *x = logWriterTLS; if (x != nullptr) \
#define LOG_HIST_FLUSH() do { NBLog::Writer *x = tlNBLogWriter; if (x != nullptr) \
                                x->logHistFlush(hash(__FILE__, __LINE__)); } while(0)

namespace android {
extern "C" {
extern thread_local NBLog::Writer *logWriterTLS;
extern thread_local NBLog::Writer *tlNBLogWriter;
}
} // namespace android