Minor cleanup. Missing traces.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4356 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include "mem.h"
|
||||
#include "ssb.db.h"
|
||||
#include "ssb.h"
|
||||
#include "trace.h"
|
||||
#include "util.js.h"
|
||||
|
||||
#include "sodium/crypto_hash_sha256.h"
|
||||
@ -396,6 +397,8 @@ static void _tf_ssb_sql_append(uint8_t** rows, size_t* rows_count, const void* d
|
||||
static void _tf_ssb_sqlAsync_work(uv_work_t* work)
|
||||
{
|
||||
sql_work_t* sql_work = work->data;
|
||||
tf_trace_t* trace = tf_ssb_get_trace(sql_work->ssb);
|
||||
tf_trace_begin(trace, "sql_async_work");
|
||||
sql_work->start_time = uv_hrtime();
|
||||
sql_work->thread_id = uv_thread_self();
|
||||
sqlite3* db = tf_ssb_acquire_db_reader(sql_work->ssb);
|
||||
@ -494,11 +497,14 @@ static void _tf_ssb_sqlAsync_work(uv_work_t* work)
|
||||
}
|
||||
tf_ssb_release_db_reader(sql_work->ssb, db);
|
||||
sql_work->end_time = uv_hrtime();
|
||||
tf_trace_end(trace);
|
||||
}
|
||||
|
||||
static void _tf_ssb_sqlAsync_after_work(uv_work_t* work, int status)
|
||||
{
|
||||
sql_work_t* sql_work = work->data;
|
||||
tf_trace_t* trace = tf_ssb_get_trace(sql_work->ssb);
|
||||
tf_trace_begin(trace, "sql_async_after_work");
|
||||
tf_ssb_record_thread_time(sql_work->ssb, (int64_t)sql_work->thread_id, sql_work->end_time - sql_work->start_time);
|
||||
JSContext* context = tf_ssb_get_context(sql_work->ssb);
|
||||
uint8_t* p = sql_work->rows;
|
||||
@ -585,6 +591,7 @@ static void _tf_ssb_sqlAsync_after_work(uv_work_t* work, int status)
|
||||
|
||||
tf_free(sql_work->error);
|
||||
tf_free(sql_work);
|
||||
tf_trace_end(trace);
|
||||
}
|
||||
|
||||
static JSValue _tf_ssb_sqlAsync(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
|
||||
|
Reference in New Issue
Block a user