From: drh Date: Tue, 27 Feb 2007 02:01:14 +0000 (+0000) Subject: Improvements to OS layer tracing on the unix backend. (CVS 3664) X-Git-Tag: version-3.6.10~2506 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=15d00c4e7b8d924973760d480a990fb1b500361c;p=thirdparty%2Fsqlite.git Improvements to OS layer tracing on the unix backend. (CVS 3664) FossilOrigin-Name: 3ad96dbe09b99bd5f623de0de3072a25e9e2bc17 --- diff --git a/manifest b/manifest index 547b5bd068..2dbfd95564 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\scomments\sto\ssqlite3ExprCompare()\sto\sclarify\sits\soperation.\sTicket\s#2216.\s(CVS\s3663) -D 2007-02-24T15:29:04 +C Improvements\sto\sOS\slayer\stracing\son\sthe\sunix\sbackend.\s(CVS\s3664) +D 2007-02-27T02:01:14 F Makefile.in 1fe3d0b46e40fd684e1e61f8e8056cefed16de9f F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -81,7 +81,7 @@ F src/os_os2.c 8ee8207fe218a1acf3a31d59753e165e5c23bb95 F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3 F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 -F src/os_unix.c 2f7f7dbb95bbfa109f951c828b248102ab75b621 +F src/os_unix.c abdb0f7b8e3f078b8b48d4c0b8c801693046774d F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_win.c 8736cf3a49fd651a6538857480f302807d57814c F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b @@ -434,7 +434,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 2bf5475bde763f73f7f4dd9cac7d13a631a7d2aa -R bf7e89dd91722385f525c6269433be59 +P fba0a1e50820677081bc7cf01f97bf953065f7c4 +R 53e6e1175e996a66fdc28979d298605a U drh -Z 359d2bb09f0008f8bf6cf7c87fededb5 +Z 6212737d1226e74d32458bf3f5faf876 diff --git a/manifest.uuid b/manifest.uuid index 167e898ba6..f51af573b1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fba0a1e50820677081bc7cf01f97bf953065f7c4 \ No newline at end of file +3ad96dbe09b99bd5f623de0de3072a25e9e2bc17 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 8ac272e5e2..67b7425afb 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1001,6 +1001,7 @@ int sqlite3UnixIsDirWritable(char *zBuf){ static int seekAndRead(unixFile *id, void *pBuf, int cnt){ int got; i64 newOffset; + TIMER_START; #ifdef USE_PREAD got = pread(id->h, pBuf, cnt, id->offset); #else @@ -1010,6 +1011,8 @@ static int seekAndRead(unixFile *id, void *pBuf, int cnt){ } got = read(id->h, pBuf, cnt); #endif + TIMER_END; + TRACE5("READ %-3d %5d %7lld %d\n", id->h, got, id->offset, TIMER_ELAPSED); if( got>0 ){ id->offset += got; } @@ -1024,12 +1027,7 @@ static int seekAndRead(unixFile *id, void *pBuf, int cnt){ static int unixRead(OsFile *id, void *pBuf, int amt){ int got; assert( id ); - TIMER_START; got = seekAndRead((unixFile*)id, pBuf, amt); - TIMER_END; - TRACE5("READ %-3d %5d %7d %d\n", ((unixFile*)id)->h, got, - last_page, TIMER_ELAPSED); - SEEK(0); SimulateIOError( got = -1 ); if( got==amt ){ return SQLITE_OK; @@ -1048,6 +1046,7 @@ static int unixRead(OsFile *id, void *pBuf, int amt){ static int seekAndWrite(unixFile *id, const void *pBuf, int cnt){ int got; i64 newOffset; + TIMER_START; #ifdef USE_PREAD got = pwrite(id->h, pBuf, cnt, id->offset); #else @@ -1057,6 +1056,8 @@ static int seekAndWrite(unixFile *id, const void *pBuf, int cnt){ } got = write(id->h, pBuf, cnt); #endif + TIMER_END; + TRACE5("WRITE %-3d %5d %7lld %d\n", id->h, got, id->offset, TIMER_ELAPSED); if( got>0 ){ id->offset += got; } @@ -1072,15 +1073,10 @@ static int unixWrite(OsFile *id, const void *pBuf, int amt){ int wrote = 0; assert( id ); assert( amt>0 ); - TIMER_START; while( amt>0 && (wrote = seekAndWrite((unixFile*)id, pBuf, amt))>0 ){ amt -= wrote; pBuf = &((char*)pBuf)[wrote]; } - TIMER_END; - TRACE5("WRITE %-3d %5d %7d %d\n", ((unixFile*)id)->h, wrote, - last_page, TIMER_ELAPSED); - SEEK(0); SimulateIOError(( wrote=(-1), amt=1 )); SimulateDiskfullError(( wrote=0, amt=1 )); if( amt>0 ){ @@ -1098,7 +1094,6 @@ static int unixWrite(OsFile *id, const void *pBuf, int amt){ */ static int unixSeek(OsFile *id, i64 offset){ assert( id ); - SEEK(offset/1024 + 1); #ifdef SQLITE_TEST if( offset ) SimulateDiskfullError(return SQLITE_FULL); #endif