libdatadog 0.7.0.1.0 → 2.0.0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/lib/libdatadog.rb +18 -1
  4. data/vendor/{libdatadog-0.7.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-2.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/LICENSE-3rdparty.yml +395 -247
  5. data/vendor/libdatadog-2.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/common.h +496 -0
  6. data/vendor/libdatadog-2.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/profiling.h +285 -0
  7. data/vendor/libdatadog-2.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  8. data/vendor/{libdatadog-0.7.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/pkgconfig/ddprof_ffi_with_rpath.pc → libdatadog-2.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc} +3 -3
  9. data/vendor/{libdatadog-0.7.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-2.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/LICENSE-3rdparty.yml +395 -247
  10. data/vendor/libdatadog-2.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/common.h +496 -0
  11. data/vendor/libdatadog-2.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/profiling.h +285 -0
  12. data/vendor/libdatadog-2.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  13. data/vendor/{libdatadog-0.7.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/pkgconfig/ddprof_ffi_with_rpath.pc → libdatadog-2.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc} +3 -3
  14. data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +395 -247
  15. data/vendor/libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/common.h +496 -0
  16. data/vendor/libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/profiling.h +285 -0
  17. data/vendor/libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  18. data/vendor/{libdatadog-0.7.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/ddprof_ffi_with_rpath.pc → libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc} +3 -3
  19. data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +395 -247
  20. data/vendor/libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/common.h +496 -0
  21. data/vendor/libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/profiling.h +285 -0
  22. data/vendor/libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  23. data/vendor/{libdatadog-0.7.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/pkgconfig/ddprof_ffi_with_rpath.pc → libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc} +3 -3
  24. metadata +31 -27
  25. data/vendor/libdatadog-0.7.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/ddprof/ffi.h +0 -591
  26. data/vendor/libdatadog-0.7.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libddprof_ffi.so +0 -0
  27. data/vendor/libdatadog-0.7.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/ddprof/ffi.h +0 -591
  28. data/vendor/libdatadog-0.7.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libddprof_ffi.so +0 -0
  29. data/vendor/libdatadog-0.7.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/ddprof/ffi.h +0 -591
  30. data/vendor/libdatadog-0.7.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libddprof_ffi.so +0 -0
  31. data/vendor/libdatadog-0.7.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/ddprof/ffi.h +0 -591
  32. data/vendor/libdatadog-0.7.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libddprof_ffi.so +0 -0
  33. /data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE +0 -0
  34. /data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/NOTICE +0 -0
  35. /data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE +0 -0
  36. /data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/NOTICE +0 -0
  37. /data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE +0 -0
  38. /data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/NOTICE +0 -0
  39. /data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE +0 -0
  40. /data/vendor/{libdatadog-0.7.0 → libdatadog-2.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/NOTICE +0 -0
@@ -0,0 +1,496 @@
1
+ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
2
+ // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present Datadog, Inc.
3
+
4
+ #ifndef DDOG_COMMON_H
5
+ #define DDOG_COMMON_H
6
+
7
+ #pragma once
8
+
9
+ #include <stdbool.h>
10
+ #include <stddef.h>
11
+ #include <stdint.h>
12
+
13
+ #if defined(_MSC_VER)
14
+ #define DDOG_CHARSLICE_C(string) \
15
+ /* NOTE: Compilation fails if you pass in a char* instead of a literal */ {.ptr = "" string, .len = sizeof(string) - 1}
16
+ #else
17
+ #define DDOG_CHARSLICE_C(string) \
18
+ /* NOTE: Compilation fails if you pass in a char* instead of a literal */ ((ddog_CharSlice){ .ptr = "" string, .len = sizeof(string) - 1 })
19
+ #endif
20
+
21
+ #if defined __GNUC__
22
+ # define DDOG_GNUC_VERSION(major) __GNUC__ >= major
23
+ #else
24
+ # define DDOG_GNUC_VERSION(major) (0)
25
+ #endif
26
+
27
+ #if defined __has_attribute
28
+ # define DDOG_HAS_ATTRIBUTE(attribute, major) __has_attribute(attribute)
29
+ #else
30
+ # define DDOG_HAS_ATTRIBUTE(attribute, major) DDOG_GNUC_VERSION(major)
31
+ #endif
32
+
33
+ #if defined(__cplusplus) && (__cplusplus >= 201703L)
34
+ # define DDOG_CHECK_RETURN [[nodiscard]]
35
+ #elif defined(_Check_return_) /* SAL */
36
+ # define DDOG_CHECK_RETURN _Check_return_
37
+ #elif DDOG_HAS_ATTRIBUTE(warn_unused_result, 4)
38
+ # define DDOG_CHECK_RETURN __attribute__((__warn_unused_result__))
39
+ #else
40
+ # define DDOG_CHECK_RETURN
41
+ #endif
42
+
43
+ typedef struct ddog_Tag ddog_Tag;
44
+
45
+ /**
46
+ * Holds the raw parts of a Rust Vec; it should only be created from Rust,
47
+ * never from C.
48
+ */
49
+ typedef struct ddog_Vec_U8 {
50
+ const uint8_t *ptr;
51
+ uintptr_t len;
52
+ uintptr_t capacity;
53
+ } ddog_Vec_U8;
54
+
55
+ /**
56
+ * Please treat this as opaque; do not reach into it, and especially don't
57
+ * write into it! The most relevant APIs are:
58
+ * * `ddog_Error_message`, to get the message as a slice.
59
+ * * `ddog_Error_drop`.
60
+ */
61
+ typedef struct ddog_Error {
62
+ /**
63
+ * This is a String stuffed into the vec.
64
+ */
65
+ struct ddog_Vec_U8 message;
66
+ } ddog_Error;
67
+
68
+ /**
69
+ * Remember, the data inside of each member is potentially coming from FFI,
70
+ * so every operation on it is unsafe!
71
+ */
72
+ typedef struct ddog_Slice_CChar {
73
+ const char *ptr;
74
+ uintptr_t len;
75
+ } ddog_Slice_CChar;
76
+
77
+ typedef struct ddog_Slice_CChar ddog_CharSlice;
78
+
79
+ /**
80
+ * Holds the raw parts of a Rust Vec; it should only be created from Rust,
81
+ * never from C.
82
+ */
83
+ typedef struct ddog_Vec_Tag {
84
+ const struct ddog_Tag *ptr;
85
+ uintptr_t len;
86
+ uintptr_t capacity;
87
+ } ddog_Vec_Tag;
88
+
89
+ typedef enum ddog_Vec_Tag_PushResult_Tag {
90
+ DDOG_VEC_TAG_PUSH_RESULT_OK,
91
+ DDOG_VEC_TAG_PUSH_RESULT_ERR,
92
+ } ddog_Vec_Tag_PushResult_Tag;
93
+
94
+ typedef struct ddog_Vec_Tag_PushResult {
95
+ ddog_Vec_Tag_PushResult_Tag tag;
96
+ union {
97
+ struct {
98
+ struct ddog_Error err;
99
+ };
100
+ };
101
+ } ddog_Vec_Tag_PushResult;
102
+
103
+ typedef struct ddog_Vec_Tag_ParseResult {
104
+ struct ddog_Vec_Tag tags;
105
+ struct ddog_Error *error_message;
106
+ } ddog_Vec_Tag_ParseResult;
107
+
108
+ typedef struct ddog_CancellationToken ddog_CancellationToken;
109
+
110
+ typedef struct ddog_prof_Profile ddog_prof_Profile;
111
+
112
+ typedef struct ddog_prof_Exporter ddog_prof_Exporter;
113
+
114
+ typedef struct ddog_prof_ProfiledEndpointsStats ddog_prof_ProfiledEndpointsStats;
115
+
116
+ typedef struct ddog_prof_Exporter_Request ddog_prof_Exporter_Request;
117
+
118
+ typedef enum ddog_Endpoint_Tag {
119
+ DDOG_ENDPOINT_AGENT,
120
+ DDOG_ENDPOINT_AGENTLESS,
121
+ } ddog_Endpoint_Tag;
122
+
123
+ typedef struct ddog_Endpoint_ddog_prof_Agentless_Body {
124
+ ddog_CharSlice _0;
125
+ ddog_CharSlice _1;
126
+ } ddog_Endpoint_ddog_prof_Agentless_Body;
127
+
128
+ typedef struct ddog_Endpoint {
129
+ ddog_Endpoint_Tag tag;
130
+ union {
131
+ struct {
132
+ ddog_CharSlice agent;
133
+ };
134
+ ddog_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
135
+ };
136
+ } ddog_Endpoint;
137
+
138
+ typedef enum ddog_prof_Exporter_NewResult_Tag {
139
+ DDOG_PROF_EXPORTER_NEW_RESULT_OK,
140
+ DDOG_PROF_EXPORTER_NEW_RESULT_ERR,
141
+ } ddog_prof_Exporter_NewResult_Tag;
142
+
143
+ typedef struct ddog_prof_Exporter_NewResult {
144
+ ddog_prof_Exporter_NewResult_Tag tag;
145
+ union {
146
+ struct {
147
+ struct ddog_prof_Exporter *ok;
148
+ };
149
+ struct {
150
+ struct ddog_Error err;
151
+ };
152
+ };
153
+ } ddog_prof_Exporter_NewResult;
154
+
155
+ typedef enum ddog_prof_Exporter_Request_BuildResult_Tag {
156
+ DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_OK,
157
+ DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_ERR,
158
+ } ddog_prof_Exporter_Request_BuildResult_Tag;
159
+
160
+ typedef struct ddog_prof_Exporter_Request_BuildResult {
161
+ ddog_prof_Exporter_Request_BuildResult_Tag tag;
162
+ union {
163
+ struct {
164
+ struct ddog_prof_Exporter_Request *ok;
165
+ };
166
+ struct {
167
+ struct ddog_Error err;
168
+ };
169
+ };
170
+ } ddog_prof_Exporter_Request_BuildResult;
171
+
172
+ /**
173
+ * Represents time since the Unix Epoch in seconds plus nanoseconds.
174
+ */
175
+ typedef struct ddog_Timespec {
176
+ int64_t seconds;
177
+ uint32_t nanoseconds;
178
+ } ddog_Timespec;
179
+
180
+ /**
181
+ * Remember, the data inside of each member is potentially coming from FFI,
182
+ * so every operation on it is unsafe!
183
+ */
184
+ typedef struct ddog_Slice_U8 {
185
+ const uint8_t *ptr;
186
+ uintptr_t len;
187
+ } ddog_Slice_U8;
188
+
189
+ /**
190
+ * Use to represent bytes -- does not need to be valid UTF-8.
191
+ */
192
+ typedef struct ddog_Slice_U8 ddog_ByteSlice;
193
+
194
+ typedef struct ddog_prof_Exporter_File {
195
+ ddog_CharSlice name;
196
+ ddog_ByteSlice file;
197
+ } ddog_prof_Exporter_File;
198
+
199
+ /**
200
+ * Remember, the data inside of each member is potentially coming from FFI,
201
+ * so every operation on it is unsafe!
202
+ */
203
+ typedef struct ddog_prof_Exporter_Slice_File {
204
+ const struct ddog_prof_Exporter_File *ptr;
205
+ uintptr_t len;
206
+ } ddog_prof_Exporter_Slice_File;
207
+
208
+ typedef struct ddog_HttpStatus {
209
+ uint16_t code;
210
+ } ddog_HttpStatus;
211
+
212
+ typedef enum ddog_prof_Exporter_SendResult_Tag {
213
+ DDOG_PROF_EXPORTER_SEND_RESULT_HTTP_RESPONSE,
214
+ DDOG_PROF_EXPORTER_SEND_RESULT_ERR,
215
+ } ddog_prof_Exporter_SendResult_Tag;
216
+
217
+ typedef struct ddog_prof_Exporter_SendResult {
218
+ ddog_prof_Exporter_SendResult_Tag tag;
219
+ union {
220
+ struct {
221
+ struct ddog_HttpStatus http_response;
222
+ };
223
+ struct {
224
+ struct ddog_Error err;
225
+ };
226
+ };
227
+ } ddog_prof_Exporter_SendResult;
228
+
229
+ typedef struct ddog_prof_ValueType {
230
+ ddog_CharSlice type_;
231
+ ddog_CharSlice unit;
232
+ } ddog_prof_ValueType;
233
+
234
+ /**
235
+ * Remember, the data inside of each member is potentially coming from FFI,
236
+ * so every operation on it is unsafe!
237
+ */
238
+ typedef struct ddog_prof_Slice_ValueType {
239
+ const struct ddog_prof_ValueType *ptr;
240
+ uintptr_t len;
241
+ } ddog_prof_Slice_ValueType;
242
+
243
+ typedef struct ddog_prof_Period {
244
+ struct ddog_prof_ValueType type_;
245
+ int64_t value;
246
+ } ddog_prof_Period;
247
+
248
+ typedef enum ddog_prof_Profile_AddResult_Tag {
249
+ DDOG_PROF_PROFILE_ADD_RESULT_OK,
250
+ DDOG_PROF_PROFILE_ADD_RESULT_ERR,
251
+ } ddog_prof_Profile_AddResult_Tag;
252
+
253
+ typedef struct ddog_prof_Profile_AddResult {
254
+ ddog_prof_Profile_AddResult_Tag tag;
255
+ union {
256
+ struct {
257
+ uint64_t ok;
258
+ };
259
+ struct {
260
+ struct ddog_Error err;
261
+ };
262
+ };
263
+ } ddog_prof_Profile_AddResult;
264
+
265
+ typedef struct ddog_prof_Mapping {
266
+ /**
267
+ * Address at which the binary (or DLL) is loaded into memory.
268
+ */
269
+ uint64_t memory_start;
270
+ /**
271
+ * The limit of the address range occupied by this mapping.
272
+ */
273
+ uint64_t memory_limit;
274
+ /**
275
+ * Offset in the binary that corresponds to the first mapped address.
276
+ */
277
+ uint64_t file_offset;
278
+ /**
279
+ * The object this entry is loaded from. This can be a filename on
280
+ * disk for the main binary and shared libraries, or virtual
281
+ * abstractions like "[vdso]".
282
+ */
283
+ ddog_CharSlice filename;
284
+ /**
285
+ * A string that uniquely identifies a particular program version
286
+ * with high probability. E.g., for binaries generated by GNU tools,
287
+ * it could be the contents of the .note.gnu.build-id field.
288
+ */
289
+ ddog_CharSlice build_id;
290
+ } ddog_prof_Mapping;
291
+
292
+ typedef struct ddog_prof_Function {
293
+ /**
294
+ * Name of the function, in human-readable form if available.
295
+ */
296
+ ddog_CharSlice name;
297
+ /**
298
+ * Name of the function, as identified by the system.
299
+ * For instance, it can be a C++ mangled name.
300
+ */
301
+ ddog_CharSlice system_name;
302
+ /**
303
+ * Source file containing the function.
304
+ */
305
+ ddog_CharSlice filename;
306
+ /**
307
+ * Line number in source file.
308
+ */
309
+ int64_t start_line;
310
+ } ddog_prof_Function;
311
+
312
+ typedef struct ddog_prof_Line {
313
+ /**
314
+ * The corresponding profile.Function for this line.
315
+ */
316
+ struct ddog_prof_Function function;
317
+ /**
318
+ * Line number in source code.
319
+ */
320
+ int64_t line;
321
+ } ddog_prof_Line;
322
+
323
+ /**
324
+ * Remember, the data inside of each member is potentially coming from FFI,
325
+ * so every operation on it is unsafe!
326
+ */
327
+ typedef struct ddog_prof_Slice_Line {
328
+ const struct ddog_prof_Line *ptr;
329
+ uintptr_t len;
330
+ } ddog_prof_Slice_Line;
331
+
332
+ typedef struct ddog_prof_Location {
333
+ /**
334
+ * todo: how to handle unknown mapping?
335
+ */
336
+ struct ddog_prof_Mapping mapping;
337
+ /**
338
+ * The instruction address for this location, if available. It
339
+ * should be within [Mapping.memory_start...Mapping.memory_limit]
340
+ * for the corresponding mapping. A non-leaf address may be in the
341
+ * middle of a call instruction. It is up to display tools to find
342
+ * the beginning of the instruction if necessary.
343
+ */
344
+ uint64_t address;
345
+ /**
346
+ * Multiple line indicates this location has inlined functions,
347
+ * where the last entry represents the caller into which the
348
+ * preceding entries were inlined.
349
+ *
350
+ * E.g., if memcpy() is inlined into printf:
351
+ * line[0].function_name == "memcpy"
352
+ * line[1].function_name == "printf"
353
+ */
354
+ struct ddog_prof_Slice_Line lines;
355
+ /**
356
+ * Provides an indication that multiple symbols map to this location's
357
+ * address, for example due to identical code folding by the linker. In that
358
+ * case the line information above represents one of the multiple
359
+ * symbols. This field must be recomputed when the symbolization state of the
360
+ * profile changes.
361
+ */
362
+ bool is_folded;
363
+ } ddog_prof_Location;
364
+
365
+ /**
366
+ * Remember, the data inside of each member is potentially coming from FFI,
367
+ * so every operation on it is unsafe!
368
+ */
369
+ typedef struct ddog_prof_Slice_Location {
370
+ const struct ddog_prof_Location *ptr;
371
+ uintptr_t len;
372
+ } ddog_prof_Slice_Location;
373
+
374
+ /**
375
+ * Remember, the data inside of each member is potentially coming from FFI,
376
+ * so every operation on it is unsafe!
377
+ */
378
+ typedef struct ddog_Slice_I64 {
379
+ const int64_t *ptr;
380
+ uintptr_t len;
381
+ } ddog_Slice_I64;
382
+
383
+ typedef struct ddog_prof_Label {
384
+ ddog_CharSlice key;
385
+ /**
386
+ * At most one of the following must be present
387
+ */
388
+ ddog_CharSlice str;
389
+ int64_t num;
390
+ /**
391
+ * Should only be present when num is present.
392
+ * Specifies the units of num.
393
+ * Use arbitrary string (for example, "requests") as a custom count unit.
394
+ * If no unit is specified, consumer may apply heuristic to deduce the unit.
395
+ * Consumers may also interpret units like "bytes" and "kilobytes" as memory
396
+ * units and units like "seconds" and "nanoseconds" as time units,
397
+ * and apply appropriate unit conversions to these.
398
+ */
399
+ ddog_CharSlice num_unit;
400
+ } ddog_prof_Label;
401
+
402
+ /**
403
+ * Remember, the data inside of each member is potentially coming from FFI,
404
+ * so every operation on it is unsafe!
405
+ */
406
+ typedef struct ddog_prof_Slice_Label {
407
+ const struct ddog_prof_Label *ptr;
408
+ uintptr_t len;
409
+ } ddog_prof_Slice_Label;
410
+
411
+ typedef struct ddog_prof_Sample {
412
+ /**
413
+ * The leaf is at locations[0].
414
+ */
415
+ struct ddog_prof_Slice_Location locations;
416
+ /**
417
+ * The type and unit of each value is defined by the corresponding
418
+ * entry in Profile.sample_type. All samples must have the same
419
+ * number of values, the same as the length of Profile.sample_type.
420
+ * When aggregating multiple samples into a single sample, the
421
+ * result has a list of values that is the element-wise sum of the
422
+ * lists of the originals.
423
+ */
424
+ struct ddog_Slice_I64 values;
425
+ /**
426
+ * label includes additional context for this sample. It can include
427
+ * things like a thread id, allocation size, etc
428
+ */
429
+ struct ddog_prof_Slice_Label labels;
430
+ } ddog_prof_Sample;
431
+
432
+ typedef struct ddog_prof_EncodedProfile {
433
+ struct ddog_Timespec start;
434
+ struct ddog_Timespec end;
435
+ struct ddog_Vec_U8 buffer;
436
+ struct ddog_prof_ProfiledEndpointsStats *endpoints_stats;
437
+ } ddog_prof_EncodedProfile;
438
+
439
+ typedef enum ddog_prof_Profile_SerializeResult_Tag {
440
+ DDOG_PROF_PROFILE_SERIALIZE_RESULT_OK,
441
+ DDOG_PROF_PROFILE_SERIALIZE_RESULT_ERR,
442
+ } ddog_prof_Profile_SerializeResult_Tag;
443
+
444
+ typedef struct ddog_prof_Profile_SerializeResult {
445
+ ddog_prof_Profile_SerializeResult_Tag tag;
446
+ union {
447
+ struct {
448
+ struct ddog_prof_EncodedProfile ok;
449
+ };
450
+ struct {
451
+ struct ddog_Error err;
452
+ };
453
+ };
454
+ } ddog_prof_Profile_SerializeResult;
455
+
456
+ /**
457
+ * # Safety
458
+ * Only pass null or a valid reference to a `ddog_Error`.
459
+ */
460
+ void ddog_Error_drop(struct ddog_Error *error);
461
+
462
+ /**
463
+ * Returns a CharSlice of the error's message that is valid until the error
464
+ * is dropped.
465
+ * # Safety
466
+ * Only pass null or a valid reference to a `ddog_Error`.
467
+ */
468
+ ddog_CharSlice ddog_Error_message(const struct ddog_Error *error);
469
+
470
+ DDOG_CHECK_RETURN struct ddog_Vec_Tag ddog_Vec_Tag_new(void);
471
+
472
+ void ddog_Vec_Tag_drop(struct ddog_Vec_Tag);
473
+
474
+ /**
475
+ * Creates a new Tag from the provided `key` and `value` by doing a utf8
476
+ * lossy conversion, and pushes into the `vec`. The strings `key` and `value`
477
+ * are cloned to avoid FFI lifetime issues.
478
+ *
479
+ * # Safety
480
+ * The `vec` must be a valid reference.
481
+ * The CharSlices `key` and `value` must point to at least many bytes as their
482
+ * `.len` properties claim.
483
+ */
484
+ DDOG_CHECK_RETURN
485
+ struct ddog_Vec_Tag_PushResult ddog_Vec_Tag_push(struct ddog_Vec_Tag *vec,
486
+ ddog_CharSlice key,
487
+ ddog_CharSlice value);
488
+
489
+ /**
490
+ * # Safety
491
+ * The `string`'s .ptr must point to a valid object at least as large as its
492
+ * .len property.
493
+ */
494
+ DDOG_CHECK_RETURN struct ddog_Vec_Tag_ParseResult ddog_Vec_Tag_parse(ddog_CharSlice string);
495
+
496
+ #endif /* DDOG_COMMON_H */