Author: adrian.chadd
Date: Sat Apr 25 17:26:11 2009
New Revision: 13984

Modified:
    branches/LUSCA_HEAD/tools/ufs_log_dump.c

Log:
Start fleshing this out a bit more - echo the actual log content.



Modified: branches/LUSCA_HEAD/tools/ufs_log_dump.c
==============================================================================
--- branches/LUSCA_HEAD/tools/ufs_log_dump.c    (original)
+++ branches/LUSCA_HEAD/tools/ufs_log_dump.c    Sat Apr 25 17:26:11 2009
@@ -61,6 +61,28 @@
          return buf;
  }

+static const char *
+storeMetaText(storeSwapLogData *d)
+{
+       static char buf[1024];
+       char *ks = storeKeyText(d->key);
+
+       buf[0] = '\0';
+
+       snprintf(buf, 1024, "op %s; fileno %X; timestamp %ld; lastref %ld;  
expires %ld; lastmod %ld; filesize %ld; refcount %d; flags %d; key %s",
+           swap_log_op_str[d->op],
+           (int) d->swap_filen,
+           (long int) d->timestamp,
+           (long int) d->lastref,
+           (long int) d->expires,
+           (long int) d->lastmod,
+           (long int) d->swap_file_sz,
+           (int) d->refcount,
+           (int) d->flags,
+           ks);
+       return buf;
+}
+

  void
  read_file(const char *path)
@@ -107,7 +129,7 @@
        /* Start reading entries */
        while ((len = read(fd, buf, sizeof(storeSwapLogData))) > 0) {
                se = (storeSwapLogData *) buf;
-               printf("op: %d; read len %d, key %s\n", se->op, len,  
storeKeyText(se->key));
+               printf(  "Entry: %s\n", storeMetaText(se));
        }

        close(fd);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to