Add DB profiling support

This commit is contained in:
Kai Elwert 2010-09-29 18:49:10 +02:00 committed by Julien BLACHE
parent 5c81144beb
commit cd8686be82

View File

@ -3662,6 +3662,16 @@ db_watch_enum_fetchwd(struct watch_enum *we, uint32_t *wd)
}
#ifdef DB_PROFILE
static void
db_xprofile(void *notused, const char *pquery, sqlite3_uint64 ptime)
{
DPRINTF(E_DBG, L_DB, "SQL PROFILE query: %s\n", pquery);
DPRINTF(E_DBG, L_DB, "SQL PROFILE time: %" PRIu64 "\n", (uint64_t)ptime);
}
#endif
int
db_perthread_init(void)
{
@ -3711,6 +3721,10 @@ db_perthread_init(void)
return -1;
}
#ifdef DB_PROFILE
sqlite3_profile(hdl, db_xprofile, NULL);
#endif
return 0;
}