src/fuse/udcFuse/udcFuse.c 1.5
1.5 2009/11/19 19:07:58 angie
Debug message improvements.
Index: src/fuse/udcFuse/udcFuse.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/fuse/udcFuse/udcFuse.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -B -U 4 -r1.4 -r1.5
--- src/fuse/udcFuse/udcFuse.c 10 Nov 2009 00:54:26 -0000 1.4
+++ src/fuse/udcFuse/udcFuse.c 19 Nov 2009 19:07:58 -0000 1.5
@@ -116,10 +116,9 @@
url = udcPathToUrl(path, buf, sizeof(buf), NULL);
size = udcSizeFromCache(url, NULL);
ERR_CATCH_END("udcPathToUrl or udcSizeFromCache");
if (size < 0)
- fprintf(stderr, "...[%d] getattr: failed to open udc on %s -- "
- "can't set proper size\n", pid, url);
+ fprintf(stderr, "...[%d] getattr: failed to get udc cache size for %s", pid, url);
else
stbuf->st_size = size;
}
closedir(dirHandle);
@@ -139,9 +138,8 @@
* getattr() is called to test existence before every other command except read, write and
* getattr itself. Give stat of corresponding udc cache file (but make it read-only). */
{
unsigned int pid = pthread_self();
-fprintf(stderr, "...[%d] getattr(%s) start %ld\n", pid, path, clock1000());
char udcCachePath[4096];
ERR_CATCH_START();
safef(udcCachePath, sizeof(udcCachePath), "%s%s", udcDefaultDir(), path);
ERR_CATCH_END("getattr safef udcCachePath");
@@ -153,18 +151,17 @@
}
// Force read-only permissions:
stbuf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
int ret = checkForFile(path, udcCachePath, stbuf, pid);
-//fprintf(stderr, "...[%d] getattr finish %ld\n", pid, clock1000());
+fprintf(stderr, "...[%d] getattr %s finish %ld\n", pid, path, clock1000());
return ret;
}
static int udcfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
off_t offset, struct fuse_file_info *fi)
/* Read the corresponding udc cache directory. */
{
unsigned int pid = pthread_self();
-fprintf(stderr, "...[%d] readdir(%s) start %ld\n", pid, path, clock1000());
char *udcCacheRoot = udcDefaultDir();
char udcCachePath[4096];
ERR_CATCH_START();
safef(udcCachePath, sizeof(udcCachePath), "%s%s", udcCacheRoot, path);
@@ -180,9 +177,9 @@
while ((dirInfo = readdir(dirHandle)) != NULL)
if (filler(buf, dirInfo->d_name, NULL, 0))
break;
int ret = closedir(dirHandle);
-fprintf(stderr, "...[%d] readdir finish %ld\n", pid, clock1000());
+fprintf(stderr, "...[%d] readdir %s finish %ld\n", pid, path, clock1000());
return ret;
}
static int udcfs_open(const char *path, struct fuse_file_info *fi)
@@ -215,9 +212,9 @@
fprintf(stderr, "...[%d] open: Unable to open udcFile for %s!\n", pid, path);
return -1;
}
fi->fh = (uint64_t)udcf;
-fprintf(stderr, "...[%d] open finish %ld\n", pid, clock1000());
+fprintf(stderr, "...[%d] open fh=0x%llx finish %ld\n", pid, (long long)(fi->fh), clock1000());
return 0;
}
static int udcfs_read(const char *path, char *buf, size_t size, off_t offset,
@@ -244,14 +241,12 @@
static int udcfs_release(const char *path, struct fuse_file_info *fi)
// Close the udcFile stored as fi->fh.
{
unsigned int pid = pthread_self();
-fprintf(stderr, "...[%d] release(%s, 0x%llx) start %ld\n",
- pid, path, (long long)(fi->fh), clock1000());
+fprintf(stderr, "...[%d] release %s (0x%llx) %ld\n", pid, path, (long long)(fi->fh), clock1000());
ERR_CATCH_START();
udcFileClose((struct udcFile **)&(fi->fh));
ERR_CATCH_END("udcFileClose");
-fprintf(stderr, "...[%d] release finish %ld\n", pid, clock1000());
return 0;
}
static struct fuse_operations udcfs_oper =