mirror of
https://github.com/nasa/trick.git
synced 2024-12-22 06:27:49 +00:00
19025d77ad
Reorganized. Created a new top level include directory that will hold all of Trick's header files. Moved all of the Trick headers to this directory. Created a libexec directory that holds all of the executables that users don't need to execute directly. Changed all of the executables remaining in bin to start with "trick-". In the sim_services directories changed all source files to find the Trick headers in their new location. Since all of the include files are gone in sim_services, removed the src directories as well, moving all of the source files up a level. Moved the makefiles, docs, man, and other architecture independent files into a top level share directory. Renamed lib_${TRICK_HOST_CPU} to lib64 or lib depending on the platform we're currently on. refs #63
127 lines
4.6 KiB
C++
127 lines
4.6 KiB
C++
|
|
#include <iostream>
|
|
#include <iomanip>
|
|
|
|
#include "trick/Executive.hh"
|
|
|
|
int Trick::Executive::instrument_job_before( std::string in_job , unsigned int instance ) {
|
|
|
|
Trick::JobData * instrument_job ;
|
|
|
|
instrument_job = get_job(in_job , instance) ;
|
|
return instrument_job_before( instrument_job ) ;
|
|
}
|
|
|
|
int Trick::Executive::instrument_job_before( Trick::JobData * instrument_job ) {
|
|
|
|
unsigned int ii, count ;
|
|
|
|
count = 0 ;
|
|
if ( instrument_job != NULL ) {
|
|
// instrument scheduled jobs
|
|
for ( ii = 0 ; ii < threads.size() ; ii++ ) {
|
|
count += threads[ii]->job_queue.instrument_before(instrument_job) ;
|
|
count += threads[ii]->top_of_frame_queue.instrument_before(instrument_job) ;
|
|
count += threads[ii]->end_of_frame_queue.instrument_before(instrument_job) ;
|
|
}
|
|
|
|
// instrument other queued jobs
|
|
// cannot instrument default_data because they come before input processor
|
|
count += default_data_queue.instrument_before(instrument_job) ;
|
|
count += initialization_queue.instrument_before(instrument_job) ;
|
|
count += top_of_frame_queue.instrument_before(instrument_job) ;
|
|
count += end_of_frame_queue.instrument_before(instrument_job) ;
|
|
count += shutdown_queue.instrument_before(instrument_job) ;
|
|
|
|
count += freeze_init_queue.instrument_before(instrument_job) ;
|
|
count += freeze_scheduled_queue.instrument_before(instrument_job) ;
|
|
count += freeze_queue.instrument_before(instrument_job) ;
|
|
count += unfreeze_queue.instrument_before(instrument_job) ;
|
|
count += time_tic_changed_queue.instrument_before(instrument_job) ;
|
|
|
|
for ( ii = 0 ; ii < other_schedulers.size() ; ii++ ) {
|
|
count += other_schedulers[ii]->instrument_job_before( instrument_job ) ;
|
|
}
|
|
|
|
}
|
|
|
|
return(count) ;
|
|
|
|
}
|
|
|
|
int Trick::Executive::instrument_job_after( std::string in_job , unsigned int instance ) {
|
|
|
|
Trick::JobData * instrument_job ;
|
|
|
|
instrument_job = get_job(in_job , instance) ;
|
|
return instrument_job_after( instrument_job ) ;
|
|
|
|
}
|
|
|
|
int Trick::Executive::instrument_job_after( Trick::JobData * instrument_job) {
|
|
|
|
unsigned int ii, count ;
|
|
|
|
count = 0 ;
|
|
if ( instrument_job != NULL ) {
|
|
// instrument scheduled jobs
|
|
for ( ii = 0 ; ii < threads.size() ; ii++ ) {
|
|
count += threads[ii]->job_queue.instrument_after(instrument_job) ;
|
|
count += threads[ii]->top_of_frame_queue.instrument_after(instrument_job) ;
|
|
count += threads[ii]->end_of_frame_queue.instrument_after(instrument_job) ;
|
|
}
|
|
|
|
// instrument other queued jobs
|
|
// cannot instrument default_data because they come after input processor
|
|
count += default_data_queue.instrument_after(instrument_job) ;
|
|
count += initialization_queue.instrument_after(instrument_job) ;
|
|
count += top_of_frame_queue.instrument_after(instrument_job) ;
|
|
count += end_of_frame_queue.instrument_after(instrument_job) ;
|
|
count += shutdown_queue.instrument_after(instrument_job) ;
|
|
|
|
count += freeze_init_queue.instrument_after(instrument_job) ;
|
|
count += freeze_scheduled_queue.instrument_after(instrument_job) ;
|
|
count += freeze_queue.instrument_after(instrument_job) ;
|
|
count += unfreeze_queue.instrument_after(instrument_job) ;
|
|
count += time_tic_changed_queue.instrument_after(instrument_job) ;
|
|
|
|
for ( ii = 0 ; ii < other_schedulers.size() ; ii++ ) {
|
|
count += other_schedulers[ii]->instrument_job_after( instrument_job ) ;
|
|
}
|
|
}
|
|
|
|
return(count) ;
|
|
|
|
}
|
|
|
|
int Trick::Executive::instrument_job_remove(std::string in_job) {
|
|
|
|
unsigned int ii ;
|
|
|
|
/** @par Detailed Design */
|
|
/** @li Remove instrumentation job from initialization, scheduled,
|
|
integration, end of frame, & shutdown queues by calling ScheduledJobQueue::instrument_remove(string). */
|
|
default_data_queue.instrument_remove(in_job) ;
|
|
initialization_queue.instrument_remove(in_job) ;
|
|
top_of_frame_queue.instrument_remove(in_job) ;
|
|
end_of_frame_queue.instrument_remove(in_job) ;
|
|
shutdown_queue.instrument_remove(in_job) ;
|
|
|
|
freeze_init_queue.instrument_remove(in_job) ;
|
|
freeze_scheduled_queue.instrument_remove(in_job) ;
|
|
freeze_queue.instrument_remove(in_job) ;
|
|
unfreeze_queue.instrument_remove(in_job) ;
|
|
time_tic_changed_queue.instrument_remove(in_job) ;
|
|
|
|
for ( ii = 0 ; ii < threads.size() ; ii++ ) {
|
|
threads[ii]->job_queue.instrument_remove(in_job) ;
|
|
}
|
|
|
|
for ( ii = 0 ; ii < other_schedulers.size() ; ii++ ) {
|
|
other_schedulers[ii]->instrument_job_remove(in_job) ;
|
|
}
|
|
|
|
return(0) ;
|
|
}
|
|
|