MCPcopy Create free account
hub / github.com/ElementsProject/lightning / trace_span_end

Function trace_span_end

common/trace.c:366–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366void trace_span_end(const void *key)
367{
368 if (disable_trace)
369 return;
370
371 size_t numkey = trace_key(key);
372 struct span *s = trace_span_find(numkey);
373 assert(s && "Span to end not found");
374 assert(s == current && "Ending a span that isn't the current one");
375
376 struct timeabs now =
377 time_now(); /* discouraged: but tracing wants non-dev time */
378 s->end_time = (now.ts.tv_sec * 1000000) + now.ts.tv_nsec / 1000;
379 DTRACE_PROBE1(lightningd, span_end, s->id);
380 if (trace_to_file) {
381 fprintf(trace_to_file, "span_end %016" PRIx64 "\n", s->id);
382 fflush(trace_to_file);
383 }
384 trace_emit(s);
385
386 /* Reset the context span we are in. */
387 current = s->parent;
388
389 /* Now reset the span */
390 trace_span_clear(s);
391}
392
393void trace_span_tag(const void *key, const char *name, const char *value)
394{

Callers 13

wallet_newFunction · 0.85
add_tipFunction · 0.85
get_new_blockFunction · 0.85
parse_requestFunction · 0.85
mainFunction · 0.85
destroy_trace_spanFunction · 0.85
mainFunction · 0.85
payment_continueFunction · 0.85
handle_rpc_replyFunction · 0.85
db_exec_prepared_v2Function · 0.85

Calls 5

trace_keyFunction · 0.85
trace_span_findFunction · 0.85
time_nowFunction · 0.85
trace_emitFunction · 0.85
trace_span_clearFunction · 0.85

Tested by 1

mainFunction · 0.68