From: Kalle Raita Date: Thu, 27 Apr 2017 18:43:27 +0000 (-0700) Subject: Log which watchdog timer was exceeded X-Git-Tag: upstream/0.1.0~150^2~1^2~49^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb2e496ff5f0c81f67052af9f30ad69f63458641;p=platform%2Fupstream%2FVK-GL-CTS.git Log which watchdog timer was exceeded Test: Timeout failure for max_concurrent.framebuffer on Marlin Change-Id: Ie8396c6506e09bbe94c6d5dc6c29fd6e20c7f436 --- diff --git a/framework/common/tcuApp.cpp b/framework/common/tcuApp.cpp index 409a677..7c49f7f 100644 --- a/framework/common/tcuApp.cpp +++ b/framework/common/tcuApp.cpp @@ -203,10 +203,10 @@ bool App::iterate (void) return platformOk && testExecOk; } -void App::onWatchdogTimeout (qpWatchDog* watchDog, void* userPtr) +void App::onWatchdogTimeout (qpWatchDog* watchDog, void* userPtr, qpTimeoutReason reason) { DE_UNREF(watchDog); - static_cast(userPtr)->onWatchdogTimeout(); + static_cast(userPtr)->onWatchdogTimeout(reason); } void App::onCrash (qpCrashHandler* crashHandler, void* userPtr) @@ -215,7 +215,7 @@ void App::onCrash (qpCrashHandler* crashHandler, void* userPtr) static_cast(userPtr)->onCrash(); } -void App::onWatchdogTimeout (void) +void App::onWatchdogTimeout (qpTimeoutReason reason) { if (!m_crashLock.tryLock() || m_crashed) return; // In crash handler already. @@ -223,7 +223,7 @@ void App::onWatchdogTimeout (void) m_crashed = true; m_testCtx->getLog().terminateCase(QP_TEST_RESULT_TIMEOUT); - die("Watchdog timer timeout"); + die("Watchdog timer timeout for %s", (reason == QP_TIMEOUT_REASON_INTERVAL_LIMIT ? "touch interval" : "total time")); } static void writeCrashToLog (void* userPtr, const char* infoString) diff --git a/framework/common/tcuApp.hpp b/framework/common/tcuApp.hpp index 8233eb3..e714160 100644 --- a/framework/common/tcuApp.hpp +++ b/framework/common/tcuApp.hpp @@ -69,10 +69,10 @@ public: protected: void cleanup (void); - void onWatchdogTimeout (void); + void onWatchdogTimeout (qpTimeoutReason reason); void onCrash (void); - static void onWatchdogTimeout (qpWatchDog* watchDog, void* userPtr); + static void onWatchdogTimeout (qpWatchDog* watchDog, void* userPtr, qpTimeoutReason reason); static void onCrash (qpCrashHandler* crashHandler, void* userPtr); Platform& m_platform; diff --git a/framework/qphelper/qpWatchDog.c b/framework/qphelper/qpWatchDog.c index 84957b8..c691aa2 100644 --- a/framework/qphelper/qpWatchDog.c +++ b/framework/qphelper/qpWatchDog.c @@ -69,11 +69,14 @@ static void watchDogThreadFunc (void* arg) deUint64 curTime = deGetMicroseconds(); int totalSecondsPassed = (int)((curTime - dog->resetTime) / 1000000ull); int secondsSinceLastTouch = (int)((curTime - dog->lastTouchTime) / 1000000ull); + deBool overIntervalLimit = secondsSinceLastTouch > dog->intervalTimeLimit; + deBool overTotalLimit = totalSecondsPassed > dog->totalTimeLimit; - if ((secondsSinceLastTouch > dog->intervalTimeLimit) || (totalSecondsPassed > dog->totalTimeLimit)) + if (overIntervalLimit || overTotalLimit) { + qpTimeoutReason reason = overTotalLimit ? QP_TIMEOUT_REASON_TOTAL_LIMIT : QP_TIMEOUT_REASON_INTERVAL_LIMIT; DBGPRINT(("watchDogThreadFunc(): call timeout func\n")); - dog->timeOutFunc(dog, dog->timeOutUserPtr); + dog->timeOutFunc(dog, dog->timeOutUserPtr, reason); break; } diff --git a/framework/qphelper/qpWatchDog.h b/framework/qphelper/qpWatchDog.h index 6ac8f6a..6247e66 100644 --- a/framework/qphelper/qpWatchDog.h +++ b/framework/qphelper/qpWatchDog.h @@ -27,7 +27,15 @@ typedef struct qpWatchDog_s qpWatchDog; -typedef void (*qpWatchDogFunc) (qpWatchDog* dog, void* userPtr); +typedef enum qpTimeoutReason_e +{ + QP_TIMEOUT_REASON_INTERVAL_LIMIT = 0, + QP_TIMEOUT_REASON_TOTAL_LIMIT, + + QP_TIMEOUT_REASON_LAST +} qpTimeoutReason; + +typedef void (*qpWatchDogFunc) (qpWatchDog* dog, void* userPtr, qpTimeoutReason reason); DE_BEGIN_EXTERN_C