From d57a38d7fa9501a5ec17f75a1efaef9d62df5bef Mon Sep 17 00:00:00 2001 From: Miguel Date: Wed, 22 Aug 2018 15:16:26 +0200 Subject: improving logging --- kernel/syscalls.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'kernel/syscalls.c') diff --git a/kernel/syscalls.c b/kernel/syscalls.c index db23a17..baa341f 100644 --- a/kernel/syscalls.c +++ b/kernel/syscalls.c @@ -1,6 +1,5 @@ #define FOOLOS_MODULE_NAME "syscalls" -#include "lib/logger/log.h" #include "lib/string/string.h" #include "fs/fs.h" #include "fs/ext2.h" @@ -56,7 +55,7 @@ int syscall_gettimeofday(struct timeval *tv, struct timezone *tz) int syscall_lseek(int file,int ptr,int dir) { #ifdef LOG_SYSCALLS - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"lseek (file=%d, ptr=%d, dir=%d)", file,ptr,dir); + log(FOOLOS_MODULE_NAME,5,"lseek (file=%d, ptr=%d, dir=%d)", file,ptr,dir); #endif panic(FOOLOS_MODULE_NAME,"unhandled syscall: lseek"); @@ -68,7 +67,7 @@ int syscall_lseek(int file,int ptr,int dir) int syscall_write(int file, char *buf, int len) { #ifdef LOG_SYSCALLS - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"[%d] write(file=%d, buf=0x%08X, len=%d)", task_get_current_pid(),file,buf,len); + log(FOOLOS_MODULE_NAME,5,"[%d] write(file=%d, buf=0x%08X, len=%d)", task_get_current_pid(),file,buf,len); #endif for(int i=0;i=MAX_FIFOS || next_fd>=MAX_FD)panic(FOOLOS_MODULE_NAME,"we ran out of fd's or fifo's"); @@ -287,7 +286,7 @@ int syscall_open(char *name, int flags, int mode) int syscall_close(int file,int none1,int none2) { #ifdef LOG_SYSCALLS - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"close (file=%d)", file); + log(FOOLOS_MODULE_NAME,5,"close (file=%d)", file); #endif //if(file!=0&&file!=1&&file!=2) @@ -300,7 +299,7 @@ int syscall_close(int file,int none1,int none2) int syscall_isatty(int file,int none1,int none2) { #ifdef LOG_SYSCALLS - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"isatty (file=%d)", file); + log(FOOLOS_MODULE_NAME,5,"isatty (file=%d)", file); #endif return 1; @@ -318,7 +317,7 @@ uint32_t syscall_sbrk(int incr, int none1, int none2) task_set_brk(alloc); #ifdef LOG_SYSCALLS - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"sbrk (incr=%d) = 0x%08X", incr,oldalloc); + log(FOOLOS_MODULE_NAME,5,"sbrk (incr=%d) = 0x%08X", incr,oldalloc); #endif return oldalloc; @@ -328,7 +327,7 @@ uint32_t syscall_sbrk(int incr, int none1, int none2) int syscall_stat(const char *path, struct stat *st,int none) { #ifdef LOG_SYSCALLS - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"stat (path=0x%08X,stat=0x%08X)", path,st); + log(FOOLOS_MODULE_NAME,5,"stat (path=0x%08X,stat=0x%08X)", path,st); #endif st->st_mode = S_IFCHR; -- cgit v1.2.3