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

Commit 6245591a authored by Ravneet's avatar Ravneet Committed by Ravneet Dhanjal
Browse files

Camera: Remove tid and pid from abort message

- Remove pid and tid from abort message
so it can be used to dupe watchdog bugs
that were triggered by the same call

Bug: 279520262
Test: Tested manually
Change-Id: I0d6d11544caf68353afdbf4aa6ba6bfa086b36d4
Merged-In: I0d6d11544caf68353afdbf4aa6ba6bfa086b36d4
(cherry picked from commit a925d0d5)
parent ffd9771b
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -43,8 +43,7 @@ bool CameraServiceWatchdog::threadLoop()
            mTidMap[currentThreadId].cycles++;

            if (mTidMap[currentThreadId].cycles >= mMaxCycles) {
                std::string abortMessage = getAbortMessage(getpid(), currentThreadId,
                        mTidMap[currentThreadId].functionName);
                std::string abortMessage = getAbortMessage(mTidMap[currentThreadId].functionName);
                android_set_abort_message(abortMessage.c_str());
                ALOGW("CameraServiceWatchdog triggering abort for pid: %d tid: %d", getpid(),
                        currentThreadId);
@@ -60,10 +59,9 @@ bool CameraServiceWatchdog::threadLoop()
    return true;
}

std::string CameraServiceWatchdog::getAbortMessage(int pid, int tid, std::string functionName) {
std::string CameraServiceWatchdog::getAbortMessage(const std::string& functionName) {
    std::string res = "CameraServiceWatchdog triggering abort during "
            + functionName + " | pid: " + std::to_string(pid)
            + " tid: " + std::to_string(tid);
            + functionName;
    return res;
}

+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ private:
     */
    void stop(uint32_t tid);

    std::string getAbortMessage(int pid, int tid, std::string functionName);
    std::string getAbortMessage(const std::string& functionName);

    virtual bool    threadLoop();