Commit b282f0a3 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/snmpd: add the time of last servo update

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 3acd87a2
......@@ -1588,7 +1588,8 @@ WrsPtpDataEntry ::=
wrsPtpDeltaRxS Integer32,
wrsPtpServoStateErrCnt Counter32,
wrsPtpClockOffsetErrCnt Counter32,
wrsPtpRTTErrCnt Counter32
wrsPtpRTTErrCnt Counter32,
wrsPtpServoUpdateTime Counter64
}
wrsPtpDataIndex OBJECT-TYPE
......@@ -1783,6 +1784,14 @@ wrsPtpRTTErrCnt OBJECT-TYPE
"Number of servo updates with wrong RTT"
::= { wrsPtpDataEntry 22 }
wrsPtpServoUpdateTime OBJECT-TYPE
SYNTAX Counter64
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"TAI Nanosecond of the last servo's update"
::= { wrsPtpDataEntry 23 }
-- wrsPortStatusTable (.7.6)
wrsPortStatusTable OBJECT-TYPE
SYNTAX SEQUENCE OF WrsPortStatusEntry
......
......@@ -28,6 +28,8 @@ static struct pickinfo wrsPtpDataTable_pickinfo[] = {
FIELD(wrsPtpDataTable_s, ASN_COUNTER, n_err_state),
FIELD(wrsPtpDataTable_s, ASN_COUNTER, n_err_offset),
FIELD(wrsPtpDataTable_s, ASN_COUNTER, n_err_delta_rtt),
FIELD(wrsPtpDataTable_s, ASN_COUNTER64, update_time),
};
static int32_t int_saturate(int64_t value)
......@@ -110,6 +112,9 @@ time_t wrsPtpDataTable_data_fill(unsigned int *n_rows)
wrsPtpDataTable_array[0].n_err_state = ppsi_servo->n_err_state;
wrsPtpDataTable_array[0].n_err_offset = ppsi_servo->n_err_offset;
wrsPtpDataTable_array[0].n_err_delta_rtt = ppsi_servo->n_err_delta_rtt;
wrsPtpDataTable_array[0].update_time =
(((uint64_t) ppsi_servo->update_time.seconds) * 1000000000LL)
+ ppsi_servo->update_time.nanoseconds;
retries++;
if (retries > 100) {
snmp_log(LOG_ERR, "%s: too many retries to read PPSI\n",
......
......@@ -33,6 +33,7 @@ struct wrsPtpDataTable_s {
uint32_t n_err_state;
uint32_t n_err_offset;
uint32_t n_err_delta_rtt;
uint64_t update_time;
};
extern struct wrsPtpDataTable_s wrsPtpDataTable_array[WRS_MAX_N_SERVO_INSTANCES];
......
......@@ -507,6 +507,7 @@ struct dump_info servo_state_info [] = {
DUMP_FIELD(UInteger32, n_err_state),
DUMP_FIELD(UInteger32, n_err_offset),
DUMP_FIELD(UInteger32, n_err_delta_rtt),
DUMP_FIELD(TimeInternal, update_time),
};
#undef DUMP_STRUCT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment