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

childProcess.c File Reference


Detailed Description

Implementation file for the child process accounting functions.

Include dependency graph for childProcess.c:

Include dependency graph

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, 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 creaetd object or NULL if a problem was encountered during creation.

void cpDeleteChildProcess struct cpChildProcess *  cp  ) 
 

Delete the given cpChildProcess object.

Parameters:
cp NULL or a previously created cpChildProcess object.

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.

int cpInitChildProcessData void   ) 
 

Initialize the internal accounting data structures.

Returns:
True on success, false otherwise.

int cpOpenOutput struct cpChildProcess *  cp,
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.

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.


Generated on Mon Dec 1 16:22:03 2003 for CPUBroker by doxygen 1.3.4