forked from cory/tildefriends
Add missing .clang-format, and fix some spaces that slipped through.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4856 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
10
src/trace.c
10
src/trace.c
@ -298,8 +298,7 @@ static void _tf_trace_end_tagged(tf_trace_t* trace, void* tag)
|
||||
}
|
||||
|
||||
char line[1024];
|
||||
int p =
|
||||
snprintf(line, sizeof(line), "{\"ph\": \"E\", \"pid\": %d, \"tid\": %" PRId64 ", \"ts\": %" PRId64 ", \"name\": \"", getpid(), (int64_t)pthread_self(), _trace_ts());
|
||||
int p = snprintf(line, sizeof(line), "{\"ph\": \"E\", \"pid\": %d, \"tid\": %" PRId64 ", \"ts\": %" PRId64 ", \"name\": \"", getpid(), (int64_t)pthread_self(), _trace_ts());
|
||||
p += _tf_trace_escape_name(line + p, sizeof(line) - p, name);
|
||||
p += snprintf(line + p, sizeof(line) - p, "\"},");
|
||||
p = tf_min(p, tf_countof(line));
|
||||
@ -327,15 +326,14 @@ char* tf_trace_export(tf_trace_t* trace)
|
||||
size += snprintf(buffer, k_buffer_size, "{\"displayTimeUnit\": \"ns\",\n\"traceEvents\": [\n");
|
||||
if (*trace->process_name)
|
||||
{
|
||||
size += snprintf(
|
||||
buffer + size, k_buffer_size - size, "{\"ph\":\"M\",\"pid\":%d,\"name\":\"process_name\",\"args\":{\"name\":\"%s\"}},\n", getpid(), trace->process_name);
|
||||
size += snprintf(buffer + size, k_buffer_size - size, "{\"ph\":\"M\",\"pid\":%d,\"name\":\"process_name\",\"args\":{\"name\":\"%s\"}},\n", getpid(), trace->process_name);
|
||||
}
|
||||
uv_rwlock_rdlock(&trace->threads_lock);
|
||||
for (int i = 0; i < trace->threads_count; i++)
|
||||
{
|
||||
tf_trace_thread_t* thread = trace->threads[i];
|
||||
size += snprintf(buffer + size, k_buffer_size - size, "{\"ph\":\"M\",\"pid\":%d,\"tid\":%" PRId64 ",\"name\":\"thread_name\",\"args\":{\"name\":\"%s\"}},\n",
|
||||
getpid(), (uint64_t)thread->id, thread->name);
|
||||
size += snprintf(buffer + size, k_buffer_size - size, "{\"ph\":\"M\",\"pid\":%d,\"tid\":%" PRId64 ",\"name\":\"thread_name\",\"args\":{\"name\":\"%s\"}},\n", getpid(),
|
||||
(uint64_t)thread->id, thread->name);
|
||||
}
|
||||
uv_rwlock_rdunlock(&trace->threads_lock);
|
||||
if (begin)
|
||||
|
Reference in New Issue
Block a user