From 270cead3776cc0f605f2506fa39f4e6a7955d286 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Tue, 16 Sep 2008 17:41:47 +0300 Subject: [PATCH] Removed various printfs from fs0 path lookup etc. --- tasks/fs0/src/path.c | 2 +- tasks/fs0/src/syscalls.c | 5 +++-- tasks/mm0/src/file.c | 8 ++++---- tasks/test0/src/fileio.c | 33 +++++++++++++++++++-------------- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/tasks/fs0/src/path.c b/tasks/fs0/src/path.c index 4274440..48d5122 100644 --- a/tasks/fs0/src/path.c +++ b/tasks/fs0/src/path.c @@ -134,7 +134,7 @@ struct pathdata *pathdata_parse(const char *pathname, /* Next component */ str = splitpath(&pathbuf, VFS_CHAR_SEP); } - pathdata_print(pdata); + // pathdata_print(pdata); return pdata; } diff --git a/tasks/fs0/src/syscalls.c b/tasks/fs0/src/syscalls.c index 33c4d7f..81d6c19 100644 --- a/tasks/fs0/src/syscalls.c +++ b/tasks/fs0/src/syscalls.c @@ -35,7 +35,7 @@ int pager_sys_open(l4id_t sender, l4id_t opener, int fd) struct tcb *task; struct vnode *v; - printf("%s/%s\n", __TASKNAME__, __FUNCTION__); + // printf("%s/%s\n", __TASKNAME__, __FUNCTION__); /* Check if such task exists */ if (!(task = find_task(opener))) { @@ -503,7 +503,8 @@ int sys_readdir(l4id_t sender, int fd, void *buf, int count) struct dentry *d; struct tcb *t; - printf("%s/%s\n", __TASKNAME__, __FUNCTION__); + // printf("%s/%s\n", __TASKNAME__, __FUNCTION__); + /* Get the task */ BUG_ON(!(t = find_task(sender))); diff --git a/tasks/mm0/src/file.c b/tasks/mm0/src/file.c index db11cd8..486a9d1 100644 --- a/tasks/mm0/src/file.c +++ b/tasks/mm0/src/file.c @@ -55,7 +55,7 @@ int vfs_read(unsigned long vnum, unsigned long file_offset, { int err; - printf("%s/%s\n", __TASKNAME__, __FUNCTION__); + // printf("%s/%s\n", __TASKNAME__, __FUNCTION__); l4_save_ipcregs(); @@ -91,7 +91,7 @@ int vfs_open(l4id_t opener, int fd, unsigned long *vnum, unsigned long *length) { int err; - printf("%s/%s\n", __TASKNAME__, __FUNCTION__); + // printf("%s/%s\n", __TASKNAME__, __FUNCTION__); l4_save_ipcregs(); @@ -253,7 +253,7 @@ int vfs_write(unsigned long vnum, unsigned long file_offset, { int err; - printf("%s/%s\n", __TASKNAME__, __FUNCTION__); + // printf("%s/%s\n", __TASKNAME__, __FUNCTION__); l4_save_ipcregs(); write_mr(L4SYS_ARG0, vnum); @@ -309,7 +309,7 @@ int vfs_update_file_stats(struct vm_file *f) { int err; - printf("%s/%s\n", __TASKNAME__, __FUNCTION__); + // printf("%s/%s\n", __TASKNAME__, __FUNCTION__); l4_save_ipcregs(); write_mr(L4SYS_ARG0, vm_file_to_vnum(f)); diff --git a/tasks/test0/src/fileio.c b/tasks/test0/src/fileio.c index 8f74af1..8168ead 100644 --- a/tasks/test0/src/fileio.c +++ b/tasks/test0/src/fileio.c @@ -6,6 +6,7 @@ #include #include #include +#include int fileio2(void) { @@ -14,6 +15,7 @@ int fileio2(void) int err; char buf[128]; off_t offset; + int tid = self_tid(); char *str = "I WROTE TO THIS FILE\n"; @@ -21,41 +23,42 @@ int fileio2(void) perror("OPEN"); return -1; } - printf("Created newfile2.txt\n"); + printf("%d: Created newfile2.txt\n", tid); - printf("%s: write.\n", __TASKNAME__); + printf("%d: write.\n", tid); if ((int)(cnt = write(fd, str, strlen(str))) < 0) { perror("WRITE"); return -1; } - printf("%s: close.\n", __TASKNAME__); + printf("%d: close.\n", tid); if ((err = close(fd)) < 0) { printf("Close failed.\n"); perror("CLOSE"); return -1; } - printf("%s: re-open.\n", __TASKNAME__); + printf("%d: re-open.\n", tid); if ((fd = open("/home/bahadir/newfile2.txt", O_RDWR, S_IRWXU)) < 0) { perror("OPEN"); return -1; } - printf("%s: lseek.\n", __TASKNAME__); + printf("%d: lseek.\n", tid); if ((int)(offset = lseek(fd, 0, SEEK_SET)) < 0) { perror("LSEEK"); return -1; } - printf("%s: read.\n", __TASKNAME__); + printf("%d: read.\n", tid); if ((int)(cnt = read(fd, buf, strlen(str))) < 0) { perror("READ"); return -1; } - printf("Read: %d bytes from file.\n", cnt); + printf("%d: Read: %d bytes from file.\n", tid, cnt); if (cnt) { - printf("Read string: %s\n", buf); + printf("%d: Read string: %s\n", tid, buf); } + printf("%d: close.\n", tid); if ((err = close(fd)) < 0) { perror("CLOSE"); return -1; @@ -71,6 +74,7 @@ int fileio(void) int err; char buf[128]; off_t offset; + int tid = self_tid(); char *str = "I WROTE TO THIS FILE\n"; @@ -78,30 +82,31 @@ int fileio(void) perror("OPEN"); return -1; } - printf("Created newfile.txt\n"); + printf("%d: Created newfile.txt\n", tid); - printf("%s: write.\n", __TASKNAME__); + printf("%d: write.\n", tid); if ((int)(cnt = write(fd, str, strlen(str))) < 0) { perror("WRITE"); return -1; } - printf("%s: lseek.\n", __TASKNAME__); + printf("%d: lseek.\n", tid); if ((int)(offset = lseek(fd, 0, SEEK_SET)) < 0) { perror("LSEEK"); return -1; } - printf("%s: read.\n", __TASKNAME__); + printf("%d: read.\n", tid); if ((int)(cnt = read(fd, buf, strlen(str))) < 0) { perror("READ"); return -1; } - printf("Read: %d bytes from file.\n", cnt); + printf("%d: Read: %d bytes from file.\n", tid, cnt); if (cnt) { - printf("Read string: %s\n", buf); + printf("%d: Read string: %s\n", tid, buf); } + printf("%d: close.\n", tid); if ((err = close(fd)) < 0) { perror("CLOSE"); return -1;