diff --git a/cpukit/include/rtems/recordclient.h b/cpukit/include/rtems/recordclient.h index f41a05c22d..55adc2059a 100644 --- a/cpukit/include/rtems/recordclient.h +++ b/cpukit/include/rtems/recordclient.h @@ -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. */ diff --git a/cpukit/libtrace/record/record-client.c b/cpukit/libtrace/record/record-client.c index ac2877aabc..e5102aa909 100644 --- a/cpukit/libtrace/record/record-client.c +++ b/cpukit/libtrace/record/record-client.c @@ -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;