|
From: David L. <lee...@ho...> - 2003-08-20 06:19:54
|
Has anyone worked on adding the epoll syscalls to valgrind yet? I made an attempt to hack in something, but it still doesn't work. I've attached my diff below. For anyone curious, more info (man pages, etc.) on epoll can be found at http://www.xmailserver.org/linux-patches/nio-improve.html. dave <>< diff -uar valgrind-20030725/coregrind/vg_syscalls.c valgrind-20030725-tera/coregrind/vg_syscalls.c --- valgrind-20030725/coregrind/vg_syscalls.c 2003-07-24 16:00:03.000000000 -0500 +++ valgrind-20030725-tera/coregrind/vg_syscalls.c 2003-08-19 15:03:34.000000000 -0500 @@ -3463,6 +3463,42 @@ VG_TRACK( post_mem_write, arg1, sizeof( vki_ksigset_t ) ) ; break ; +# if defined(__NR_epoll_create) + case __NR_epoll_create: /* syscall 254 */ + /* int epoll_create(int size) */ + MAYBE_PRINTF("epoll_create ( %d )\n", arg1); + KERNEL_DO_SYSCALL(tid,res); + break; +# endif + +# if defined(__NR_epoll_ctl) + case __NR_epoll_ctl: /* syscall 255 */ + /* int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) */ + MAYBE_PRINTF("epoll_ctl ( %d, %d, %d, %p )\n", arg1, arg2, arg3, arg4); + if (arg4 != (UInt)NULL) + { + SYSCALL_TRACK( pre_mem_read, tid, "epoll_ctl", arg4, + sizeof(struct epoll_event) ); + } + KERNEL_DO_SYSCALL(tid,res); + break; +# endif + +# if defined(__NR_epoll_wait) + case __NR_epoll_wait: /* syscall 256 */ + /* int epoll_wait(int epfd, struct epoll_event * events, int maxevents, + int timeout) */ + MAYBE_PRINTF("epoll_wait ( %d, %p, %d, %d )\n", arg1, arg2, arg3, arg4); + SYSCALL_TRACK( pre_mem_write, tid, "epoll_wait", arg2, + arg3 * sizeof(struct epoll_event) ); + KERNEL_DO_SYSCALL(tid,res); + if (!VG_(is_kerror)(res) && res > 0 && arg2 != (UInt)NULL) + { + VG_TRACK( post_mem_write, arg2, res * sizeof(struct epoll_event) ); + } + break; +# endif + default: VG_(message) (Vg_DebugMsg,"FATAL: unhandled syscall: %d",syscallno); diff -uar valgrind-20030725/coregrind/vg_unsafe.h valgrind-20030725-tera/coregrind/vg_unsafe.h --- valgrind-20030725/coregrind/vg_unsafe.h 2003-06-14 03:50:27.000000000 -0500 +++ valgrind-20030725-tera/coregrind/vg_unsafe.h 2003-08-06 16:02:22.000000000 -0500 @@ -87,7 +87,7 @@ #include <sys/sysinfo.h> #include <sys/poll.h> - +#include <sys/epoll.h> /*--------------------------------------------------------------------*/ /*--- end vg_unsafe.h ---*/ -=- Teracruz -- Performance Made Simple Learn more about Teracruz database acceleration at http://www.teracruz.com _________________________________________________________________ <b>MSN 8:</b> Get 6 months for $9.95/month http://join.msn.com/?page=dept/dialup |