Added code for set rt nap stats for clock spin as well. However, this might not be necessary.

This commit is contained in:
Hong Chen 2024-02-20 11:49:10 -06:00
parent 7e94be8bcc
commit 9e87908352
4 changed files with 14 additions and 3 deletions

View File

@ -74,6 +74,7 @@ extern "C" {
int exec_set_version_date_tag(const char * tag) ;
int exec_set_build_date(const char * date) ;
int exec_set_current_version(const char * version) ;
void exec_set_rt_nap_stats(long long clock_time_before_rt_nap, long long clock_time_after_rt_nap) ;
int exec_freeze(void) ;
int exec_run(void) ;

View File

@ -10,7 +10,6 @@ PROGRAMMERS:
#include "trick/Clock.hh"
#include "trick/exec_proto.h"
#include "trick/exec_proto.hh"
#include "trick/release.h"
Trick::Clock * the_clock = NULL ;
@ -93,7 +92,7 @@ long long Trick::Clock::clock_spin(long long req_time) {
time_before_rt_nap = wall_clock_time() ;
RELEASE();
time_after_rt_nap = wall_clock_time() ;
exec_get_exec_cpp()->set_rt_nap_stats(time_before_rt_nap, time_after_rt_nap) ;
exec_set_rt_nap_stats(time_before_rt_nap, time_after_rt_nap) ;
}
curr_time = clock_time();
}

View File

@ -21,7 +21,7 @@ BASE_OBJECTS = ../object_${TRICK_HOST_CPU}/Clock.o\
../object_${TRICK_HOST_CPU}/clock_c_intf.o
GETTIMEOFDAY_CLOCK_OBJECTS = ${BASE_OBJECTS} GetTimeOfDayClock_test.o ../object_${TRICK_HOST_CPU}/GetTimeOfDayClock.o exec_get_rt_nap_stub.o
GETTIMEOFDAY_CLOCK_OBJECTS = ${BASE_OBJECTS} GetTimeOfDayClock_test.o ../object_${TRICK_HOST_CPU}/GetTimeOfDayClock.o exec_get_rt_nap_stub.o exec_set_rt_nap_stats.o
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.

View File

@ -737,6 +737,17 @@ extern "C" const char * exec_get_current_version() {
return NULL ;
}
/**
* @relates Trick::Executive
* @copydoc Trick::Executive::set_rt_nap_stats
* C wrapper for Trick::Executive::set_rt_nap_stats
*/
extern "C" void exec_set_rt_nap_stats(long long clock_time_before_rt_nap, long long clock_time_after_rt_nap) {
if ( the_exec != NULL ) {
the_exec->set_rt_nap_stats(clock_time_before_rt_nap, clock_time_before_rt_nap) ;
}
}
/**
* @relates Trick::Executive
* @userdesc Raise a signal on the main thread to terminate the simuation immediately.