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

Commit ce109907 authored by jiabin's avatar jiabin Committed by Jiabin Huang
Browse files

Log patch information for mmap thread to metrics.

Bug: 343263100
Bug: 393216891
Test: run mmap audio, check metrics log
Flag: EXEMPT bugfix
Change-Id: I161e0dc9ca74d1081bb16a12cd6eead9e2f8269f
parent f2498667
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -10651,7 +10651,9 @@ status_t MmapThread::start(const AudioClient& client,
        chain->incActiveTrackCnt();
    }

    track->logBeginInterval(patchSinksToString(&mPatch)); // log to MediaMetrics
    // log to MediaMetrics
    track->logBeginInterval(
            isOutput() ? patchSinksToString(&mPatch) : patchSourcesToString(&mPatch));
    *handle = portId;

    if (mActiveTracks.size() == 1) {
@@ -11004,6 +11006,16 @@ NO_THREAD_SAFETY_ANALYSIS // elease and re-acquire mutex()
    // Force meteadata update after a route change
    mActiveTracks.setHasChanged();

    const std::string patchSourcesAsString = isOutput() ? "" : patchSourcesToString(patch);
    const std::string patchSinksAsString = isOutput() ? patchSinksToString(patch) : "";
    mThreadMetrics.logEndInterval();
    mThreadMetrics.logCreatePatch(patchSourcesAsString, patchSinksAsString);
    mThreadMetrics.logBeginInterval();
    for (const auto &track : mActiveTracks) {
        track->logEndInterval();
        track->logBeginInterval(isOutput() ? patchSinksAsString : patchSourcesAsString);
    }

    return status;
}