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

Commit f9715e43 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Distinguish systrace timelines for playback and capture

Bug: 30120068
Change-Id: If416540f0785e83e7b1e8ba986ee55b5b9298a2a
parent 9f639225
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ namespace android {

/*static*/ const FastCaptureState FastCapture::sInitial;

FastCapture::FastCapture() : FastThread(),
FastCapture::FastCapture() : FastThread("cycleC_ms", "loadC_us"),
    mInputSource(NULL), mInputSourceGen(0), mPipeSink(NULL), mPipeSinkGen(0),
    mReadBuffer(NULL), mReadBufferState(-1), mFormat(Format_Invalid), mSampleRate(0),
    // mDummyDumpState
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ namespace android {

/*static*/ const FastMixerState FastMixer::sInitial;

FastMixer::FastMixer() : FastThread(),
FastMixer::FastMixer() : FastThread("cycle_ms", "load_us"),
    // mFastTrackNames
    // mGenerations
    mOutputSink(NULL),
+7 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@

namespace android {

FastThread::FastThread() : Thread(false /*canCallJava*/),
FastThread::FastThread(const char *cycleMs, const char *loadUs) : Thread(false /*canCallJava*/),
    // re-initialized to &sInitial by subclass constructor
    mPrevious(NULL), mCurrent(NULL),
    /* mOldTs({0, 0}), */
@@ -72,11 +72,15 @@ FastThread::FastThread() : Thread(false /*canCallJava*/),
    frameCount(0),
#endif
    mAttemptedWrite(false)
    // mCycleMs(cycleMs)
    // mLoadUs(loadUs)
{
    mOldTs.tv_sec = 0;
    mOldTs.tv_nsec = 0;
    mMeasuredWarmupTs.tv_sec = 0;
    mMeasuredWarmupTs.tv_nsec = 0;
    strlcpy(mCycleMs, cycleMs, sizeof(mCycleMs));
    strlcpy(mLoadUs, loadUs, sizeof(mLoadUs));
}

FastThread::~FastThread()
@@ -336,8 +340,8 @@ bool FastThread::threadLoop()
                    // this store #4 is not atomic with respect to stores #1, #2, #3 above, but
                    // the newest open & oldest closed halves are atomic with respect to each other
                    mDumpState->mBounds = mBounds;
                    ATRACE_INT("cycle_ms", monotonicNs / 1000000);
                    ATRACE_INT("load_us", loadNs / 1000);
                    ATRACE_INT(mCycleMs, monotonicNs / 1000000);
                    ATRACE_INT(mLoadUs, loadNs / 1000);
                }
#endif
            } else {
+4 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ namespace android {
class FastThread : public Thread {

public:
            FastThread();
            FastThread(const char *cycleMs, const char *loadUs);
    virtual ~FastThread();

private:
@@ -88,6 +88,9 @@ protected:
    FastThreadState::Command mCommand;
    bool            mAttemptedWrite;

    char            mCycleMs[16];   // cycle_ms + suffix
    char            mLoadUs[16];    // load_us + suffix

};  // class FastThread

}   // android
+1 −1
Original line number Diff line number Diff line
@@ -6036,7 +6036,7 @@ reacquire_wakelock:

            // sleep with mutex unlocked
            if (sleepUs > 0) {
                ATRACE_BEGIN("sleep");
                ATRACE_BEGIN("sleepC");
                mWaitWorkCV.waitRelative(mLock, microseconds((nsecs_t)sleepUs));
                ATRACE_END();
                sleepUs = 0;