From: dan Date: Fri, 20 Jan 2017 16:46:20 +0000 (+0000) Subject: Add option "--stats" to test program kvtest. Specifying --stats causes kvtest X-Git-Tag: version-3.17.0~93 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=befcd8ad84f843cf384d754a8fd203b1945acb59;p=thirdparty%2Fsqlite.git Add option "--stats" to test program kvtest. Specifying --stats causes kvtest to output information similar to the shell tool option of the same name. FossilOrigin-Name: 90291327fc127671d9847a4a2ce1ed47a408cfc6 --- diff --git a/manifest b/manifest index b018d640fc..882b5a775a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Get\sthe\s"--testset\srtree"\soption\sworking\son\sspeedtest1.\s\sAdd\sthe\s--rtree,\n--lookaside,\sand\s--clang\soptions\sto\sthe\sspeed-check.sh\sscript. -D 2017-01-20T16:09:12.221 +C Add\soption\s"--stats"\sto\stest\sprogram\skvtest.\sSpecifying\s--stats\scauses\skvtest\nto\soutput\sinformation\ssimilar\sto\sthe\sshell\stool\soption\sof\sthe\ssame\sname. +D 2017-01-20T16:46:20.421 F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da @@ -898,7 +898,7 @@ F test/json101.test c0897616f32d95431f37fd291cb78742181980ac F test/json102.test bf3fe7a706d30936a76a0f7a0375e1e8e73aff5a F test/json103.test c5f6b85e69de05f6b3195f9f9d5ce9cd179099a0 F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff -F test/kvtest.c 2c66ddefcd03c2caa337f6dd79e6c82368af83df +F test/kvtest.c da3fddb003221d3d9726afd959d9c6017516fd02 F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63 F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200 F test/like.test 0603f4fa0dad50987f70032c05800cbfa8985302 @@ -1547,7 +1547,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 52a61967d920047ea0b4409b79793e05c0128964 -R 4e64e669335e5bcf79eed63ea8c1840b -U drh -Z 6f7214599f293ddc9e6d41b975d33fdf +P 87b640c8d07a76b2bc7e896e01965cc09e06f77b +R b9affb78955ec88bf34da37dcc1dd9ef +U dan +Z 3096b993434f8157eb2ffff3d1e5a264 diff --git a/manifest.uuid b/manifest.uuid index 55a46f0885..f7dbcbe1e3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -87b640c8d07a76b2bc7e896e01965cc09e06f77b \ No newline at end of file +90291327fc127671d9847a4a2ce1ed47a408cfc6 \ No newline at end of file diff --git a/test/kvtest.c b/test/kvtest.c index 877605aced..8458ef919c 100644 --- a/test/kvtest.c +++ b/test/kvtest.c @@ -87,6 +87,7 @@ static const char zHelp[] = " --max-id N Maximum blob key to use\n" " --random Read blobs in a random order\n" " --start N Start reading with this blob key\n" +" --stats Output operating stats before exiting\n" ; /* Reference resources used */ @@ -369,6 +370,122 @@ static sqlite3_int64 timeOfDay(void){ return t; } +#ifdef __linux__ +/* +** Attempt to display I/O stats on Linux using /proc/PID/io +*/ +static void displayLinuxIoStats(FILE *out){ + FILE *in; + char z[200]; + sqlite3_snprintf(sizeof(z), z, "/proc/%d/io", getpid()); + in = fopen(z, "rb"); + if( in==0 ) return; + while( fgets(z, sizeof(z), in)!=0 ){ + static const struct { + const char *zPattern; + const char *zDesc; + } aTrans[] = { + { "rchar: ", "Bytes received by read():" }, + { "wchar: ", "Bytes sent to write():" }, + { "syscr: ", "Read() system calls:" }, + { "syscw: ", "Write() system calls:" }, + { "read_bytes: ", "Bytes read from storage:" }, + { "write_bytes: ", "Bytes written to storage:" }, + { "cancelled_write_bytes: ", "Cancelled write bytes:" }, + }; + int i; + for(i=0; i