mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 01:58:44 +08:00
record: Use only related uptime low/high events
In case of overflows, we may have an RTEMS_RECORD_UPTIME_HIGH event as the first event. This uptime high event has no associated RTEMS_RECORD_UPTIME_LOW event.
This commit is contained in:
committed by
Chris Johns
parent
464a37ac07
commit
30fc123f8d
@@ -100,6 +100,11 @@ typedef struct {
|
||||
*/
|
||||
uint32_t uptime_low;
|
||||
|
||||
/**
|
||||
* @brief If true, then uptime low value is valid.
|
||||
*/
|
||||
bool uptime_low_valid;
|
||||
|
||||
/**
|
||||
* @brief If true, then hold back items.
|
||||
*/
|
||||
|
||||
@@ -308,18 +308,24 @@ static rtems_record_client_status visit(
|
||||
break;
|
||||
case RTEMS_RECORD_UPTIME_LOW:
|
||||
per_cpu->uptime_low = (uint32_t) data;
|
||||
per_cpu->uptime_low_valid = true;
|
||||
break;
|
||||
case RTEMS_RECORD_UPTIME_HIGH:
|
||||
per_cpu->uptime.uptime_bt = ( data << 32 ) | per_cpu->uptime_low;
|
||||
per_cpu->uptime.time_last = time;
|
||||
per_cpu->uptime.time_accumulated = 0;
|
||||
if ( per_cpu->uptime_low_valid ) {
|
||||
per_cpu->uptime_low_valid = false;
|
||||
per_cpu->uptime.uptime_bt = ( data << 32 ) | per_cpu->uptime_low;
|
||||
per_cpu->uptime.time_last = time;
|
||||
per_cpu->uptime.time_accumulated = 0;
|
||||
|
||||
if (do_hold_back) {
|
||||
status = resolve_hold_back( ctx, per_cpu );
|
||||
if (do_hold_back) {
|
||||
status = resolve_hold_back( ctx, per_cpu );
|
||||
|
||||
if ( status != RTEMS_RECORD_CLIENT_SUCCESS ) {
|
||||
return status;
|
||||
if ( status != RTEMS_RECORD_CLIENT_SUCCESS ) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
do_hold_back = false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user