mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
name trace files by urbit date
This commit is contained in:
parent
323c453404
commit
29d80e2887
10
noun/trace.c
10
noun/trace.c
@ -319,7 +319,10 @@ u3t_trace_open()
|
||||
mkdir(fil_c, 0700);
|
||||
}
|
||||
|
||||
snprintf(fil_c, 2048, "%s/%ld.json", fil_c, time(NULL));
|
||||
c3_c * wen_c = u3r_string(u3A->wen);
|
||||
|
||||
snprintf(fil_c, 2048, "%s/%s.json", fil_c, wen_c);
|
||||
free(wen_c);
|
||||
|
||||
trace_file_u = fopen(fil_c, "w");
|
||||
nock_pid_i = (int)getpid();
|
||||
@ -497,6 +500,11 @@ u3t_event_trace(const c3_c* name, c3_c type)
|
||||
if (!trace_file_u)
|
||||
return;
|
||||
|
||||
if ( trace_counter >= 100000 ) {
|
||||
u3t_trace_close();
|
||||
u3t_trace_open();
|
||||
}
|
||||
|
||||
fprintf(trace_file_u,
|
||||
"{\"cat\": \"event\", \"name\": \"%s\", \"ph\":\"%c\", \"pid\": %d, "
|
||||
"\"tid\": 1, \"ts\": %" PRIu64 ", \"id\": \"0x100\"}, \n",
|
||||
|
@ -102,6 +102,9 @@ u3v_start(u3_noun now)
|
||||
printf("arvo: time: %s\n", wen_c);
|
||||
free(wen_c);
|
||||
}
|
||||
|
||||
if ( u3C.wag_w & u3o_trace )
|
||||
u3t_trace_open();
|
||||
}
|
||||
|
||||
/* u3v_wish(): text expression with cache.
|
||||
|
@ -656,7 +656,6 @@ main(c3_i argc,
|
||||
*/
|
||||
if ( _(u3_Host.ops_u.tra) ) {
|
||||
u3C.wag_w |= u3o_trace;
|
||||
u3t_trace_open();
|
||||
}
|
||||
}
|
||||
u3m_boot(u3_Host.ops_u.nuu,
|
||||
|
Loading…
Reference in New Issue
Block a user