Loading libs/common_time/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE_TAGS := optional LOCAL_MODULE := common_time LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code include $(BUILD_EXECUTABLE) libs/common_time/clock_recovery.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #define __STDC_LIMIT_MACROS #define LOG_TAG "common_time" #include <utils/Log.h> #include <inttypes.h> #include <stdint.h> #include <common_time/local_clock.h> Loading Loading @@ -280,7 +281,7 @@ bool ClockRecoveryLoop::pushDisciplineEvent(int64_t local_time, // system. setTargetCorrection_l(tgt_correction); LOG_TS("clock_loop %lld %f %f %f %d\n", raw_delta, delta_f, CO, CObias, tgt_correction); LOG_TS("clock_loop %" PRId64 " %f %f %f %d\n", raw_delta, delta_f, CO, CObias, tgt_correction); #ifdef TIME_SERVICE_DEBUG diag_thread_->pushDisciplineEvent( Loading Loading @@ -335,7 +336,6 @@ void ClockRecoveryLoop::setTargetCorrection_l(int32_t tgt) { // 300mSec. if (tgt_correction_ != tgt) { int64_t now = local_clock_->getLocalTime(); status_t res; tgt_correction_ = tgt; Loading libs/common_time/clock_recovery.h +0 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ class ClockRecoveryLoop { bool last_error_est_valid_; int32_t last_error_est_usec_; float last_delta_f_; int32_t integrated_error_; int32_t tgt_correction_; int32_t cur_correction_; LinearTransform time_to_cur_slew_; Loading libs/common_time/common_clock.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define LOG_TAG "common_time" #include <utils/Log.h> #include <inttypes.h> #include <stdint.h> #include <utils/Errors.h> Loading Loading @@ -50,7 +51,7 @@ bool CommonClock::init(uint64_t local_freq) { LinearTransform::reduce(&numer, &denom); if ((numer > UINT32_MAX) || (denom > UINT32_MAX)) { ALOGE("Overflow in CommonClock::init while trying to reduce %lld/%lld", ALOGE("Overflow in CommonClock::init while trying to reduce %" PRIu64 "/%" PRIu64, kCommonFreq, local_freq); return false; } Loading libs/common_time/common_time_server.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <arpa/inet.h> #include <assert.h> #include <fcntl.h> #include <inttypes.h> #include <linux/if_ether.h> #include <net/if.h> #include <net/if_arp.h> Loading Loading @@ -969,13 +970,14 @@ bool CommonTimeServer::handleSyncResponse( // if the RTT of the packet is significantly larger than the panic // threshold, we should simply discard it. Its better to do nothing // than to take cues from a packet like that. int rttCommon = mCommonClock.localDurationToCommonDuration(rtt); int64_t rttCommon = mCommonClock.localDurationToCommonDuration(rtt); if (rttCommon > (static_cast<int64_t>(mPanicThresholdUsec) * kRTTDiscardPanicThreshMultiplier)) { ALOGV("Dropping sync response with RTT of %lld uSec", rttCommon); ALOGV("Dropping sync response with RTT of %" PRId64 " uSec", rttCommon); mClient_ExpiredSyncRespsRXedFromCurMaster++; if (shouldPanicNotGettingGoodData()) return becomeInitial("RX panic, no good data"); return true; } else { result = mClockRecovery.pushDisciplineEvent(avgLocal, avgCommon, rttCommon); mClient_LastGoodSyncRX = clientRxLocalTime; Loading Loading
libs/common_time/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -33,4 +33,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE_TAGS := optional LOCAL_MODULE := common_time LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code include $(BUILD_EXECUTABLE)
libs/common_time/clock_recovery.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #define __STDC_LIMIT_MACROS #define LOG_TAG "common_time" #include <utils/Log.h> #include <inttypes.h> #include <stdint.h> #include <common_time/local_clock.h> Loading Loading @@ -280,7 +281,7 @@ bool ClockRecoveryLoop::pushDisciplineEvent(int64_t local_time, // system. setTargetCorrection_l(tgt_correction); LOG_TS("clock_loop %lld %f %f %f %d\n", raw_delta, delta_f, CO, CObias, tgt_correction); LOG_TS("clock_loop %" PRId64 " %f %f %f %d\n", raw_delta, delta_f, CO, CObias, tgt_correction); #ifdef TIME_SERVICE_DEBUG diag_thread_->pushDisciplineEvent( Loading Loading @@ -335,7 +336,6 @@ void ClockRecoveryLoop::setTargetCorrection_l(int32_t tgt) { // 300mSec. if (tgt_correction_ != tgt) { int64_t now = local_clock_->getLocalTime(); status_t res; tgt_correction_ = tgt; Loading
libs/common_time/clock_recovery.h +0 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ class ClockRecoveryLoop { bool last_error_est_valid_; int32_t last_error_est_usec_; float last_delta_f_; int32_t integrated_error_; int32_t tgt_correction_; int32_t cur_correction_; LinearTransform time_to_cur_slew_; Loading
libs/common_time/common_clock.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define LOG_TAG "common_time" #include <utils/Log.h> #include <inttypes.h> #include <stdint.h> #include <utils/Errors.h> Loading Loading @@ -50,7 +51,7 @@ bool CommonClock::init(uint64_t local_freq) { LinearTransform::reduce(&numer, &denom); if ((numer > UINT32_MAX) || (denom > UINT32_MAX)) { ALOGE("Overflow in CommonClock::init while trying to reduce %lld/%lld", ALOGE("Overflow in CommonClock::init while trying to reduce %" PRIu64 "/%" PRIu64, kCommonFreq, local_freq); return false; } Loading
libs/common_time/common_time_server.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <arpa/inet.h> #include <assert.h> #include <fcntl.h> #include <inttypes.h> #include <linux/if_ether.h> #include <net/if.h> #include <net/if_arp.h> Loading Loading @@ -969,13 +970,14 @@ bool CommonTimeServer::handleSyncResponse( // if the RTT of the packet is significantly larger than the panic // threshold, we should simply discard it. Its better to do nothing // than to take cues from a packet like that. int rttCommon = mCommonClock.localDurationToCommonDuration(rtt); int64_t rttCommon = mCommonClock.localDurationToCommonDuration(rtt); if (rttCommon > (static_cast<int64_t>(mPanicThresholdUsec) * kRTTDiscardPanicThreshMultiplier)) { ALOGV("Dropping sync response with RTT of %lld uSec", rttCommon); ALOGV("Dropping sync response with RTT of %" PRId64 " uSec", rttCommon); mClient_ExpiredSyncRespsRXedFromCurMaster++; if (shouldPanicNotGettingGoodData()) return becomeInitial("RX panic, no good data"); return true; } else { result = mClockRecovery.pushDisciplineEvent(avgLocal, avgCommon, rttCommon); mClient_LastGoodSyncRX = clientRxLocalTime; Loading