Changeset 1713
- Timestamp:
- Sep 7, 2004, 2:09:06 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 16 edited
-
sys/psErrorCodes.c (modified) (2 diffs)
-
sys/psErrorCodes.h (modified) (2 diffs)
-
sys/psLogMsg.c (modified) (2 diffs)
-
sys/psString.c (modified) (3 diffs)
-
sys/psTrace.c (modified) (11 diffs)
-
sys/psTrace.h (modified) (2 diffs)
-
sysUtils/parseErrorCodes.pl (modified) (1 diff)
-
sysUtils/psErrorCodes.c (modified) (2 diffs)
-
sysUtils/psErrorCodes.dat (modified) (1 diff)
-
sysUtils/psErrorCodes.h (modified) (2 diffs)
-
sysUtils/psLogMsg.c (modified) (2 diffs)
-
sysUtils/psString.c (modified) (3 diffs)
-
sysUtils/psSysUtilsErrors.dat (modified) (1 diff)
-
sysUtils/psSysUtilsErrors.h (modified) (2 diffs)
-
sysUtils/psTrace.c (modified) (11 diffs)
-
sysUtils/psTrace.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psErrorCodes.c
r1696 r1713 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-0 7 19:05:07$9 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-08 00:09:06 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 34 34 {PS_ERR_UNKNOWN,"unknown error"}, 35 35 {PS_ERR_IO,"I/O error"}, 36 {PS_ERR_LOCATION_INVALID,"specified location is unknown"}, 36 37 {PS_ERR_MEMORY_CORRUPTION,"memory corruption detected"}, 37 38 {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"}, 38 {PS_ERR_LOCATION_INVALID,"specified location is unknown"}, 39 {PS_ERR_BAD_VALUE,"value is out-of-range"}, 40 {PS_ERR_BAD_LENGTH,"string value is too lon"}, 39 {PS_ERR_BAD_PARAMETER_VALUE,"parameter is out-of-range"}, 40 {PS_ERR_BAD_PARAMETER_NULL,"parameter is null"}, 41 {PS_ERR_BAD_PARAMETER_LENGTH,"parameter string is too long"}, 42 {PS_ERR_UNEXPECTED_NULL,"unexpected NULL foun"}, 41 43 //~End 42 44 {PS_ERR_N_ERR_CLASSES,"error classes end marker"} -
trunk/psLib/src/sys/psErrorCodes.h
r1696 r1713 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-0 7 19:05:07$9 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-08 00:09:06 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 PS_ERR_UNKNOWN, ///< unknown error 44 44 PS_ERR_IO, ///< I/O error 45 PS_ERR_LOCATION_INVALID, ///< specified location is unknown 45 46 PS_ERR_MEMORY_CORRUPTION, ///< memory corruption detected 46 47 PS_ERR_MEMORY_DEREF_USAGE, ///< dereferenced memory still used 47 PS_ERR_LOCATION_INVALID, ///< specified location is unknown 48 PS_ERR_BAD_VALUE, ///< value is out-of-range 49 PS_ERR_BAD_LENGTH, ///< string value is too lon 48 PS_ERR_BAD_PARAMETER_VALUE, ///< parameter is out-of-range 49 PS_ERR_BAD_PARAMETER_NULL, ///< parameter is null 50 PS_ERR_BAD_PARAMETER_LENGTH, ///< parameter string is too long 51 PS_ERR_UNEXPECTED_NULL, ///< unexpected NULL foun 50 52 //~End 51 53 PS_ERR_N_ERR_CLASSES ///< end marker - should not be used as a true error -
trunk/psLib/src/sys/psLogMsg.c
r1696 r1713 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-09-0 7 19:05:07$14 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-08 00:09:06 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 218 218 break; 219 219 default: 220 psErrorMsg(ERRORNAME_PREFIX "psLogSetFormat", true, PS_ERR_BAD_ VALUE,220 psErrorMsg(ERRORNAME_PREFIX "psLogSetFormat", true, PS_ERR_BAD_PARAMETER_VALUE, 221 221 PS_ERRORTEXT_psLogSetFormat_UNKNOWN_KEY, *ptr); 222 222 break; -
trunk/psLib/src/sys/psString.c
r1407 r1713 9 9 * @author Eric Van Alst, MHPCC 10 10 * 11 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 8-07 00:06:06 $11 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-08 00:09:06 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 15 15 */ 16 16 17 /******************************************************************************/18 19 /* INCLUDE FILES */20 21 /******************************************************************************/22 17 #include <stdlib.h> 23 18 #include <string.h> … … 26 21 #include "psError.h" 27 22 28 /******************************************************************************/ 29 30 /* DEFINE STATEMENTS */ 31 32 /******************************************************************************/ 33 34 // None 35 36 /******************************************************************************/ 37 38 /* TYPE DEFINITIONS */ 39 40 /******************************************************************************/ 41 42 // None 43 44 /*****************************************************************************/ 45 46 /* GLOBAL VARIABLES */ 47 48 /*****************************************************************************/ 49 50 // None 51 52 /*****************************************************************************/ 53 54 /* FILE STATIC VARIABLES */ 55 56 /*****************************************************************************/ 57 58 // None 59 60 /*****************************************************************************/ 61 62 /* FUNCTION IMPLEMENTATION - LOCAL */ 63 64 /*****************************************************************************/ 65 66 // None 67 68 /*****************************************************************************/ 69 70 /* FUNCTION IMPLEMENTATION - PUBLIC */ 71 72 /*****************************************************************************/ 23 #include "psSysUtilsErrors.h" 24 #define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psString." 73 25 74 26 char *psStringCopy(const char *str) … … 87 39 if (nChar < 0) { 88 40 // Log error message and return NULL 89 psError(__FILE__, "psStringNCopy with negative count specified %d", nChar); 41 psErrorMsg(ERRORNAME_PREFIX "psStringNCopy", PS_ERR_BAD_PARAMETER_VALUE, true, 42 PS_ERRORTEXT_psStringNCopy_NCHAR_NEGATIVE, 43 nChar); 90 44 return NULL; 91 45 } -
trunk/psLib/src/sys/psTrace.c
r1700 r1713 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-0 7 19:58:06 $11 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-08 00:09:06 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 #include "psString.h" 41 41 #include "psError.h" 42 #include "psAbort.h" 42 #include "psLogMsg.h" 43 44 #include "psSysUtilsErrors.h" 45 #define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psTrace." 43 46 44 47 static p_psComponent* cRoot = NULL; // The root of the trace component … … 107 110 for (i = 0; i < currentNode->n; i++) { 108 111 if (NULL == currentNode->subcomp[i]) { 109 psError(__func__, 110 "Sub-component %d of node %s in the trace tree is NULL.\n", i, currentNode->name); 112 psLogMsg(ERRORNAME_PREFIX "p_psTraceReset", PS_LOG_WARN, 113 PS_ERRORTEXT_psTrace_NULL_SUBCOMPONENT, 114 i, currentNode->name); 111 115 } else { 112 116 p_psTraceReset(currentNode->subcomp[i]); … … 131 135 to ANSI-C. 132 136 *****************************************************************************/ 133 static voidcomponentAdd(const char *addNodeName, int level)137 static bool componentAdd(const char *addNodeName, int level) 134 138 { 135 139 int i = 0; // Loop index variable. … … 142 146 // XXX: Verify that this is the correct behavior. 143 147 if (strcmp("", addNodeName) == 0) { 144 psAbort(__func__, "Failed to add null component to trace tree.\n"); 148 psErrorMsg(ERRORNAME_PREFIX "componentAdd",PS_ERR_BAD_PARAMETER_NULL,true, 149 PS_ERRORTEXT_psTrace_ADD_NULL_COMPONENT); 150 return false; 145 151 } 146 152 … … 148 154 if (strcmp(".", addNodeName) == 0) { 149 155 cRoot->level = level; 150 return ;156 return true; 151 157 } 152 158 153 159 if (addNodeName[0] != '.') { 154 psAbort(__func__,"Failed to add %s to the root component tree.\n", 155 addNodeName); 160 psErrorMsg(ERRORNAME_PREFIX "componentAdd",PS_ERR_BAD_PARAMETER_VALUE,true, 161 PS_ERRORTEXT_psTrace_MALFORMED_COMPONENT_NAME, 162 addNodeName); 163 return false; 156 164 } 157 165 … … 188 196 } 189 197 } 198 199 return true; 190 200 } 191 201 … … 201 211 zero 202 212 *****************************************************************************/ 203 intpsTraceSetLevel(const char *comp, // component of interest204 int level) // desired trace level213 bool psTraceSetLevel(const char *comp, // component of interest 214 int level) // desired trace level 205 215 { 206 216 // If the root component tree does not exist, then initialize it. … … 209 219 } 210 220 // Add the new component to the component tree. 211 componentAdd(comp, level); 212 221 if ( !componentAdd(comp, level) ) { 222 psErrorMsg(ERRORNAME_PREFIX "psTraceSetLevel", PS_ERR_UNKNOWN, false, 223 PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT,level,comp); 224 return false; 225 } 213 226 // return 0 on success. 214 return 0;227 return true; 215 228 } 216 229 … … 255 268 for (i = 0; i < currentNode->n; i++) { 256 269 if (NULL == currentNode->subcomp[i]) { 257 psError(__func__, 258 "Sub-component %d of node %s in trace tree is NULL.\n", i, currentNode->name); 270 psLogMsg(ERRORNAME_PREFIX "p_psTraceReset", PS_LOG_WARN, 271 PS_ERRORTEXT_psTrace_NULL_SUBCOMPONENT, 272 i, currentNode->name); 259 273 } 260 274 … … 365 379 366 380 if (NULL == comp) { 367 psError(__func__, "p_psTrace() called on a NULL trace level tree\n"); 381 psErrorMsg(ERRORNAME_PREFIX "psTrace", PS_ERR_BAD_PARAMETER_NULL, true, 382 PS_ERRORTEXT_psTrace_NULL_TRACETREE, 383 __func__); 384 return; 368 385 } 369 386 // Only display this message if it's trace level is less than the level -
trunk/psLib/src/sys/psTrace.h
r1640 r1713 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 8-27 21:45:01$12 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-08 00:09:06 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 66 66 67 67 /// Set trace level 68 intpsTraceSetLevel(const char *facil, ///< facilty of interest69 int level) ///< desired trace level68 bool psTraceSetLevel(const char *facil, ///< facilty of interest 69 int level) ///< desired trace level 70 70 ; 71 71 -
trunk/psLib/src/sysUtils/parseErrorCodes.pl
r1696 r1713 34 34 } 35 35 else { 36 /^\s*(\w+)\s+( \w.*)/;36 /^\s*(\w+)\s+([\%\w].*)/; 37 37 my $ErrorCode = $1; 38 38 my $ErrorDescription = $2; -
trunk/psLib/src/sysUtils/psErrorCodes.c
r1696 r1713 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-0 7 19:05:07$9 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-08 00:09:06 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 34 34 {PS_ERR_UNKNOWN,"unknown error"}, 35 35 {PS_ERR_IO,"I/O error"}, 36 {PS_ERR_LOCATION_INVALID,"specified location is unknown"}, 36 37 {PS_ERR_MEMORY_CORRUPTION,"memory corruption detected"}, 37 38 {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"}, 38 {PS_ERR_LOCATION_INVALID,"specified location is unknown"}, 39 {PS_ERR_BAD_VALUE,"value is out-of-range"}, 40 {PS_ERR_BAD_LENGTH,"string value is too lon"}, 39 {PS_ERR_BAD_PARAMETER_VALUE,"parameter is out-of-range"}, 40 {PS_ERR_BAD_PARAMETER_NULL,"parameter is null"}, 41 {PS_ERR_BAD_PARAMETER_LENGTH,"parameter string is too long"}, 42 {PS_ERR_UNEXPECTED_NULL,"unexpected NULL foun"}, 41 43 //~End 42 44 {PS_ERR_N_ERR_CLASSES,"error classes end marker"} -
trunk/psLib/src/sysUtils/psErrorCodes.dat
r1696 r1713 9 9 UNKNOWN unknown error 10 10 IO I/O error 11 LOCATION_INVALID specified location is unknown 11 12 MEMORY_CORRUPTION memory corruption detected 12 13 MEMORY_DEREF_USAGE dereferenced memory still used 13 LOCATION_INVALID specified location is unknown 14 BAD_VALUE value is out-of-range 15 BAD_LENGTH string value is too long 14 BAD_PARAMETER_VALUE parameter is out-of-range 15 BAD_PARAMETER_NULL parameter is null 16 BAD_PARAMETER_LENGTH parameter string is too long 17 UNEXPECTED_NULL unexpected NULL found -
trunk/psLib/src/sysUtils/psErrorCodes.h
r1696 r1713 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-0 7 19:05:07$9 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-08 00:09:06 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 PS_ERR_UNKNOWN, ///< unknown error 44 44 PS_ERR_IO, ///< I/O error 45 PS_ERR_LOCATION_INVALID, ///< specified location is unknown 45 46 PS_ERR_MEMORY_CORRUPTION, ///< memory corruption detected 46 47 PS_ERR_MEMORY_DEREF_USAGE, ///< dereferenced memory still used 47 PS_ERR_LOCATION_INVALID, ///< specified location is unknown 48 PS_ERR_BAD_VALUE, ///< value is out-of-range 49 PS_ERR_BAD_LENGTH, ///< string value is too lon 48 PS_ERR_BAD_PARAMETER_VALUE, ///< parameter is out-of-range 49 PS_ERR_BAD_PARAMETER_NULL, ///< parameter is null 50 PS_ERR_BAD_PARAMETER_LENGTH, ///< parameter string is too long 51 PS_ERR_UNEXPECTED_NULL, ///< unexpected NULL foun 50 52 //~End 51 53 PS_ERR_N_ERR_CLASSES ///< end marker - should not be used as a true error -
trunk/psLib/src/sysUtils/psLogMsg.c
r1696 r1713 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-09-0 7 19:05:07$14 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-08 00:09:06 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 218 218 break; 219 219 default: 220 psErrorMsg(ERRORNAME_PREFIX "psLogSetFormat", true, PS_ERR_BAD_ VALUE,220 psErrorMsg(ERRORNAME_PREFIX "psLogSetFormat", true, PS_ERR_BAD_PARAMETER_VALUE, 221 221 PS_ERRORTEXT_psLogSetFormat_UNKNOWN_KEY, *ptr); 222 222 break; -
trunk/psLib/src/sysUtils/psString.c
r1407 r1713 9 9 * @author Eric Van Alst, MHPCC 10 10 * 11 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 8-07 00:06:06 $11 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-08 00:09:06 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 15 15 */ 16 16 17 /******************************************************************************/18 19 /* INCLUDE FILES */20 21 /******************************************************************************/22 17 #include <stdlib.h> 23 18 #include <string.h> … … 26 21 #include "psError.h" 27 22 28 /******************************************************************************/ 29 30 /* DEFINE STATEMENTS */ 31 32 /******************************************************************************/ 33 34 // None 35 36 /******************************************************************************/ 37 38 /* TYPE DEFINITIONS */ 39 40 /******************************************************************************/ 41 42 // None 43 44 /*****************************************************************************/ 45 46 /* GLOBAL VARIABLES */ 47 48 /*****************************************************************************/ 49 50 // None 51 52 /*****************************************************************************/ 53 54 /* FILE STATIC VARIABLES */ 55 56 /*****************************************************************************/ 57 58 // None 59 60 /*****************************************************************************/ 61 62 /* FUNCTION IMPLEMENTATION - LOCAL */ 63 64 /*****************************************************************************/ 65 66 // None 67 68 /*****************************************************************************/ 69 70 /* FUNCTION IMPLEMENTATION - PUBLIC */ 71 72 /*****************************************************************************/ 23 #include "psSysUtilsErrors.h" 24 #define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psString." 73 25 74 26 char *psStringCopy(const char *str) … … 87 39 if (nChar < 0) { 88 40 // Log error message and return NULL 89 psError(__FILE__, "psStringNCopy with negative count specified %d", nChar); 41 psErrorMsg(ERRORNAME_PREFIX "psStringNCopy", PS_ERR_BAD_PARAMETER_VALUE, true, 42 PS_ERRORTEXT_psStringNCopy_NCHAR_NEGATIVE, 43 nChar); 90 44 return NULL; 91 45 } -
trunk/psLib/src/sysUtils/psSysUtilsErrors.dat
r1696 r1713 22 22 checkMemBlock_OVERFLOW Memory block %ld is corrupted; buffer overflow detected. 23 23 memProblemCallbackDefault_MULTIPLE_FREE Block %ld allocated at %s:%d freed more than once at %s:%d. 24 # 25 # Error Messages from psString.c: 26 # 27 psString_NCHAR_NEGATIVE Can not copy a negative number of characters (%d). 28 # 29 # Error Messages from psTrace.c: 30 # 31 psTrace_NULL_SUBCOMPONENT Sub-component %d of node %s in trace tree is NULL. 32 psTrace_NULL_TRACETREE Function %s called on a NULL trace level tree. 33 psTrace_ADD_NULL_COMPONENT Failed to add null component to trace tree. 34 psTrace_MALFORMED_COMPONENT_NAME Failed to add '%s' to the root component tree; component must start with '.'. 35 psTrace_FAILED_TO_ADD_COMPONENT Failed to set trace level (%d) to '%s'. -
trunk/psLib/src/sysUtils/psSysUtilsErrors.h
r1696 r1713 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-0 7 19:05:07$9 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-08 00:09:06 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 39 39 #define PS_ERRORTEXT_checkMemBlock_UNDERFLOW "Memory block %ld is corrupted; buffer underflow detected." 40 40 #define PS_ERRORTEXT_checkMemBlock_OVERFLOW "Memory block %ld is corrupted; buffer overflow detected." 41 #define PS_ERRORTEXT_memProblemCallbackDefault_MULTIPLE_FREE "Block %ld allocated at %s:%d freed more than once at %s:%d" 41 #define PS_ERRORTEXT_memProblemCallbackDefault_MULTIPLE_FREE "Block %ld allocated at %s:%d freed more than once at %s:%d." 42 #define PS_ERRORTEXT_psString_NCHAR_NEGATIVE "Can not copy a negative number of characters (%d)." 43 #define PS_ERRORTEXT_psTrace_NULL_SUBCOMPONENT "Sub-component %d of node %s in trace tree is NULL." 44 #define PS_ERRORTEXT_psTrace_NULL_TRACETREE "Function %s called on a NULL trace level tree." 45 #define PS_ERRORTEXT_psTrace_ADD_NULL_COMPONENT "Failed to add null component to trace tree." 46 #define PS_ERRORTEXT_psTrace_MALFORMED_COMPONENT_NAME "Failed to add '%s' to the root component tree; component must start with '.'." 47 #define PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT "Failed to set trace level (%d) to '%s'" 42 48 //~End 43 49 -
trunk/psLib/src/sysUtils/psTrace.c
r1700 r1713 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-0 7 19:58:06 $11 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-08 00:09:06 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 #include "psString.h" 41 41 #include "psError.h" 42 #include "psAbort.h" 42 #include "psLogMsg.h" 43 44 #include "psSysUtilsErrors.h" 45 #define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psTrace." 43 46 44 47 static p_psComponent* cRoot = NULL; // The root of the trace component … … 107 110 for (i = 0; i < currentNode->n; i++) { 108 111 if (NULL == currentNode->subcomp[i]) { 109 psError(__func__, 110 "Sub-component %d of node %s in the trace tree is NULL.\n", i, currentNode->name); 112 psLogMsg(ERRORNAME_PREFIX "p_psTraceReset", PS_LOG_WARN, 113 PS_ERRORTEXT_psTrace_NULL_SUBCOMPONENT, 114 i, currentNode->name); 111 115 } else { 112 116 p_psTraceReset(currentNode->subcomp[i]); … … 131 135 to ANSI-C. 132 136 *****************************************************************************/ 133 static voidcomponentAdd(const char *addNodeName, int level)137 static bool componentAdd(const char *addNodeName, int level) 134 138 { 135 139 int i = 0; // Loop index variable. … … 142 146 // XXX: Verify that this is the correct behavior. 143 147 if (strcmp("", addNodeName) == 0) { 144 psAbort(__func__, "Failed to add null component to trace tree.\n"); 148 psErrorMsg(ERRORNAME_PREFIX "componentAdd",PS_ERR_BAD_PARAMETER_NULL,true, 149 PS_ERRORTEXT_psTrace_ADD_NULL_COMPONENT); 150 return false; 145 151 } 146 152 … … 148 154 if (strcmp(".", addNodeName) == 0) { 149 155 cRoot->level = level; 150 return ;156 return true; 151 157 } 152 158 153 159 if (addNodeName[0] != '.') { 154 psAbort(__func__,"Failed to add %s to the root component tree.\n", 155 addNodeName); 160 psErrorMsg(ERRORNAME_PREFIX "componentAdd",PS_ERR_BAD_PARAMETER_VALUE,true, 161 PS_ERRORTEXT_psTrace_MALFORMED_COMPONENT_NAME, 162 addNodeName); 163 return false; 156 164 } 157 165 … … 188 196 } 189 197 } 198 199 return true; 190 200 } 191 201 … … 201 211 zero 202 212 *****************************************************************************/ 203 intpsTraceSetLevel(const char *comp, // component of interest204 int level) // desired trace level213 bool psTraceSetLevel(const char *comp, // component of interest 214 int level) // desired trace level 205 215 { 206 216 // If the root component tree does not exist, then initialize it. … … 209 219 } 210 220 // Add the new component to the component tree. 211 componentAdd(comp, level); 212 221 if ( !componentAdd(comp, level) ) { 222 psErrorMsg(ERRORNAME_PREFIX "psTraceSetLevel", PS_ERR_UNKNOWN, false, 223 PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT,level,comp); 224 return false; 225 } 213 226 // return 0 on success. 214 return 0;227 return true; 215 228 } 216 229 … … 255 268 for (i = 0; i < currentNode->n; i++) { 256 269 if (NULL == currentNode->subcomp[i]) { 257 psError(__func__, 258 "Sub-component %d of node %s in trace tree is NULL.\n", i, currentNode->name); 270 psLogMsg(ERRORNAME_PREFIX "p_psTraceReset", PS_LOG_WARN, 271 PS_ERRORTEXT_psTrace_NULL_SUBCOMPONENT, 272 i, currentNode->name); 259 273 } 260 274 … … 365 379 366 380 if (NULL == comp) { 367 psError(__func__, "p_psTrace() called on a NULL trace level tree\n"); 381 psErrorMsg(ERRORNAME_PREFIX "psTrace", PS_ERR_BAD_PARAMETER_NULL, true, 382 PS_ERRORTEXT_psTrace_NULL_TRACETREE, 383 __func__); 384 return; 368 385 } 369 386 // Only display this message if it's trace level is less than the level -
trunk/psLib/src/sysUtils/psTrace.h
r1641 r1713 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 8-27 21:45:01$12 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-08 00:09:06 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 66 66 67 67 /// Set trace level 68 intpsTraceSetLevel(const char *facil, ///< facilty of interest69 int level) ///< desired trace level68 bool psTraceSetLevel(const char *facil, ///< facilty of interest 69 int level) ///< desired trace level 70 70 ; 71 71
Note:
See TracChangeset
for help on using the changeset viewer.
