diff options
-rw-r--r-- | ChangeLog.txt | 4 | ||||
-rw-r--r-- | pseudo.c | 2 | ||||
-rw-r--r-- | pseudo_db.c | 12 |
3 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 0c942e7..2bbd351 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +2010-12-15: + * (mhatle) add sqlite call profiling, enable with NPROFILE + * (mhatle) as a result of profiling, optimize inode search + 2010-12-14: * (mhatle) restructure wrapfuncs.c @@ -474,7 +474,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag) { /* search on original inode -- in case of mismatch */ by_ino = msg_header; if (msg_header.ino != 0) { - if (msg->pathlen && !pdb_find_file_exact(msg)) { + if (found_path && msg->pathlen && !pdb_find_file_exact(msg)) { /* restore header contents */ by_ino = *msg; *msg = msg_header; diff --git a/pseudo_db.c b/pseudo_db.c index 225dd37..5c62598 100644 --- a/pseudo_db.c +++ b/pseudo_db.c @@ -30,6 +30,15 @@ #include "pseudo_ipc.h" #include "pseudo_db.h" +/* #define NPROFILE */ + +#ifdef NPROFILE +void xProfile(void * pArg, const char * pQuery, sqlite3_uint64 pTimeTaken) +{ + pseudo_diag("profile: %lld %s\n", pTimeTaken, pQuery); +} +#endif + struct log_history { int rc; unsigned long fields; @@ -401,6 +410,9 @@ get_db(sqlite3 **db) { if (db == &file_db) { dbfile = pseudo_localstatedir_path("files.db"); rc = sqlite3_open(dbfile, db); +#ifdef NPROFILE + sqlite3_profile(*db, xProfile, NULL); +#endif free(dbfile); } else { dbfile = pseudo_localstatedir_path("logs.db"); |