1.Dd March 11, 2017 2.Dt SQLITE3_TRACE 3 3.Os 4.Sh NAME 5.Nm sqlite3_trace , 6.Nm sqlite3_profile 7.Nd Tracing And Profiling Functions 8.Sh SYNOPSIS 9.Ft void * 10.Fo sqlite3_trace 11.Fa "sqlite3*" 12.Fa "void(*xTrace)(void*,const char*)" 13.Fa "void*" 14.Fc 15.Ft void * 16.Fo sqlite3_profile 17.Fa "sqlite3*" 18.Fa "void(*xProfile)(void*,const char*,sqlite3_uint64)" 19.Fa "void*" 20.Fc 21.Sh DESCRIPTION 22These routines are deprecated. 23Use the sqlite3_trace_v2() interface instead of the 24routines described here. 25.Pp 26These routines register callback functions that can be used for tracing 27and profiling the execution of SQL statements. 28.Pp 29The callback function registered by sqlite3_trace() is invoked at various 30times when an SQL statement is being run by sqlite3_step(). 31The sqlite3_trace() callback is invoked with a UTF-8 rendering of the 32SQL statement text as the statement first begins executing. 33Additional sqlite3_trace() callbacks might occur as each triggered 34subprogram is entered. 35The callbacks for triggers contain a UTF-8 SQL comment that identifies 36the trigger. 37.Pp 38The SQLITE_TRACE_SIZE_LIMIT compile-time option 39can be used to limit the length of bound parameter expansion 40in the output of sqlite3_trace(). 41.Pp 42The callback function registered by sqlite3_profile() is invoked as 43each SQL statement finishes. 44The profile callback contains the original statement text and an estimate 45of wall-clock time of how long that statement took to run. 46The profile callback time is in units of nanoseconds, however the current 47implementation is only capable of millisecond resolution so the six 48least significant digits in the time are meaningless. 49Future versions of SQLite might provide greater resolution on the profiler 50callback. 51The sqlite3_profile() function is considered experimental and is subject 52to change in future versions of SQLite. 53.Sh SEE ALSO 54.Xr sqlite3_step 3 , 55.Xr sqlite3_trace_v2 3 56