MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / mtr_init_from_stream

Function mtr_init_from_stream

3rdparty/minitrace/minitrace.cpp:178–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176#endif
177
178void mtr_init_from_stream(void *stream) {
179#ifndef MTR_ENABLED
180 return;
181#endif
182 event_buffer = (raw_event_t *)malloc(INTERNAL_MINITRACE_BUFFER_SIZE * sizeof(raw_event_t));
183 flush_buffer = (raw_event_t *)malloc(INTERNAL_MINITRACE_BUFFER_SIZE * sizeof(raw_event_t));
184 is_tracing = 1;
185 event_count = 0;
186 f = (FILE *)stream;
187 const char *header = "{\"traceEvents\":[\n";
188 fwrite(header, 1, strlen(header), f);
189 time_offset = (uint64_t)(mtr_time_s() * 1000000);
190 first_line = 1;
191 pthread_mutex_init(&mutex, 0);
192 pthread_mutex_init(&event_mutex, 0);
193}
194
195void mtr_init(const char *json_file) {
196#ifndef MTR_ENABLED

Callers 1

mtr_initFunction · 0.85

Calls 1

mtr_time_sFunction · 0.85

Tested by

no test coverage detected