MCPcopy Create free account
hub / github.com/apache/brpc / GenerateTraceId

Function GenerateTraceId

src/brpc/span.cpp:180–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180inline uint64_t GenerateTraceId() {
181 // 0 is an invalid Id
182 IdGen* g = &tls_trace_id_gen;
183 if (g->seq == 0) {
184 UpdateTLSRandom64(g);
185 g->seq = 1;
186 }
187 return (g->current_random & 0xFFFFFFFFFFFF0000ULL) | g->seq++;
188}
189
190Span::Span(Forbidden) {
191 CHECK_EQ(0, pthread_spin_init(&_info_spinlock, 0))

Callers 3

CreateClientSpanMethod · 0.85
CreateBthreadSpanMethod · 0.85
CreateServerSpanMethod · 0.85

Calls 1

UpdateTLSRandom64Function · 0.85

Tested by

no test coverage detected