}
#define MAGIC 0x12345678 /* To check byte ordering of dump when it is read in */
+#define MAGICV2 0x12345679 /* To check byte ordering & version of dump when it is read in */
+
#ifndef INTERPRET_DUMP
DumpCallBackState(void)
{
int fd, oflag;
- afs_uint32 magic = MAGIC, freelisthead;
- time_t now = FT_ApproxTime();
+ afs_uint32 magic = MAGICV2, now = (afs_int32) FT_ApproxTime(), freelisthead;
oflag = O_WRONLY | O_CREAT | O_TRUNC;
#ifdef AFS_NT40_ENV
/* This is only compiled in for the callback analyzer program */
/* Returns the time of the dump */
time_t
-ReadDump(char *file)
+ReadDump(char *file, int timebits)
{
int fd, oflag;
afs_uint32 magic, freelisthead;
afs_uint32 now;
+#ifdef AFS_64BIT_ENV
+ afs_int64 now64;
+#endif
oflag = O_RDONLY;
#ifdef AFS_NT40_ENV
exit(1);
}
read(fd, &magic, sizeof(magic));
- if (magic != MAGIC) {
- fprintf(stderr,
- "Magic number of %s is invalid. You might be trying to\n",
- file);
- fprintf(stderr,
- "run this program on a machine type with a different byte ordering.\n");
- exit(1);
+ if (magic == MAGICV2) {
+ timebits = 32;
+ } else {
+ if (magic != MAGIC) {
+ fprintf(stderr,
+ "Magic number of %s is invalid. You might be trying to\n",
+ file);
+ fprintf(stderr,
+ "run this program on a machine type with a different byte ordering.\n");
+ exit(1);
+ }
}
- read(fd, &now, sizeof(now));
+#ifdef AFS_64BIT_ENV
+ if (timebits == 64) {
+ read(fd, &now64, sizeof(afs_int64));
+ now = (afs_int32) now64;
+ } else
+#endif
+ read(fd, &now, sizeof(afs_int32));
read(fd, &cbstuff, sizeof(cbstuff));
read(fd, TimeOuts, sizeof(TimeOuts));
read(fd, timeout, sizeof(timeout));
static AFSFid fid;
register struct FileEntry *fe;
register struct CallBack *cb;
- time_t now;
-
+ afs_int32 now;
+ int timebits = 32;
+
memset(&fid, 0, sizeof(fid));
argc--;
argv++;
all = 1;
} else if (!strcmp(*argv, "-raw")) {
raw = 1;
+ } else if (!strcmp(*argv, "-timebits")) {
+ if (argc < 1) {
+ err++;
+ break;
+ }
+ argc--;
+ timebits = atoi(*++argv);
+ if ((timebits != 32)
+#ifdef AFS_64BIT_ENV
+ && (timebits != 64)
+#endif
+ )
+ err++;
} else if (!strcmp(*argv, "-volume")) {
if (argc < 1) {
err++;
}
if (err || argc != 1) {
fprintf(stderr,
- "Usage: cbd [-host cbid] [-fid volume vnode] [-stats] [-all] callbackdumpfile\n");
+ "Usage: cbd [-host cbid] [-fid volume vnode] [-stats] [-all] [-timebits 32"
+#ifdef AFS_64BIT_ENV
+ "|64"
+#endif
+ "] callbackdumpfile\n");
fprintf(stderr,
"[cbid is shown for each host in the hosts.dump file]\n");
exit(1);
}
- now = ReadDump(*argv);
+ now = ReadDump(*argv, timebits);
if (stats || noptions == 0) {
time_t uxtfirst = UXtime(tfirst);
printf("The time of the dump was %u %s", (unsigned int) now, ctime(&now));