From: adrian <> Date: Wed, 22 Nov 2006 14:43:26 +0000 (+0000) Subject: Add profiling points into the fd code to note how long is being spent in syscalls. X-Git-Tag: SQUID_3_0_PRE6~188 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe86a3bf8c660cdf1a3eb560b5d2acf3b6f737e5;p=thirdparty%2Fsquid.git Add profiling points into the fd code to note how long is being spent in syscalls. --- diff --git a/src/fd.cc b/src/fd.cc index 0c4a255051..63d2d0201f 100644 --- a/src/fd.cc +++ b/src/fd.cc @@ -1,6 +1,6 @@ /* - * $Id: fd.cc,v 1.54 2006/05/08 23:38:33 robertc Exp $ + * $Id: fd.cc,v 1.55 2006/11/22 07:43:26 adrian Exp $ * * DEBUG: section 51 Filedescriptor Functions * AUTHOR: Duane Wessels @@ -112,19 +112,31 @@ fd_close(int fd) int socket_read_method(int fd, char *buf, int len) { - return (recv(fd, (void *) buf, len, 0)); + int i; + PROF_start(send); + i = recv(fd, (void *) buf, len, 0); + PROF_stop(send); + return i; } int file_read_method(int fd, char *buf, int len) { - return (_read(fd, buf, len)); + int i; + PROF_start(read); + i = _read(fd, buf, len)); + PROF_stop(read); + return i; } int socket_write_method(int fd, const char *buf, int len) { - return (send(fd, (const void *) buf, len, 0)); + int i; + PROF_start(send); + i = send(fd, (const void *) buf, len, 0); + PROF_stop(send); + return i; } int @@ -137,13 +149,21 @@ file_write_method(int fd, const char *buf, int len) int default_read_method(int fd, char *buf, int len) { - return (read(fd, buf, len)); + int i; + PROF_start(read); + i = read(fd, buf, len); + PROF_stop(read); + return i; } int default_write_method(int fd, const char *buf, int len) { - return (write(fd, buf, len)); + int i; + PROF_start(write); + i = write(fd, buf, len); + PROF_stop(write); + return i; } #endif