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

childProcess.c File Reference


Detailed Description

Implementation file for the child process accounting functions.

Definition in file childProcess.c.

Include dependency graph for childProcess.c:

Include dependency graph

Go to the source code of this file.

Functions

int cpInitChildProcessData (void)
 Initialize the internal accounting data structures.
void cpKillChildProcessData (void)
 Deinitialize the internal accounting data structures.
cpChildProcess * cpFindChildProcess (pid_t child_pid)
 Find the cpChildProcess structure that corresponds to the given ID.
cpChildProcess * cpCreateChildProcess (pid_t child_pid)
 Create a cpChildProcess object for a child that does not have one yet.
void cpDeleteChildProcess (struct cpChildProcess *cp)
 Delete the given cpChildProcess object.
int cpOpenOutput (struct cpChildProcess *cp, const char *base_name, struct timeval *start_time)
 Open and initialize the statistics output file for the given cpChildProcess object.
unsigned long long cpSampleUsage (struct cpChildProcess *cp, struct timeval *run_time)
 Sample the resource usage for a given child process.

Variables

cpChildProcessData child_process_data
 Global data for child processes.


Function Documentation

struct cpChildProcess* cpCreateChildProcess pid_t  child_pid  ) 
 

Create a cpChildProcess object for a child that does not have one yet.

Parameters:
child_pid The child process to track.
Returns:
The newly created object or NULL if a problem was encountered during creation.

Definition at line 90 of file childProcess.c.

References child_process_data, cpFindChildProcess(), ensure, lnAddTail(), and require.

Referenced by sigalrm().

Here is the call graph for this function:

void cpDeleteChildProcess struct cpChildProcess *  cp  ) 
 

Delete the given cpChildProcess object.

Parameters:
cp NULL or a previously created cpChildProcess object.

Definition at line 119 of file childProcess.c.

References child_process_data, cpFindChildProcess(), ensure, lnRemove(), and require.

Referenced by cpKillChildProcessData().

Here is the call graph for this function:

struct cpChildProcess* cpFindChildProcess pid_t  child_pid  ) 
 

Find the cpChildProcess structure that corresponds to the given ID.

Parameters:
child_pid The child process to track.
Returns:
The cpChildProcess object that corresponds to the given ID or NULL if one has not been created yet.

Definition at line 71 of file childProcess.c.

References child_process_data, and require.

Referenced by cpCreateChildProcess(), cpDeleteChildProcess(), cpOpenOutput(), cpSampleUsage(), and sigalrm().

int cpInitChildProcessData void   ) 
 

Initialize the internal accounting data structures.

Returns:
True on success, false otherwise.

Definition at line 44 of file childProcess.c.

References child_process_data, lnNewList(), and require.

Here is the call graph for this function:

int cpOpenOutput struct cpChildProcess *  cp,
const char *  base_name,
struct timeval *  start_time
 

Open and initialize the statistics output file for the given cpChildProcess object.

The created file will have the form "<base_name>-<pid>.out".

Parameters:
cp A valid cpChildProcess object.
base_name The file name prefix.
start_time The start time for the parent process.
Returns:
True if the file was created successfully, false otherwise.

Definition at line 142 of file childProcess.c.

References child_process_data, cpFindChildProcess(), and require.

Referenced by sigalrm().

Here is the call graph for this function:

unsigned long long cpSampleUsage struct cpChildProcess *  cp,
struct timeval *  run_time
 

Sample the resource usage for a given child process.

Parameters:
cp A valid cpChildProcess object.
run_time The amount of time the parent process has been running.
Returns:
The CPU usage, in microseconds, for the given child process.

Definition at line 307 of file childProcess.c.

References child_process_data, cpFindChildProcess(), pp_block, and require.

Referenced by sigalrm().

Here is the call graph for this function:


Generated on Fri Oct 22 07:50:30 2004 for CPU Broker by  doxygen 1.3.9.1