* Find an empty slot for a new span. */
| 250 | * Find an empty slot for a new span. |
| 251 | */ |
| 252 | static struct span *trace_span_slot(void) |
| 253 | { |
| 254 | /* Look for a free fixed slot. */ |
| 255 | for (size_t i = 0; i < ARRAY_SIZE(fixed_spans); i++) { |
| 256 | if (fixed_spans[i].key == 0) |
| 257 | return &fixed_spans[i]; |
| 258 | } |
| 259 | |
| 260 | /* Those are used up, we have to allocate. */ |
| 261 | return tal(spans, struct span); |
| 262 | } |
| 263 | |
| 264 | #define MAX_BUF_SIZE 2048 |
| 265 |
no outgoing calls
no test coverage detected