record: Add uptime event to fatal dump

This commit is contained in:
Sebastian Huber
2024-10-21 07:53:18 +02:00
committed by Chris Johns
parent 0f2721c832
commit 464a37ac07
2 changed files with 58 additions and 6 deletions

View File

@@ -34,6 +34,7 @@
#include <rtems/bspIo.h>
#include <rtems/score/isrlock.h>
#include <rtems/score/smpimpl.h>
#include <rtems/score/timecounter.h>
#if ISR_LOCK_NEEDS_OBJECT
static ISR_lock_Control _Record_Dump_base64_lock =
@@ -49,13 +50,38 @@ void _Record_Fatal_dump_base64(
)
{
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 (

View File

@@ -34,6 +34,7 @@
#include <rtems/bspIo.h>
#include <rtems/score/isrlock.h>
#include <rtems/score/smpimpl.h>
#include <rtems/score/timecounter.h>
#if ISR_LOCK_NEEDS_OBJECT
static ISR_lock_Control _Record_Dump_base64_zlib_lock =
@@ -51,13 +52,38 @@ void _Record_Fatal_dump_base64_zlib(
)
{
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 (