]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
xstat: print collection values in debug mode
authorMichael Meffie <mmeffie@sinenomine.net>
Mon, 13 Dec 2010 19:53:50 +0000 (14:53 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sat, 30 Mar 2013 19:18:23 +0000 (12:18 -0700)
Print the values of the integers returned in the collection data
when the -debug option is given to xstat_fs_test and xstat_cm_test
test programs. This allows us to at least see what the unformatted
values are when there is a mismatch in timeval sizes between the
host and client (aka the 32/64 bit xstat bug). This change could
break scripts which call the xstat test programs with the debug
option. New debug output are prepended with 'debug:' to be
easily ignored.

Reviewed-on: http://gerrit.openafs.org/2878
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 13aeb1dcaee5ad4e95477464860963788c5d1469)

Change-Id: Ief2f9346fad92e86aa2a214f1a462a10560c6e64
Reviewed-on: http://gerrit.openafs.org/9567
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/xstat/xstat_cm_test.c
src/xstat/xstat_fs_test.c

index 5c1f223445708601e4f5c8a3f9c55dc7aa29fe23..0573ea75dd2205cb0c73df1b026af6d3549f78aa 100644 (file)
@@ -1290,6 +1290,19 @@ CM_Handler(void)
        return (0);
     }
 
+    if (debugging_on) {
+        int i;
+        int numInt32s = xstat_cm_Results.data.AFSCB_CollData_len;
+        afs_int32 *entry = xstat_cm_Results.data.AFSCB_CollData_val;
+
+        printf("debug: got collection number %d\n", xstat_cm_Results.collectionNumber);
+        printf("debug: collection data length is %d\n", numInt32s);
+        for (i = 0; i < numInt32s; i++) {
+            printf("debug: entry %d %u\n", i, entry[i]);
+        }
+        printf("\n");
+    }
+
     switch (xstat_cm_Results.collectionNumber) {
     case AFSCB_XSTATSCOLL_CALL_INFO:
        /* Why was this commented out in 3.3 ? */
index ba9677b57c23460a80746bc63c512c0da0ea898a..63f382c1743880e3bd27c4a08cbe7e8095b041c2 100644 (file)
@@ -537,6 +537,19 @@ FS_Handler(void)
        return (0);
     }
 
+    if (debugging_on) {
+        int i;
+        int numInt32s = xstat_fs_Results.data.AFS_CollData_len;
+        afs_int32 *entry = xstat_fs_Results.data.AFS_CollData_val;
+
+        printf("debug: got collection number %d\n", xstat_fs_Results.collectionNumber);
+        printf("debug: collection data length is %d\n", numInt32s);
+        for (i = 0; i < numInt32s; i++) {
+            printf("debug: entry %d %u\n", i, entry[i]);
+        }
+        printf("\n");
+    }
+
     switch (xstat_fs_Results.collectionNumber) {
     case AFS_XSTATSCOLL_CALL_INFO:
        PrintCallInfo();