@@ -56,9 +56,6 @@ struct span {
56
56
/* Our own id */
57
57
u64 id ;
58
58
59
- /* 0 if we have no parent. */
60
- u64 parent_id ;
61
-
62
59
/* The trace_id for this span and all its children. */
63
60
u64 trace_id_hi , trace_id_lo ;
64
61
@@ -73,12 +70,6 @@ struct span {
73
70
const char * name ;
74
71
75
72
bool suspended ;
76
- /* Indicate whether this is a remote span, i.e., it was
77
- inherited by some other process, which is in charge of
78
- emitting the span. This just means that we don't emit this
79
- span ourselves, but we want to add child spans to the remote
80
- span. */
81
- bool remote ;
82
73
};
83
74
84
75
static struct span * active_spans = NULL ;
@@ -104,7 +95,6 @@ static void init_span(struct span *s,
104
95
s -> trace_id_hi = pseudorand_u64 ();
105
96
s -> trace_id_lo = pseudorand_u64 ();
106
97
} else {
107
- s -> parent_id = current -> id ;
108
98
s -> trace_id_hi = current -> trace_id_hi ;
109
99
s -> trace_id_lo = current -> trace_id_lo ;
110
100
}
@@ -134,7 +124,6 @@ static void trace_inject_traceparent(void)
134
124
assert (current );
135
125
136
126
init_span (current , trace_key (active_spans ), "" , NULL );
137
- current -> remote = true;
138
127
assert (current && !current -> parent );
139
128
140
129
if (!hex_decode (traceparent + 3 , 16 , & trace_hi , sizeof (trace_hi ))
@@ -271,12 +260,6 @@ static void trace_emit(struct span *s)
271
260
char buffer [MAX_BUF_SIZE + 1 ];
272
261
size_t len ;
273
262
274
- /* If this is a remote span it's not up to us to emit it. Make
275
- * this a no-op. `trace_span_end` will take care of cleaning
276
- * the in-memory span up. */
277
- if (s -> remote )
278
- return ;
279
-
280
263
snprintf (span_id , sizeof (span_id ), "%016" PRIx64 , s -> id );
281
264
len = snprintf (buffer , MAX_BUF_SIZE ,
282
265
"[{\"id\":\"%s\",\"name\":\"%s\","
@@ -287,7 +270,7 @@ static void trace_emit(struct span *s)
287
270
if (s -> parent != NULL ) {
288
271
len += snprintf (buffer + len , MAX_BUF_SIZE - len ,
289
272
"\"parentId\":\"%016" PRIx64 "\"," ,
290
- s -> parent_id );
273
+ s -> parent -> id );
291
274
if (len > MAX_BUF_SIZE )
292
275
len = MAX_BUF_SIZE ;
293
276
}
0 commit comments