From 5a23b409cb2d7302d76e18a2b573f255335cc7d1 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 16 Jul 2016 11:47:45 +0000 Subject: [PATCH] Temporarily add extra sqlite3_log() calls to this version to help with debugging a performance problem. FossilOrigin-Name: 613c1ceaf4d552dc29aff090825941eaae6baed1 --- manifest | 20 ++++++++++---------- manifest.uuid | 2 +- src/wal.c | 23 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 311bdc5bea..95dfbf5fe2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Experimental\spatch\srestore\sthe\sslight\sbias\sin\sbtree-balancing\simmediately\nafter\sthe\schange\sto\sreduces\sthe\samount\sof\smemcpy()\swork\sdone\sby\sbalancing. -D 2016-07-14T20:19:24.187 +C Temporarily\sadd\sextra\ssqlite3_log()\scalls\sto\sthis\sversion\sto\shelp\swith\sdebugging\sa\sperformance\sproblem. +D 2016-07-16T11:47:45.840 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -299,7 +299,7 @@ F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f F src/vdbesort.c 975aeffa99acb0991b2f288d30294756bff41438 F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c cb0c194303fea276b48d7d4b6d970b5a96bde8de -F src/wal.c 10e7de7ce90865a68153f001a61f1d985cd17983 +F src/wal.c e77da6efffa373cd20d248be9e86c54c634bc4fe F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 F src/where.c 4ce8c4826b7f86d080f0ed4e7a9045bb5014be77 @@ -1207,10 +1207,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P face33bea1ba3a6d57780655fa827226b4d2baa9 -R 554fefe0a719f26931bb9cdfcdd471c4 -T *branch * btree-balance-bias -T *sym-btree-balance-bias * -T -sym-trunk * -U drh -Z 0e91eabd67698f71b8b9d1b306b232d2 +P 46bd9533c0b4656e9fb10eb41c9369ba8a113746 +R bce5e212270955da4d92cb60e4c49b45 +T *branch * debug +T *sym-debug * +T -sym-btree-balance-bias * +U dan +Z 9b01bf4c5271e3c2cb45a6e077ca93cf diff --git a/manifest.uuid b/manifest.uuid index 310b53c8ec..0ffa9d4c07 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -46bd9533c0b4656e9fb10eb41c9369ba8a113746 \ No newline at end of file +613c1ceaf4d552dc29aff090825941eaae6baed1 \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index c0861d5be7..d49b0a3c57 100644 --- a/src/wal.c +++ b/src/wal.c @@ -1718,6 +1718,14 @@ static int walCheckpoint( i64 nSize; /* Current size of database file */ u32 nBackfill = pInfo->nBackfill; + /* ELATDPP: Extra logging added to debug performance problem */ + sqlite3_log(SQLITE_NOTICE, + "wal: checkpoint salt1=%08x salt2=%08x " + "nBackfill=%d mxSafeFrame=%d mxFrame=%d", + pWal->hdr.aSalt[0], pWal->hdr.aSalt[1], + (int)nBackfill, (int)mxSafeFrame, (int)pWal->hdr.mxFrame + ); + /* Sync the WAL to disk */ if( sync_flags ){ rc = sqlite3OsSync(pWal->pWalFd, sync_flags); @@ -2817,6 +2825,12 @@ int sqlite3WalFrames( iOffset += szFrame; } + /* ELATDPP: Extra logging added to debug performance problem */ + sqlite3_log(SQLITE_NOTICE, "wal: write nFrame=%d iFrame=%d", + iFrame - pWal->hdr.mxFrame, + pWal->hdr.mxFrame+1 + ); + /* If this is the end of a transaction, then we might need to pad ** the transaction and/or sync the WAL file. ** @@ -2921,6 +2935,10 @@ int sqlite3WalCheckpoint( int isChanged = 0; /* True if a new wal-index header is loaded */ int eMode2 = eMode; /* Mode to pass to walCheckpoint() */ + /* ELATDPP: Extra logging added to debug performance problem */ + sqlite3_int64 t1, t2; + sqlite3OsCurrentTimeInt64(pWal->pVfs, &t1); + assert( pWal->ckptLock==0 ); assert( pWal->writeLock==0 ); @@ -2991,6 +3009,11 @@ int sqlite3WalCheckpoint( sqlite3WalEndWriteTransaction(pWal); walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1); pWal->ckptLock = 0; + + /* ELATDPP: Extra logging added to debug performance problem */ + sqlite3OsCurrentTimeInt64(pWal->pVfs, &t2); + sqlite3_log(SQLITE_NOTICE, "wal: checkpoint rc=%d ms=%lld", rc, t2-t1); + WALTRACE(("WAL%p: checkpoint %s\n", pWal, rc ? "failed" : "ok")); return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc); } -- 2.47.2