GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MON / V0-3-0
Constituent: mon     Tag: sun-gcc
#include "string.h"
#include "CDM/CDM_pubdefs.h"
#include "CPU_DB/CPU_DB_pubdefs.h"
#include "MON/MON_msgs.h"
#include "MON/MON_pubdefs.h"
#include "MON_DB/MON_DB_schema.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/INT.ih"
#include "PBS/MBA.h"
#include "PBS/MTX.ih"
#include "PBS/TASK.h"
#include "MON_idle.h"
#include "MON_perf.h"
#include "MON_poll.h"
Include dependency graph for MON_control.c:
Data Structures | |
struct | _MON_Control |
MON control information block. More... | |
Typedefs | |
typedef enum _MON_Control_State | MON_Control_State |
Typedef for _MON_Control_State. | |
typedef _MON_Control | MON_Control |
Typedef for _MON_Control. | |
Enumerations | |
enum | _MON_Control_State { MON_STATE_UNINITIALIZED = 1 << 0, MON_STATE_INITIALIZING = 1 << 1, MON_STATE_INIT_FAIL = 1 << 2, MON_STATE_INITIALIZED = 1 << 3, MON_STATE_SHUTDOWN = 1 << 4, MON_STATE_SHUTDOWN_FAIL = 1 << 5, MON_STATE_STARTING = 1 << 6, MON_STATE_START_FAIL = 1 << 7, MON_STATE_STARTED = 1 << 8, MON_STATE_STOPPING = 1 << 9, MON_STATE_STOP_FAIL = 1 << 10 } |
MON control state. More... | |
Functions | |
static unsigned int | mon_create_control_block (void) |
Allocate and adopt a MON control information block. | |
static unsigned int | mon_lock_access (MON_Control *ctl_p) |
Lock access to a MON control block. | |
static unsigned int | mon_unlock_access (MON_Control *ctl_p, unsigned int status) |
Unlock access to a MON control block. | |
static unsigned int | mon_change_state (MON_Control *ctl_p, unsigned int valid_states, MON_Control_State new_state) |
Change the state of the MON functions. | |
unsigned int | MON_initialize (void) |
Initialize the MON functions. | |
unsigned int | MON_shutdown (void) |
Shutdown the MON functions. | |
unsigned int | MON_start (TASK_attr *idle_attr_p, TASK_attr *poll_attr_p) |
Start the MON functions. | |
unsigned int | MON_start_with_db (void) |
Start the MON functions using the CPU_DB server. | |
unsigned int | MON_stop (void) |
Stop the MON functions. | |
unsigned int | MON_get_loading (MON_Load_Stats *stats_p) |
Get current CPU loading statistics. | |
unsigned int | MON_start_perf_mon (MON_Perf_Config *cfg_p) |
Start CPU performance monitoring. | |
unsigned int | MON_stop_perf_mon (MON_Perf_Stats *stats_p) |
Stop CPU performance monitoring. | |
unsigned int | MON_collect_perf_stats (MON_Perf_Config *cfg_p, unsigned int time_us, MON_Perf_Stats *stats_p, MON_Perf_Cb cb, void *cb_parm) |
Collect performance monitor stats for a specified period of time. | |
unsigned int | MON_set_watchdog (void) |
Set the hardware watchdog timer. | |
Variables | |
MON_Control * | Mon_control_p = NULL |
Pointer to the MON control information block. | |
static const MON_DB_Schema | Mon_def_db |
Default MON configuration database. |
** CVS $Id: MON_control.c,v 1.5 2005/08/11 16:49:53 dmay Exp $ **
Control functions for the MON package.
|
MON control state.
|
|
Change the state of the MON functions.
|
|
Collect performance monitor stats for a specified period of time. This function configures and starts the CPU performance monitor facility and establishes a wake-up timer that expires after the specified amount of time. The handler for the wake-up timer stops the CPU event counters and triggers a call to the specified callback function. The callback function is executed in the context of the MON polling task. See also the MON_start_perf_mon() and MON_stop_perf_mon() functions. Note that all event counters are cleared to zero before counting is started. This means that if the MON_EVENT_x_HOLD event is selected for a counter, its value will be set to 0 and held at that value during the collection period.
|
|
Allocate and adopt a MON control information block.
|
|
Get current CPU loading statistics. This function returns a snapshot of the CPU loading statistics for the previous minute of operation.
|
|
Initialize the MON functions. This function initializes the MON package and transitions it to the INITIALIZED state. It should be the first MON function called when using the MON package.
|
|
Lock access to a MON control block.
|
|
Set the hardware watchdog timer.
|
|
Shutdown the MON functions. This function shuts down the MON package and transitions it back to the UNINITIALIZED state. It can be called only if the current MON state is INITIALIZED, INIT_FAIL, or SHUTDOWN_FAIL. This function should be called after MON_stop() when the MON package is no longer needed.
|
|
Start the MON functions. This function starts the various MON tasks and transitions MON to the STARTED state. It can be called only if the current MON state is INITIALIZED. This function should be called after MON_initialize() when using the MON package.
|
|
Start CPU performance monitoring. This function configures and starts the CPU performance monitor facility, which counts various CPU events. If started with this function, the CPU will count events until MON_stop_perf_mon() is called. See also the MON_collect_perf_stats() function, which counts CPU events for a specified period of time. Note that all event counters are cleared to zero before counting is started. This means that if the MON_EVENT_x_HOLD event is selected for a counter, its value will be set to 0 and held at that value during the collection period.
|
|
Start the MON functions using the CPU_DB server. This function is a wrapper for MON_start. It forces MON_start to use the CPU_DB server to determine the attributes for the POLL and IDLE tasks.
|
|
Stop the MON functions. This function stops the various MON tasks and transitions MON back to the INITIALIZED state. It can be called only if the current MON state is STARTED, START_FAIL, or STOP_FAIL. This function should be called before MON_shutdown() when the MON package is no longer needed.
|
|
Stop CPU performance monitoring. This function stops the CPU from counting events and returns the current counter values. If the CPU is not actively counting events, the most recent event counter values are returned.
|
|
Unlock access to a MON control block.
|
|
Initial value: { 10, 100, }
|