Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

proc_advocate.cc File Reference


Detailed Description

Wrapper used to attach unmodified programs to the Broker.

Definition in file proc_advocate.cc.

Include dependency graph for proc_advocate.cc:

Include dependency graph

Go to the source code of this file.

Defines

#define INSTR_proc_len   LRTIME_INSTR
#define INSTR_proc_len_data   "proc_len", "the wall clock time"

Enumerations

enum  { PAB_DONE, PAB_CREATED_RESOURCE_SET, PAB_NO_OBSERVE }
enum  { PAF_DONE = (1L << PAB_DONE), PAF_CREATED_RESOURCE_SET = (1L << PAB_CREATED_RESOURCE_SET), PAF_NO_OBSERVE = (1L << PAB_NO_OBSERVE) }

Functions

void sigchld (int sig)
 Handle a SIGCHLD signal.

void sigpass (int sig)
 A signal handler that passes the received signal on to the child process.

void sigalrm (int sig)
 The SIGALRM signal handler.

void paUsage (const char *prog_name)
 Print out the usage statement to standard error.

int paProcessOptions (int &argc_inout, char **&argv_inout)
 Process the command line options.

Broker::RealTimeTask_ptr paGetAdvocate (CORBA::ORB_ptr orb, Broker::Manager_ptr manager, const char *task_ior, const char *task_name)
 Create the advocate and begin CPU scheduling based on the command line parameters.

int paParentPart (Broker::RealTimeTask_ptr rtt)
 The parent portion of the fork(2) between pa and the monitored utility.

int paChildPart (char *argv[])
 The child portion of the fork(2) between the proc_advocate and the monitored utility.

int main (int argc, char *argv[])

Variables

iPoint INSTR_proc_len_point
struct {
   PortableServer::POA_var   pa_POA
   unsigned long   pa_Flags
   const char *   pa_ManagerIOR
   const char *   pa_TaskIOR
   const char *   pa_TaskName
   pid_t   pa_ChildPID
   CORBA::ULong   pa_ChildPeriod
   Broker::RealTimeTask_ptr   pa_Advocate
   rk_resource_set_t   pa_ResourceSet
   unsigned long long   pa_LastUsage
   Broker::KeyedReportParameters   pa_KeyedReportParameters
pa_data


Function Documentation

int paChildPart char *  argv[]  )  [static]
 

The child portion of the fork(2) between the proc_advocate and the monitored utility.

This function will execvp(3) the utility with the given arguments.

Parameters:
argv The utility to startup and its arguments.
Returns:
A failure exit code, otherwise this function will not return because of the execvp(3).
See also:
paParentPart

Definition at line 676 of file proc_advocate.cc.

References ensure.

Broker::RealTimeTask_ptr paGetAdvocate CORBA::ORB_ptr  orb,
Broker::Manager_ptr  manager,
const char *  task_ior,
const char *  task_name
[static]
 

Create the advocate and begin CPU scheduling based on the command line parameters.

Parameters:
orb Pointer to the ORB instance.
manager The manager for this machine.
task_ior The IOR of the Broker::RealTimeTask to use or NULL if a task should be created.
task_name The name of the Broker::RealTimeTask to create or NULL if an existing task should be used.
Returns:
A pointer to the allocated advocate.

Definition at line 375 of file proc_advocate.cc.

References ensure, manager, NULL_RESOURCE_SET, require, rk_proc_get_rset(), rk_resource_set_create(), rk_resource_set_get_by_name(), rk_resource_set_get_usage(), rtt, Broker::ScheduleParameters, MaxDecayTaskAdvocate::SetDelegateAttribute(), and Broker::TaskParameters.

Here is the call graph for this function:

int paParentPart Broker::RealTimeTask_ptr  rtt  )  [static]
 

The parent portion of the fork(2) between pa and the monitored utility.

This function will attach itself to a resource set to ensure that it has some CPU time to work and then wait for gkrellm connections or the child's death.

Parameters:
rtt The Broker::RealTimeTask that is managing this process.
Returns:
The return code for main().
See also:
paChildPart

Todo:
Use rk periodic stuff here.

Definition at line 518 of file proc_advocate.cc.

References ensure, require, rtt, sigalrm(), sigchld(), and sigpass().

Here is the call graph for this function:

int paProcessOptions int &  argc_inout,
char **&  argv_inout
[static]
 

Process the command line options.

Parameters:
argc_inout Reference to main's argc variable. On return, the variable will contain the number of arguments remaining after option processing.
argv_inout Reference to main's argv variable. On return, the variable will contain the remaining argument values.
Returns:
True if the options were processed correctly, false otherwise.

Definition at line 252 of file proc_advocate.cc.

References string_to_microsec().

Here is the call graph for this function:

void paUsage const char *  prog_name  )  [static]
 

Print out the usage statement to standard error.

Parameters:
prog_name The program name.

Definition at line 208 of file proc_advocate.cc.

References require.

void sigalrm int  sig  )  [static]
 

The SIGALRM signal handler.

This function will be called at the end of every period to report CPU usage to the advocate.

Parameters:
sig The actual signal number received.

Definition at line 154 of file proc_advocate.cc.

References NULL_RESOURCE_SET, require, and rk_resource_set_get_usage().

Referenced by paParentPart().

Here is the call graph for this function:

void sigchld int  sig  )  [static]
 

Handle a SIGCHLD signal.

This function will be called when the child exits.

Parameters:
sig The actual signal number received.

Definition at line 128 of file proc_advocate.cc.

References require.

Referenced by paParentPart().

void sigpass int  sig  )  [static]
 

A signal handler that passes the received signal on to the child process.

Parameters:
sig The actual signal number received.

Definition at line 140 of file proc_advocate.cc.

References require.

Referenced by paParentPart().


Variable Documentation

struct iPoint INSTR_proc_len_point [static]
 

Initial value:

 {
    INSTR_proc_len_data,
}

Definition at line 46 of file proc_advocate.cc.


Generated on Tue Jun 22 14:50:53 2004 for CPU Broker by doxygen 1.3.6