GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MON / V0-3-0

Constituent: mon     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

MON_idle.c File Reference

CPU loading and idle time monitor. More...

#include "MON/MON_msgs.h"
#include "MON/MON_pubdefs.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/INT.ih"
#include "PBS/MBA.h"
#include "PBS/TASK.h"
#include "MON_idle.h"

Include dependency graph for MON_idle.c:


Functions

unsigned int MON_idle_init (MON_Idle_Control *ctl_p, unsigned int dog_seconds, unsigned int dog_cpu_msecs)
 Initialize the IDLE monitor.
unsigned int MON_idle_shutdown (MON_Idle_Control *ctl_p)
 Shutdown the IDLE monitor.
void MON_idle_set_watchdog (MON_Idle_Control *ctl_p)
 Set the hardware watchdog timer.
static unsigned int mon_idle_loop (MON_Idle_Control *ctl_p, int run_once)
 Idly consume CPU cycles in a loop.
static void * mon_idle_task (TASK_parameter parm)
 Consume unused CPU cycles.
unsigned int MON_idle_start (MON_Idle_Control *ctl_p, TASK_attr *attr_p)
 Start the IDLE monitor functions.
unsigned int MON_idle_stop (MON_Idle_Control *ctl_p)
 Stop the IDLE monitor functions.
unsigned int MON_idle_update_history (MON_Idle_Control *ctl_p)
 Update the IDLE time history.
static int mon_idle_get_load (MON_Idle_Control *ctl_p, unsigned int first_index, unsigned int last_index)
 Get CPU loading between two IDLE time history samples.
unsigned int MON_idle_get_stats (MON_Idle_Control *ctl_p, MON_Load_Stats *load_p)
 Get CPU loading statistics.

Detailed Description

CPU loading and idle time monitor.

**  CVS $Id: MON_idle.c,v 1.6 2005/08/11 16:55:15 dmay Exp $
**  

Monitors the loading and idle time of the CPU. Starts an IDLE task that spins in a loop and reports a running total of the number of loop iterations that it completes. By setting the priority of this IDLE task to the lowest value possible, it will only run when the CPU is idle.

When first started, the IDLE task measures and records the number of time base register cycles required to execute its inner spin-loop with interrupts disabled. This value is then used as the benchmark for the amount of time required to execute the IDLE loop when the CPU is completely unloaded. At periodic intervals, the loop completion count is used to determine how many time base register cycles were spent executing the IDLE loop during the previous interval. By dividing this value by the total number of time base register cycles in the previous interval, a CPU loading/idle-time metric is produced.


Function Documentation

int mon_idle_get_load MON_Idle_Control ctl_p,
unsigned int  first_index,
unsigned int  last_index
[static]
 

Get CPU loading between two IDLE time history samples.

Parameters:
ctl_p Pointer to IDLE state.
first_index Index of first sample.
last_index Index of last sample.
Returns:
CPU loading, as a percentage between 0 and 100.

unsigned int MON_idle_get_stats MON_Idle_Control ctl_p,
MON_Load_Stats load_p
 

Get CPU loading statistics.

Parameters:
ctl_p Pointer to IDLE state.
load_p Pointer to location to return stats.
Returns:
MSG code.

unsigned int MON_idle_init MON_Idle_Control ctl_p,
unsigned int  dog_seconds,
unsigned int  dog_cpu_msecs
 

Initialize the IDLE monitor.

Parameters:
ctl_p Pointer to IDLE state.
dog_seconds Hardware watchdog timer setting value.
dog_cpu_msecs IDLE loop run time between watchdog settings.
Returns:
MSG code.

unsigned int mon_idle_loop MON_Idle_Control ctl_p,
int  run_once
[static]
 

Idly consume CPU cycles in a loop.

Parameters:
ctl_p Pointer to IDLE state.
run_once Nonzero indicates that loop should be run once.
Returns:
CPU cycles required to execute the loop.

void MON_idle_set_watchdog MON_Idle_Control ctl_p  ) 
 

Set the hardware watchdog timer.

Parameters:
ctl_p Pointer to IDLE state.
Returns:
Nothing.

unsigned int MON_idle_shutdown MON_Idle_Control ctl_p  ) 
 

Shutdown the IDLE monitor.

Parameters:
ctl_p Pointer to IDLE state.
Returns:
MSG code.

unsigned int MON_idle_start MON_Idle_Control ctl_p,
TASK_attr *  attr_p
 

Start the IDLE monitor functions.

Parameters:
ctl_p Pointer to IDLE state.
attr_p Pointer to IDLE task attributes.
Returns:
MSG code.

unsigned int MON_idle_stop MON_Idle_Control ctl_p  ) 
 

Stop the IDLE monitor functions.

Parameters:
ctl_p Pointer to IDLE state.
Returns:
MSG code.

void * mon_idle_task TASK_parameter  parm  )  [static]
 

Consume unused CPU cycles.

Parameters:
parm Pointer to IDLE state.
Returns:
MSG code.

unsigned int MON_idle_update_history MON_Idle_Control ctl_p  ) 
 

Update the IDLE time history.

Parameters:
ctl_p Pointer to IDLE state.
Returns:
Nothing.


Generated on Wed Dec 5 08:43:44 2007 by  doxygen 1.4.4