-C Fix\sa\srequirement\smark\sto\sconform\sto\sa\stypo\sfix\sin\sthe\sdocumentation.
-D 2016-02-27T14:04:27.011
+C Enhance\sthe\s".stats"\scommand\sin\ssqlite3.exe\sto\sshow\sone-time\sstats\sinformation\nif\sinvoked\swith\sone\sargument.\s\sAlso\sshow\s/proc/PID/io\sinformation\sif\srun\son\nLinux.
+D 2016-02-27T17:12:36.918
F Makefile.in 4e90dc1521879022aa9479268a4cd141d1771142
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 4f319afb7c049d40aff7af6e8c4e7cc2ba18e079
F src/resolve.c b8f7174e5f8c33c44ded3a25a973d0bb89228c20
F src/rowset.c 9fe4b3ad7cc00944386bb600233d8f523de07a6e
F src/select.c 1bacfde7b7cec134d2b354cbcf67bafc67078431
-F src/shell.c 89b73e894e737cc2f21e4bce0feb3ea21cc61124
+F src/shell.c f30efdd675007ec6006d51193fc47aabda2984a5
F src/sqlite.h.in 57d2a02b14c9ec4f7cb294153eaf62294dc5aa68
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d
F test/sharedB.test 16cc7178e20965d75278f410943109b77b2e645e
F test/shared_err.test 2f2aee20db294b9924e81f6ccbe60f19e21e8506
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
-F test/shell1.test ce5e744870387164703bf2dee2cc9753e4a71513
+F test/shell1.test a45b424ec23a4b946848ff9e1af5186c677162ab
F test/shell2.test 12b8bf901b0e3a8ac58cf5c0c63a0a388d4d1862
F test/shell3.test 5e8545ec72c4413a0e8d4c6be56496e3c257ca29
-F test/shell4.test ddf0a99044e2245a87fc17423e3aaa1445b3243b
+F test/shell4.test f43e250139dc5dc5f0f2ec1752c50284a1ede102
F test/shell5.test c04e9f9f948305706b88377c464c7f08ce7479f9
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 33dd671cb9c17f08dbc61aed91e80eaeb84bfaf5
-R 262f28bf043321d0cb2a0438d4f47c13
+P d1392c627934b89cdb86d82e73d56e8f76952b30
+R cc008a8c941c26feeb254cac8325586b
U drh
-Z 7540cf66865728ef817082a1a3c276f6
+Z 0f34ce71f4553990685c1f98cc5c169c
-d1392c627934b89cdb86d82e73d56e8f76952b30
\ No newline at end of file
+3c36948f16b58fe8042c37d0df634308b4e48217
\ No newline at end of file
return zErrMsg;
}
+#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: ", "Number of bytes received by read():" },
+ { "wchar: ", "Number of bytes sent to write():" },
+ { "syscr: ", "Number of read() system calls:" },
+ { "syscw: ", "Number of write() system calls:" },
+ { "read_bytes: ", "Number of bytes from storage:" },
+ { "write_bytes: ", "Number of bytes sent to storage:" },
+ { "cancelled_write_bytes: ", "Cancelled write bytes:" },
+ };
+ int i;
+ for(i=0; i<ArraySize(aTrans); i++){
+ int n = (int)strlen(aTrans[i].zPattern);
+ if( strncmp(aTrans[i].zPattern, z, n)==0 ){
+ raw_printf(out, "%-36s %s", aTrans[i].zDesc, &z[n]);
+ break;
+ }
+ }
+ }
+ fclose(in);
+}
+#endif
+
+
/*
** Display memory stats.
*/
raw_printf(pArg->out, "Virtual Machine Steps: %d\n", iCur);
}
+#ifdef __linux__
+ displayLinuxIoStats(pArg->out);
+#endif
+
/* Do not remove this machine readable comment: extra-stats-output-here */
return 0;
" separator for both the output mode and .import\n"
".shell CMD ARGS... Run CMD ARGS... in a system shell\n"
".show Show the current values for various settings\n"
- ".stats on|off Turn stats on or off\n"
+ ".stats ?on|off? Show stats or turn stats on or off\n"
".system CMD ARGS... Run CMD ARGS... in a system shell\n"
".tables ?TABLE? List names of tables\n"
" If TABLE specified, only list tables matching\n"
if( c=='s' && strncmp(azArg[0], "stats", n)==0 ){
if( nArg==2 ){
p->statsOn = booleanValue(azArg[1]);
+ }else if( nArg==1 ){
+ display_stats(p->db, p, 0);
}else{
- raw_printf(stderr, "Usage: .stats on|off\n");
+ raw_printf(stderr, "Usage: .stats ?on|off?\n");
rc = 1;
}
}else
} {1 {Usage: .show}}
# .stats ON|OFF Turn stats on or off
-do_test shell1-3.23b.1 {
- catchcmd "test.db" ".stats"
-} {1 {Usage: .stats on|off}}
+#do_test shell1-3.23b.1 {
+# catchcmd "test.db" ".stats"
+#} {1 {Usage: .stats on|off}}
do_test shell1-3.23b.2 {
catchcmd "test.db" ".stats ON"
} {0 {}}
do_test shell1-3.23b.4 {
# too many arguments
catchcmd "test.db" ".stats OFF BAD"
-} {1 {Usage: .stats on|off}}
+} {1 {Usage: .stats ?on|off?}}
# .tables ?TABLE? List names of tables
# If TABLE specified, only list tables matching
} {0}
# .stats ON|OFF Turn stats on or off
-do_test shell4-1.3.1 {
- catchcmd "test.db" ".stats"
-} {1 {Usage: .stats on|off}}
+#do_test shell4-1.3.1 {
+# catchcmd "test.db" ".stats"
+#} {1 {Usage: .stats on|off}}
do_test shell4-1.3.2 {
catchcmd "test.db" ".stats ON"
} {0 {}}
do_test shell4-1.3.4 {
# too many arguments
catchcmd "test.db" ".stats OFF BAD"
-} {1 {Usage: .stats on|off}}
+} {1 {Usage: .stats ?on|off?}}
# NB. whitespace is important
do_test shell4-1.4.1 {