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

Commit 6cc025ba authored by Alec Mouri's avatar Alec Mouri
Browse files

Remove event thread connection metric.

It's not an actionable metric and is causing performance problems due to
lock contention. So, remove the code.

Bug: 170661858
Test: builds
Change-Id: I70fc2772d2cfa1c8364775427b1e8f08ce4ca0ff
parent dad32244
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -427,11 +427,6 @@ void EventThread::onFrameRateOverridesChanged(PhysicalDisplayId displayId,
    mCondition.notify_all();
}

size_t EventThread::getEventThreadConnectionCount() {
    std::lock_guard<std::mutex> lock(mMutex);
    return mDisplayEventConnections.size();
}

void EventThread::threadMain(std::unique_lock<std::mutex>& lock) {
    DisplayEventConsumers consumers;

+0 −5
Original line number Diff line number Diff line
@@ -131,9 +131,6 @@ public:
    virtual VsyncEventData getLatestVsyncEventData(
            const sp<EventThreadConnection>& connection) const = 0;

    // Retrieves the number of event connections tracked by this EventThread.
    virtual size_t getEventThreadConnectionCount() = 0;

    virtual void onNewVsyncSchedule(std::shared_ptr<scheduler::VsyncSchedule>) = 0;
};

@@ -172,8 +169,6 @@ public:
    void setDuration(std::chrono::nanoseconds workDuration,
                     std::chrono::nanoseconds readyDuration) override;

    size_t getEventThreadConnectionCount() override;

    void onNewVsyncSchedule(std::shared_ptr<scheduler::VsyncSchedule>) override EXCLUDES(mMutex);

private:
+0 −6
Original line number Diff line number Diff line
@@ -393,12 +393,6 @@ void Scheduler::onNonPrimaryDisplayModeChanged(ConnectionHandle handle, const Fr
    thread->onModeChanged(mode);
}

size_t Scheduler::getEventThreadConnectionCount(ConnectionHandle handle) {
    std::lock_guard<std::mutex> lock(mConnectionsLock);
    RETURN_IF_INVALID_HANDLE(handle, 0);
    return mConnections[handle].thread->getEventThreadConnectionCount();
}

void Scheduler::dump(ConnectionHandle handle, std::string& result) const {
    android::EventThread* thread;
    {
+0 −2
Original line number Diff line number Diff line
@@ -278,8 +278,6 @@ public:
    // Notifies the scheduler when the display size has changed. Called from SF's main thread
    void onActiveDisplayAreaChanged(uint32_t displayArea);

    size_t getEventThreadConnectionCount(ConnectionHandle handle);

    // Stores the preferred refresh rate that an app should run at.
    // FrameRateOverride.refreshRateHz == 0 means no preference.
    void setPreferredRefreshRateForUid(FrameRateOverride);
+0 −4
Original line number Diff line number Diff line
@@ -3002,10 +3002,6 @@ void SurfaceFlinger::postComposition(scheduler::FrameTargeter& pacesetterFrameTa
        }
    }

    const size_t sfConnections = mScheduler->getEventThreadConnectionCount(mSfConnectionHandle);
    const size_t appConnections = mScheduler->getEventThreadConnectionCount(mAppConnectionHandle);
    mTimeStats->recordDisplayEventConnectionCount(sfConnections + appConnections);

    if (isDisplayConnected && !defaultDisplay->isPoweredOn()) {
        getRenderEngine().cleanupPostRender();
        return;
Loading