Changeset 11449
- Timestamp:
- Jan 30, 2007, 2:38:46 PM (19 years ago)
- Location:
- trunk/psLib/src/sys
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psTrace.c
r11265 r11449 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.8 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-01- 24 22:14:48$11 * @version $Revision: 1.81 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-01-31 00:38:46 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 56 56 #include "psError.h" 57 57 #include "psLogMsg.h" 58 #include "psMetadata.h" 58 59 59 60 #define MAX_HOSTNAME_LENGTH 256 … … 761 762 762 763 764 static void doGetTraceLevels(psMetadata *out, // Output metadata with the trace levels 765 const p_psComponent* comp, // Component to add 766 psString parent, // Name of parent level 767 int defLevel // Default level 768 ) 769 { 770 if (comp->name[0] == '\0') { 771 return; 772 } 773 774 psString name = psStringCopy(parent); // Name of this level 775 if (comp->name[0] == '.') { 776 psStringAppend(&name, "%s", comp->name + 1); 777 } else if (!parent) { 778 psStringAppend(&name, "%s", comp->name); 779 } else { 780 psStringAppend(&name, ".%s", comp->name); 781 } 782 783 int level = (comp->level == PS_DEFAULT_TRACE_LEVEL) ? defLevel : comp->level; // Level for component 784 if (name) { 785 psMetadataAddS32(out, PS_LIST_TAIL, name, 0, NULL, level); 786 } 787 for (int i = 0; i < comp->n; i++) { 788 doGetTraceLevels(out, comp->subcomp[i], name, level); 789 } 790 791 psFree(name); 792 793 return; 794 } 795 796 797 psMetadata *psTraceLevels(void) 798 { 799 if (cRoot == NULL) { 800 return psMetadataAlloc(); 801 } 802 803 psMetadata *out = psMetadataAlloc();// Output metadata with the levels 804 doGetTraceLevels(out, cRoot, NULL, PS_THE_OTHER_DEFAULT_TRACE_LEVEL); 805 806 return out; 807 } 808 763 809 764 810 #endif // #ifndef PS_NO_TRACE -
trunk/psLib/src/sys/psTrace.h
r11248 r11449 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-01- 23 22:47:23$11 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-01-31 00:38:46 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 22 22 23 23 #include <stdarg.h> 24 #include "psMetadata.h" 24 25 25 26 #define PS_UNKNOWN_TRACE_LEVEL -9999 // we don't know this name's level … … 172 173 int psTraceGetDestination(void); 173 174 175 /// Return a psMetadata summarising the trace levels 176 psMetadata *psTraceLevels(void); 177 174 178 /// @} 175 179 #endif /* PS_NO_TRACE */
Note:
See TracChangeset
for help on using the changeset viewer.
