Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
resource.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 #ifndef resource_INCLUDED
00037 #define resource_INCLUDED
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00042 
00043 
00044 #ifdef _KEEP_RCS_ID
00045 #endif /* _KEEP_RCS_ID */
00046 
00047 /* Request codes: */
00048 typedef INT RES_REQUEST;
00049 
00050 #define RR_Report_Current       1       /* Report current usage */
00051 #define RR_Report_Delta         2       /* Report delta usage */
00052 #define RR_Clear                3       /* Clear a delta summary */
00053 #define RR_Start                4       /* Start a delta */
00054 #define RR_Stop                 5       /* Stop a delta */
00055 #define RR_End                  6       /* Transfer a delta to parent */
00056 #define RR_Current_User         7       /* Return current user time */
00057 #define RR_Current_System       8       /* Return current system time */
00058 #define RR_Current_Elapsed      9       /* Return current elapsed time */
00059 #define RR_Current_Memory       10      /* Return current memory usage */
00060 #define RR_Delta_User           11      /* Return delta user time */
00061 #define RR_Delta_System         12      /* Return delta system time */
00062 #define RR_Delta_Elapsed        13      /* Return delta elapsed time */
00063 #define RR_Delta_Memory         14      /* Return delta memory usage */
00064 
00065 /* Typedefs */
00066 typedef struct resources RESOURCES;
00067 typedef struct rstate RSTATE;
00068 typedef RSTATE *PSTATE;
00069 
00070 
00071 /* Time structure: */
00072 typedef struct time_info {
00073     INT secs;   /* Full seconds */
00074     INT usecs;  /* Fraction in microseconds */
00075 } TIME_INFO;
00076 
00077 /* External routines: */
00078 
00079 /* Initialize base timer, etc.: */
00080 extern void Resource_Init ( void );
00081 
00082 /* Allocate a resource structure: */
00083 extern RSTATE *Resource_Alloc ( char *rname, RSTATE *parent );
00084 
00085 /* Accumulate resource usage: */
00086 extern void Resource_Accum ( RSTATE *r, RES_REQUEST req );
00087 
00088 
00089 /* Return a timing record from r for caller use: */
00090 extern TIME_INFO *Get_Time ( RSTATE *r, RES_REQUEST req );
00091 
00092 /* Return memory usage from r for caller use: */
00093 extern INT Get_Memory ( RSTATE *r, RES_REQUEST req );
00094 
00095 /* Return the name of a timer for caller use: */
00096 extern char *Get_Timer_Name ( RSTATE *r );
00097 
00098 /* Report resource usage from r (if non-NULL) or current usage,
00099  * according to the request function req and preceded by title:
00100  */
00101 extern void Resource_Report (
00102     FILE *file,
00103     RES_REQUEST func,
00104     RSTATE *r,
00105     char *title
00106 );
00107 
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111 #endif /* resource_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines