Index: /trunk/psLib/src/sys/psTrace.c
===================================================================
--- /trunk/psLib/src/sys/psTrace.c	(revision 11448)
+++ /trunk/psLib/src/sys/psTrace.c	(revision 11449)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.80 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-01-24 22:14:48 $
+ *  @version $Revision: 1.81 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-01-31 00:38:46 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -56,4 +56,5 @@
 #include "psError.h"
 #include "psLogMsg.h"
+#include "psMetadata.h"
 
 #define MAX_HOSTNAME_LENGTH 256
@@ -761,4 +762,49 @@
 
 
+static void doGetTraceLevels(psMetadata *out, // Output metadata with the trace levels
+                             const p_psComponent* comp, // Component to add
+                             psString parent, // Name of parent level
+                             int defLevel // Default level
+                            )
+{
+    if (comp->name[0] == '\0') {
+        return;
+    }
+
+    psString name = psStringCopy(parent); // Name of this level
+    if (comp->name[0] == '.') {
+        psStringAppend(&name, "%s", comp->name + 1);
+    } else if (!parent) {
+        psStringAppend(&name, "%s", comp->name);
+    } else {
+        psStringAppend(&name, ".%s", comp->name);
+    }
+
+    int level = (comp->level == PS_DEFAULT_TRACE_LEVEL) ? defLevel : comp->level; // Level for component
+    if (name) {
+        psMetadataAddS32(out, PS_LIST_TAIL, name, 0, NULL, level);
+    }
+    for (int i = 0; i < comp->n; i++) {
+        doGetTraceLevels(out, comp->subcomp[i], name, level);
+    }
+
+    psFree(name);
+
+    return;
+}
+
+
+psMetadata *psTraceLevels(void)
+{
+    if (cRoot == NULL) {
+        return psMetadataAlloc();
+    }
+
+    psMetadata *out = psMetadataAlloc();// Output metadata with the levels
+    doGetTraceLevels(out, cRoot, NULL, PS_THE_OTHER_DEFAULT_TRACE_LEVEL);
+
+    return out;
+}
+
 
 #endif // #ifndef PS_NO_TRACE
Index: /trunk/psLib/src/sys/psTrace.h
===================================================================
--- /trunk/psLib/src/sys/psTrace.h	(revision 11448)
+++ /trunk/psLib/src/sys/psTrace.h	(revision 11449)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-01-23 22:47:23 $
+ *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-01-31 00:38:46 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -22,4 +22,5 @@
 
 #include <stdarg.h>
+#include "psMetadata.h"
 
 #define PS_UNKNOWN_TRACE_LEVEL -9999   // we don't know this name's level
@@ -172,4 +173,7 @@
 int psTraceGetDestination(void);
 
+/// Return a psMetadata summarising the trace levels
+psMetadata *psTraceLevels(void);
+
 /// @}
 #endif /* PS_NO_TRACE */
