diff --git a/cpukit/libtrace/record/record-dump-fatal.c b/cpukit/libtrace/record/record-dump-fatal.c index 6f015be434..c3b4656a34 100644 --- a/cpukit/libtrace/record/record-dump-fatal.c +++ b/cpukit/libtrace/record/record-dump-fatal.c @@ -34,6 +34,7 @@ #include #include #include +#include #if ISR_LOCK_NEEDS_OBJECT static ISR_lock_Control _Record_Dump_base64_lock = @@ -48,14 +49,39 @@ void _Record_Fatal_dump_base64( Internal_errors_t code ) { - ISR_lock_Context lock_context; + ISR_lock_Context lock_context; + Per_CPU_Control *cpu_self; + rtems_record_context record_context; + sbintime_t now; - rtems_record_produce_2( + cpu_self = _Per_CPU_Get(); + + now = _Timecounter_Sbinuptime(); + rtems_record_prepare_critical( &record_context, cpu_self ); + rtems_record_add( + &record_context, + RTEMS_RECORD_UPTIME_LOW, + (uint32_t) ( now >> 0 ) + ); + rtems_record_add( + &record_context, + RTEMS_RECORD_UPTIME_HIGH, + (uint32_t) ( now >> 32 ) + ); + rtems_record_commit_critical( &record_context ); + + rtems_record_prepare_critical( &record_context, cpu_self ); + rtems_record_add( + &record_context, RTEMS_RECORD_FATAL_SOURCE, - source, + source + ); + rtems_record_add( + &record_context, RTEMS_RECORD_FATAL_CODE, code ); + rtems_record_commit_critical( &record_context ); #if defined(RTEMS_SMP) if ( diff --git a/cpukit/libtrace/record/record-dump-zfatal.c b/cpukit/libtrace/record/record-dump-zfatal.c index b7ec8e9cef..836439dc6a 100644 --- a/cpukit/libtrace/record/record-dump-zfatal.c +++ b/cpukit/libtrace/record/record-dump-zfatal.c @@ -34,6 +34,7 @@ #include #include #include +#include #if ISR_LOCK_NEEDS_OBJECT static ISR_lock_Control _Record_Dump_base64_zlib_lock = @@ -50,14 +51,39 @@ void _Record_Fatal_dump_base64_zlib( Internal_errors_t code ) { - ISR_lock_Context lock_context; + ISR_lock_Context lock_context; + Per_CPU_Control *cpu_self; + rtems_record_context record_context; + sbintime_t now; - rtems_record_produce_2( + cpu_self = _Per_CPU_Get(); + + now = _Timecounter_Sbinuptime(); + rtems_record_prepare_critical( &record_context, cpu_self ); + rtems_record_add( + &record_context, + RTEMS_RECORD_UPTIME_LOW, + (uint32_t) ( now >> 0 ) + ); + rtems_record_add( + &record_context, + RTEMS_RECORD_UPTIME_HIGH, + (uint32_t) ( now >> 32 ) + ); + rtems_record_commit_critical( &record_context ); + + rtems_record_prepare_critical( &record_context, cpu_self ); + rtems_record_add( + &record_context, RTEMS_RECORD_FATAL_SOURCE, - source, + source + ); + rtems_record_add( + &record_context, RTEMS_RECORD_FATAL_CODE, code ); + rtems_record_commit_critical( &record_context ); #if defined(RTEMS_SMP) if (