diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/blkin/blkin-lib/zipkin_trace.h | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/blkin/blkin-lib/zipkin_trace.h')
-rw-r--r-- | src/blkin/blkin-lib/zipkin_trace.h | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/src/blkin/blkin-lib/zipkin_trace.h b/src/blkin/blkin-lib/zipkin_trace.h new file mode 100644 index 000000000..2a72d47bd --- /dev/null +++ b/src/blkin/blkin-lib/zipkin_trace.h @@ -0,0 +1,130 @@ +/* + * Zipkin lttng-ust tracepoint provider. + */ + +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER zipkin + +#undef TRACEPOINT_INCLUDE +#define TRACEPOINT_INCLUDE "./zipkin_trace.h" + +#if !defined(_ZIPKIN_H) || defined(TRACEPOINT_HEADER_MULTI_READ) +#define _ZIPKIN_H + +#include <lttng/tracepoint.h> + +TRACEPOINT_EVENT( + zipkin, + keyval_string, + TP_ARGS(const char *, trace_name, const char *, service, + int, port, const char *, ip, long, trace, + long, span, long, parent_span, + const char *, key, const char *, val ), + + TP_FIELDS( + /* + * Each span has a name mentioned on it in the UI + * This is the trace name + */ + ctf_string(trace_name, trace_name) + /* + * Each trace takes place in a specific machine-endpoint + * This is identified by a name, a port number and an ip + */ + ctf_string(service_name, service) + ctf_integer(int, port_no, port) + ctf_string(ip, ip) + /* + * According to the tracing semantics each trace should have + * a trace id, a span id and a parent span id + */ + ctf_integer(long, trace_id, trace) + ctf_integer(long, span_id, span) + ctf_integer(long, parent_span_id, parent_span) + /* + * The following is the real annotated information + */ + ctf_string(key, key) + ctf_string(val, val) + ) + ) +TRACEPOINT_LOGLEVEL( + zipkin, + keyval_string, + TRACE_WARNING) + +/* + * This tracepoint allows for integers to come out keyval + */ + +TRACEPOINT_EVENT( + zipkin, + keyval_integer, + TP_ARGS(const char *, trace_name, const char *, service, + int, port, const char *, ip, long, trace, + long, span, long, parent_span, + const char *, key, int64_t, val ), + + TP_FIELDS( + /* + * Each span has a name mentioned on it in the UI + * This is the trace name + */ + ctf_string(trace_name, trace_name) + /* + * Each trace takes place in a specific machine-endpoint + * This is identified by a name, a port number and an ip + */ + ctf_string(service_name, service) + ctf_integer(int, port_no, port) + ctf_string(ip, ip) + /* + * According to the tracing semantics each trace should have + * a trace id, a span id and a parent span id + */ + ctf_integer(long, trace_id, trace) + ctf_integer(long, span_id, span) + ctf_integer(long, parent_span_id, parent_span) + /* + * The following is the real annotated information + */ + ctf_string(key, key) + ctf_integer(int64_t, val, val) + ) + ) +TRACEPOINT_LOGLEVEL( + zipkin, + keyval_integer, + TRACE_WARNING) +/* + * In this event we follow the same semantics but we trace timestamp + * annotations + */ + +TRACEPOINT_EVENT( + zipkin, + timestamp, + TP_ARGS(const char *, trace_name, const char *, service, + int, port, const char *, ip, long, trace, + long, span, long, parent_span, + const char *, event), + + TP_FIELDS( + ctf_string(trace_name, trace_name) + ctf_string(service_name, service) + ctf_integer(int, port_no, port) + ctf_string(ip, ip) + ctf_integer(long, trace_id, trace) + ctf_integer(long, span_id, span) + ctf_integer(long, parent_span_id, parent_span) + ctf_string(event, event) + ) + ) +TRACEPOINT_LOGLEVEL( + zipkin, + timestamp, + TRACE_WARNING) +#endif /* _ZIPKIN_H */ + +#include <lttng/tracepoint-event.h> + |