int sqlite3_trace_v2( sqlite3*, unsigned uMask, int(*xCallback)(unsigned,void*,void*,void*), void *pCtx );
R-31603-05822:[The sqlite3_trace_v2(D,M,X,P) interface registers a trace callback function X against database connection D, using property mask M and context pointer P. ] R-61444-46004:[If the X callback is NULL or if the M mask is zero, then tracing is disabled. ] The M argument should be the bitwise OR-ed combination of zero or more SQLITE_TRACE constants.
R-29575-14878:[Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). ]
R-24654-22397:[The X callback is invoked whenever any of the events identified by mask M occur. ] R-16776-49985:[The integer return value from the callback is currently ignored, though this may change in future releases. ] Callback implementations should return zero to ensure future compatibility.
R-54814-00088:[A trace callback is invoked with four arguments: callback(T,C,P,X). ] R-40219-59128:[The T argument is one of the SQLITE_TRACE constants to indicate why the callback was invoked. ] R-56255-17851:[The C argument is a copy of the context pointer. ] The P and X arguments are pointers whose meanings depend on T.
The sqlite3_trace_v2() interface is intended to replace the legacy interfaces sqlite3_trace() and sqlite3_profile(), both of which are deprecated.