2023-07-27 14:43:53 +09:30
|
|
|
#ifndef LIGHTNING_COMMON_TRACE_H
|
|
|
|
|
#define LIGHTNING_COMMON_TRACE_H
|
|
|
|
|
#include "config.h"
|
2023-12-01 17:58:55 +01:00
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
|
|
2024-11-22 11:25:58 +01:00
|
|
|
#undef TRACE_DEBUG
|
2023-07-27 14:43:53 +09:30
|
|
|
|
2025-04-23 10:24:40 +09:30
|
|
|
/* name must be a string constant */
|
|
|
|
|
#define trace_span_start(name, key) trace_span_start_(name "", (key))
|
|
|
|
|
void trace_span_start_(const char *name, const void *key);
|
2023-07-27 14:43:53 +09:30
|
|
|
void trace_span_end(const void *key);
|
|
|
|
|
void trace_span_tag(const void *key, const char *name, const char *value);
|
2023-12-15 10:51:56 +10:30
|
|
|
void trace_cleanup(void);
|
2025-04-23 10:24:40 +09:30
|
|
|
void trace_span_remote(u64 trace_id_hi, u64 trade_id_lo, u64 span_id);
|
2023-07-27 14:43:53 +09:30
|
|
|
|
2024-11-21 12:16:56 +01:00
|
|
|
#define TRACE_LBL __FILE__ ":" stringify(__LINE__)
|
|
|
|
|
void trace_span_suspend_(const void *key, const char *lbl);
|
2025-04-03 07:03:59 +10:30
|
|
|
void trace_span_suspend_may_free_(const void *key, const char *lbl);
|
2024-11-21 12:16:56 +01:00
|
|
|
void trace_span_resume_(const void *key, const char *lbl);
|
|
|
|
|
#define trace_span_suspend(key) trace_span_suspend_(key, TRACE_LBL)
|
2025-04-03 07:03:59 +10:30
|
|
|
#define trace_span_suspend_may_free(key) trace_span_suspend_may_free_(key, TRACE_LBL)
|
2024-11-21 12:16:56 +01:00
|
|
|
#define trace_span_resume(key) trace_span_resume_(key, TRACE_LBL)
|
|
|
|
|
|
2023-07-27 14:43:53 +09:30
|
|
|
#endif /* LIGHTNING_COMMON_TRACE_H */
|