libdatadog 11.0.0.1.0-aarch64-linux → 12.0.0.1.0-aarch64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE-3rdparty.yml +247 -2
  4. data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
  5. data/vendor/{libdatadog-11.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-12.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/common.h +495 -285
  6. data/vendor/libdatadog-12.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/crashtracker.h +419 -0
  7. data/vendor/{libdatadog-11.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-12.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/profiling.h +10 -275
  8. data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  9. data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE-3rdparty.yml +247 -2
  10. data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  11. data/vendor/{libdatadog-11.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-12.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/common.h +495 -285
  12. data/vendor/libdatadog-12.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/crashtracker.h +419 -0
  13. data/vendor/{libdatadog-11.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-12.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/profiling.h +10 -275
  14. data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  15. metadata +24 -22
  16. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE +0 -0
  17. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/NOTICE +0 -0
  18. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/blazesym.h +0 -0
  19. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/telemetry.h +0 -0
  20. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +0 -0
  21. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE +0 -0
  22. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/NOTICE +0 -0
  23. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/blazesym.h +0 -0
  24. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/telemetry.h +0 -0
  25. /data/vendor/{libdatadog-11.0.0 → libdatadog-12.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +0 -0
@@ -39,6 +39,11 @@
39
39
  # define DDOG_CHECK_RETURN
40
40
  #endif
41
41
 
42
+ /**
43
+ * Default value for the timeout field in milliseconds.
44
+ */
45
+ #define ddog_Endpoint_DEFAULT_TIMEOUT 3000
46
+
42
47
  typedef struct ddog_Endpoint ddog_Endpoint;
43
48
 
44
49
  typedef struct ddog_Tag ddog_Tag;
@@ -99,284 +104,164 @@ typedef struct ddog_Option_Error {
99
104
 
100
105
  typedef struct ddog_Option_Error ddog_MaybeError;
101
106
 
102
- /**
103
- * A wrapper for returning owned strings from FFI
104
- */
105
- typedef struct ddog_StringWrapper {
106
- /**
107
- * This is a String stuffed into the vec.
108
- */
109
- struct ddog_Vec_U8 message;
110
- } ddog_StringWrapper;
111
-
112
- /**
113
- * Holds the raw parts of a Rust Vec; it should only be created from Rust,
114
- * never from C.
115
- */
116
- typedef struct ddog_Vec_Tag {
117
- const struct ddog_Tag *ptr;
118
- uintptr_t len;
119
- uintptr_t capacity;
120
- } ddog_Vec_Tag;
107
+ typedef struct ddog_ArrayQueue {
108
+ struct ddog_ArrayQueue *inner;
109
+ void (*item_delete_fn)(void*);
110
+ } ddog_ArrayQueue;
121
111
 
122
- typedef enum ddog_Vec_Tag_PushResult_Tag {
123
- DDOG_VEC_TAG_PUSH_RESULT_OK,
124
- DDOG_VEC_TAG_PUSH_RESULT_ERR,
125
- } ddog_Vec_Tag_PushResult_Tag;
112
+ typedef enum ddog_ArrayQueue_NewResult_Tag {
113
+ DDOG_ARRAY_QUEUE_NEW_RESULT_OK,
114
+ DDOG_ARRAY_QUEUE_NEW_RESULT_ERR,
115
+ } ddog_ArrayQueue_NewResult_Tag;
126
116
 
127
- typedef struct ddog_Vec_Tag_PushResult {
128
- ddog_Vec_Tag_PushResult_Tag tag;
117
+ typedef struct ddog_ArrayQueue_NewResult {
118
+ ddog_ArrayQueue_NewResult_Tag tag;
129
119
  union {
120
+ struct {
121
+ struct ddog_ArrayQueue *ok;
122
+ };
130
123
  struct {
131
124
  struct ddog_Error err;
132
125
  };
133
126
  };
134
- } ddog_Vec_Tag_PushResult;
135
-
136
- typedef struct ddog_Vec_Tag_ParseResult {
137
- struct ddog_Vec_Tag tags;
138
- struct ddog_Error *error_message;
139
- } ddog_Vec_Tag_ParseResult;
140
-
141
- typedef enum ddog_prof_DemangleOptions {
142
- DDOG_PROF_DEMANGLE_OPTIONS_COMPLETE,
143
- DDOG_PROF_DEMANGLE_OPTIONS_NAME_ONLY,
144
- } ddog_prof_DemangleOptions;
145
-
146
- typedef enum ddog_prof_NormalizedAddressTypes {
147
- DDOG_PROF_NORMALIZED_ADDRESS_TYPES_NONE = 0,
148
- DDOG_PROF_NORMALIZED_ADDRESS_TYPES_ELF,
149
- } ddog_prof_NormalizedAddressTypes;
150
-
151
- /**
152
- * This enum represents operations a profiler might be engaged in.
153
- * The idea is that if a crash consistently occurs while a particular operation
154
- * is ongoing, its likely related.
155
- *
156
- * In the future, we might also track wall-clock time of operations
157
- * (or some statistical sampling thereof) using the same enum.
158
- *
159
- * NOTE: This enum is known to be non-exhaustive. Feel free to add new types
160
- * as needed.
161
- */
162
- typedef enum ddog_prof_ProfilingOpTypes {
163
- DDOG_PROF_PROFILING_OP_TYPES_NOT_PROFILING = 0,
164
- DDOG_PROF_PROFILING_OP_TYPES_COLLECTING_SAMPLE,
165
- DDOG_PROF_PROFILING_OP_TYPES_UNWINDING,
166
- DDOG_PROF_PROFILING_OP_TYPES_SERIALIZING,
167
- /**
168
- * Dummy value to allow easier iteration
169
- */
170
- DDOG_PROF_PROFILING_OP_TYPES_SIZE,
171
- } ddog_prof_ProfilingOpTypes;
127
+ } ddog_ArrayQueue_NewResult;
172
128
 
173
129
  /**
174
- * Stacktrace collection occurs in the context of a crashing process.
175
- * If the stack is sufficiently corruputed, it is possible (but unlikely),
176
- * for stack trace collection itself to crash.
177
- * We recommend fully enabling stacktrace collection, but having an environment
178
- * variable to allow downgrading the collector.
130
+ * Data structure for the result of the push() and force_push() functions.
131
+ * force_push() replaces the oldest element if the queue is full, while push() returns the given
132
+ * value if the queue is full. For push(), it's redundant to return the value since the caller
133
+ * already has it, but it's returned for consistency with crossbeam API and with force_push().
179
134
  */
180
- typedef enum ddog_prof_StacktraceCollection {
181
- /**
182
- * Stacktrace collection occurs in the
183
- */
184
- DDOG_PROF_STACKTRACE_COLLECTION_DISABLED,
185
- DDOG_PROF_STACKTRACE_COLLECTION_WITHOUT_SYMBOLS,
186
- DDOG_PROF_STACKTRACE_COLLECTION_ENABLED_WITH_INPROCESS_SYMBOLS,
187
- DDOG_PROF_STACKTRACE_COLLECTION_ENABLED_WITH_SYMBOLS_IN_RECEIVER,
188
- } ddog_prof_StacktraceCollection;
189
-
190
- typedef struct ddog_CancellationToken ddog_CancellationToken;
191
-
192
- typedef struct ddog_prof_Exporter ddog_prof_Exporter;
135
+ typedef enum ddog_ArrayQueue_PushResult_Tag {
136
+ DDOG_ARRAY_QUEUE_PUSH_RESULT_OK,
137
+ DDOG_ARRAY_QUEUE_PUSH_RESULT_FULL,
138
+ DDOG_ARRAY_QUEUE_PUSH_RESULT_ERR,
139
+ } ddog_ArrayQueue_PushResult_Tag;
140
+
141
+ typedef struct ddog_ArrayQueue_PushResult {
142
+ ddog_ArrayQueue_PushResult_Tag tag;
143
+ union {
144
+ struct {
145
+ void *full;
146
+ };
147
+ struct {
148
+ struct ddog_Error err;
149
+ };
150
+ };
151
+ } ddog_ArrayQueue_PushResult;
193
152
 
194
- typedef struct ddog_prof_ProfiledEndpointsStats ddog_prof_ProfiledEndpointsStats;
153
+ typedef enum ddog_ArrayQueue_PopResult_Tag {
154
+ DDOG_ARRAY_QUEUE_POP_RESULT_OK,
155
+ DDOG_ARRAY_QUEUE_POP_RESULT_EMPTY,
156
+ DDOG_ARRAY_QUEUE_POP_RESULT_ERR,
157
+ } ddog_ArrayQueue_PopResult_Tag;
195
158
 
196
- typedef struct ddog_prof_Exporter_Request ddog_prof_Exporter_Request;
159
+ typedef struct ddog_ArrayQueue_PopResult {
160
+ ddog_ArrayQueue_PopResult_Tag tag;
161
+ union {
162
+ struct {
163
+ void *ok;
164
+ };
165
+ struct {
166
+ struct ddog_Error err;
167
+ };
168
+ };
169
+ } ddog_ArrayQueue_PopResult;
197
170
 
198
- /**
199
- * A generic result type for when a crashtracking operation may fail,
200
- * but there's nothing to return in the case of success.
201
- */
202
- typedef enum ddog_prof_CrashtrackerResult_Tag {
203
- DDOG_PROF_CRASHTRACKER_RESULT_OK,
204
- DDOG_PROF_CRASHTRACKER_RESULT_ERR,
205
- } ddog_prof_CrashtrackerResult_Tag;
171
+ typedef enum ddog_ArrayQueue_BoolResult_Tag {
172
+ DDOG_ARRAY_QUEUE_BOOL_RESULT_OK,
173
+ DDOG_ARRAY_QUEUE_BOOL_RESULT_ERR,
174
+ } ddog_ArrayQueue_BoolResult_Tag;
206
175
 
207
- typedef struct ddog_prof_CrashtrackerResult {
208
- ddog_prof_CrashtrackerResult_Tag tag;
176
+ typedef struct ddog_ArrayQueue_BoolResult {
177
+ ddog_ArrayQueue_BoolResult_Tag tag;
209
178
  union {
210
179
  struct {
211
- /**
212
- * Do not use the value of Ok. This value only exists to overcome
213
- * Rust -> C code generation.
214
- */
215
180
  bool ok;
216
181
  };
217
182
  struct {
218
183
  struct ddog_Error err;
219
184
  };
220
185
  };
221
- } ddog_prof_CrashtrackerResult;
222
-
223
- typedef struct ddog_prof_Slice_CharSlice {
224
- /**
225
- * Must be non-null and suitably aligned for the underlying type.
226
- */
227
- const ddog_CharSlice *ptr;
228
- /**
229
- * The number of elements (not bytes) that `.ptr` points to. Must be less
230
- * than or equal to [isize::MAX].
231
- */
232
- uintptr_t len;
233
- } ddog_prof_Slice_CharSlice;
186
+ } ddog_ArrayQueue_BoolResult;
234
187
 
235
- typedef enum ddog_prof_Endpoint_Tag {
236
- DDOG_PROF_ENDPOINT_AGENT,
237
- DDOG_PROF_ENDPOINT_AGENTLESS,
238
- DDOG_PROF_ENDPOINT_FILE,
239
- } ddog_prof_Endpoint_Tag;
240
-
241
- typedef struct ddog_prof_Endpoint_ddog_prof_Agentless_Body {
242
- ddog_CharSlice _0;
243
- ddog_CharSlice _1;
244
- } ddog_prof_Endpoint_ddog_prof_Agentless_Body;
188
+ typedef enum ddog_ArrayQueue_UsizeResult_Tag {
189
+ DDOG_ARRAY_QUEUE_USIZE_RESULT_OK,
190
+ DDOG_ARRAY_QUEUE_USIZE_RESULT_ERR,
191
+ } ddog_ArrayQueue_UsizeResult_Tag;
245
192
 
246
- typedef struct ddog_prof_Endpoint {
247
- ddog_prof_Endpoint_Tag tag;
193
+ typedef struct ddog_ArrayQueue_UsizeResult {
194
+ ddog_ArrayQueue_UsizeResult_Tag tag;
248
195
  union {
249
196
  struct {
250
- ddog_CharSlice agent;
197
+ uintptr_t ok;
251
198
  };
252
- ddog_prof_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
253
199
  struct {
254
- ddog_CharSlice file;
200
+ struct ddog_Error err;
255
201
  };
256
202
  };
257
- } ddog_prof_Endpoint;
203
+ } ddog_ArrayQueue_UsizeResult;
258
204
 
259
- typedef struct ddog_prof_CrashtrackerConfiguration {
260
- struct ddog_prof_Slice_CharSlice additional_files;
261
- bool create_alt_stack;
262
- /**
263
- * The endpoint to send the crash report to (can be a file://)
264
- *
265
- * If ProfilingEndpoint is left to a zero value (enum value for Agent + empty charslice),
266
- * the crashtracker will infer the agent host from env variables.
267
- */
268
- struct ddog_prof_Endpoint endpoint;
269
- enum ddog_prof_StacktraceCollection resolve_frames;
270
- uint64_t timeout_secs;
271
- bool wait_for_receiver;
272
- } ddog_prof_CrashtrackerConfiguration;
205
+ typedef enum ddog_Option_U32_Tag {
206
+ DDOG_OPTION_U32_SOME_U32,
207
+ DDOG_OPTION_U32_NONE_U32,
208
+ } ddog_Option_U32_Tag;
273
209
 
274
- typedef struct ddog_prof_EnvVar {
275
- ddog_CharSlice key;
276
- ddog_CharSlice val;
277
- } ddog_prof_EnvVar;
278
-
279
- typedef struct ddog_prof_Slice_EnvVar {
280
- /**
281
- * Must be non-null and suitably aligned for the underlying type.
282
- */
283
- const struct ddog_prof_EnvVar *ptr;
284
- /**
285
- * The number of elements (not bytes) that `.ptr` points to. Must be less
286
- * than or equal to [isize::MAX].
287
- */
288
- uintptr_t len;
289
- } ddog_prof_Slice_EnvVar;
290
-
291
- typedef struct ddog_prof_CrashtrackerReceiverConfig {
292
- struct ddog_prof_Slice_CharSlice args;
293
- struct ddog_prof_Slice_EnvVar env;
294
- ddog_CharSlice path_to_receiver_binary;
295
- /**
296
- * Optional filename to forward stderr to (useful for logging/debugging)
297
- */
298
- ddog_CharSlice optional_stderr_filename;
299
- /**
300
- * Optional filename to forward stdout to (useful for logging/debugging)
301
- */
302
- ddog_CharSlice optional_stdout_filename;
303
- } ddog_prof_CrashtrackerReceiverConfig;
210
+ typedef struct ddog_Option_U32 {
211
+ ddog_Option_U32_Tag tag;
212
+ union {
213
+ struct {
214
+ uint32_t some;
215
+ };
216
+ };
217
+ } ddog_Option_U32;
304
218
 
305
- typedef struct ddog_prof_CrashtrackerMetadata {
306
- ddog_CharSlice profiling_library_name;
307
- ddog_CharSlice profiling_library_version;
308
- ddog_CharSlice family;
219
+ /**
220
+ * A wrapper for returning owned strings from FFI
221
+ */
222
+ typedef struct ddog_StringWrapper {
309
223
  /**
310
- * Should include "service", "environment", etc
224
+ * This is a String stuffed into the vec.
311
225
  */
312
- const struct ddog_Vec_Tag *tags;
313
- } ddog_prof_CrashtrackerMetadata;
226
+ struct ddog_Vec_U8 message;
227
+ } ddog_StringWrapper;
314
228
 
315
229
  /**
316
- * Represents a CrashInfo. Do not access its member for any reason, only use
317
- * the C API functions on this struct.
230
+ * Holds the raw parts of a Rust Vec; it should only be created from Rust,
231
+ * never from C.
318
232
  */
319
- typedef struct ddog_prof_CrashInfo {
320
- struct ddog_prof_CrashInfo *inner;
321
- } ddog_prof_CrashInfo;
233
+ typedef struct ddog_Vec_Tag {
234
+ const struct ddog_Tag *ptr;
235
+ uintptr_t len;
236
+ uintptr_t capacity;
237
+ } ddog_Vec_Tag;
322
238
 
323
- /**
324
- * Returned by [ddog_prof_Profile_new].
325
- */
326
- typedef enum ddog_prof_CrashInfoNewResult_Tag {
327
- DDOG_PROF_CRASH_INFO_NEW_RESULT_OK,
328
- DDOG_PROF_CRASH_INFO_NEW_RESULT_ERR,
329
- } ddog_prof_CrashInfoNewResult_Tag;
239
+ typedef enum ddog_Vec_Tag_PushResult_Tag {
240
+ DDOG_VEC_TAG_PUSH_RESULT_OK,
241
+ DDOG_VEC_TAG_PUSH_RESULT_ERR,
242
+ } ddog_Vec_Tag_PushResult_Tag;
330
243
 
331
- typedef struct ddog_prof_CrashInfoNewResult {
332
- ddog_prof_CrashInfoNewResult_Tag tag;
244
+ typedef struct ddog_Vec_Tag_PushResult {
245
+ ddog_Vec_Tag_PushResult_Tag tag;
333
246
  union {
334
- struct {
335
- struct ddog_prof_CrashInfo ok;
336
- };
337
247
  struct {
338
248
  struct ddog_Error err;
339
249
  };
340
250
  };
341
- } ddog_prof_CrashInfoNewResult;
251
+ } ddog_Vec_Tag_PushResult;
342
252
 
343
- typedef struct ddog_prof_SigInfo {
344
- uint64_t signum;
345
- ddog_CharSlice signame;
346
- } ddog_prof_SigInfo;
253
+ typedef struct ddog_Vec_Tag_ParseResult {
254
+ struct ddog_Vec_Tag tags;
255
+ struct ddog_Error *error_message;
256
+ } ddog_Vec_Tag_ParseResult;
347
257
 
348
- typedef enum ddog_prof_Option_U32_Tag {
349
- DDOG_PROF_OPTION_U32_SOME_U32,
350
- DDOG_PROF_OPTION_U32_NONE_U32,
351
- } ddog_prof_Option_U32_Tag;
258
+ typedef struct ddog_CancellationToken ddog_CancellationToken;
352
259
 
353
- typedef struct ddog_prof_Option_U32 {
354
- ddog_prof_Option_U32_Tag tag;
355
- union {
356
- struct {
357
- uint32_t some;
358
- };
359
- };
360
- } ddog_prof_Option_U32;
260
+ typedef struct ddog_prof_Exporter ddog_prof_Exporter;
361
261
 
362
- typedef struct ddog_prof_StackFrameNames {
363
- struct ddog_prof_Option_U32 colno;
364
- ddog_CharSlice filename;
365
- struct ddog_prof_Option_U32 lineno;
366
- ddog_CharSlice name;
367
- } ddog_prof_StackFrameNames;
262
+ typedef struct ddog_prof_ProfiledEndpointsStats ddog_prof_ProfiledEndpointsStats;
368
263
 
369
- typedef struct ddog_prof_Slice_StackFrameNames {
370
- /**
371
- * Must be non-null and suitably aligned for the underlying type.
372
- */
373
- const struct ddog_prof_StackFrameNames *ptr;
374
- /**
375
- * The number of elements (not bytes) that `.ptr` points to. Must be less
376
- * than or equal to [isize::MAX].
377
- */
378
- uintptr_t len;
379
- } ddog_prof_Slice_StackFrameNames;
264
+ typedef struct ddog_prof_Exporter_Request ddog_prof_Exporter_Request;
380
265
 
381
266
  typedef struct ddog_Slice_U8 {
382
267
  /**
@@ -395,81 +280,46 @@ typedef struct ddog_Slice_U8 {
395
280
  */
396
281
  typedef struct ddog_Slice_U8 ddog_ByteSlice;
397
282
 
398
- typedef struct ddog_prof_NormalizedAddress {
399
- uint64_t file_offset;
400
- ddog_ByteSlice build_id;
401
- ddog_CharSlice path;
402
- enum ddog_prof_NormalizedAddressTypes typ;
403
- } ddog_prof_NormalizedAddress;
404
-
405
- typedef struct ddog_prof_StackFrame {
406
- ddog_CharSlice build_id;
407
- uintptr_t ip;
408
- uintptr_t module_base_address;
409
- struct ddog_prof_Slice_StackFrameNames names;
410
- struct ddog_prof_NormalizedAddress normalized_ip;
411
- uintptr_t sp;
412
- uintptr_t symbol_address;
413
- } ddog_prof_StackFrame;
283
+ typedef struct ddog_prof_Exporter_File {
284
+ ddog_CharSlice name;
285
+ ddog_ByteSlice file;
286
+ } ddog_prof_Exporter_File;
414
287
 
415
- typedef struct ddog_prof_Slice_StackFrame {
288
+ typedef struct ddog_prof_Exporter_Slice_File {
416
289
  /**
417
290
  * Must be non-null and suitably aligned for the underlying type.
418
291
  */
419
- const struct ddog_prof_StackFrame *ptr;
292
+ const struct ddog_prof_Exporter_File *ptr;
420
293
  /**
421
294
  * The number of elements (not bytes) that `.ptr` points to. Must be less
422
295
  * than or equal to [isize::MAX].
423
296
  */
424
297
  uintptr_t len;
425
- } ddog_prof_Slice_StackFrame;
298
+ } ddog_prof_Exporter_Slice_File;
426
299
 
427
- /**
428
- * A wrapper for returning owned strings from FFI
429
- */
430
- typedef struct ddog_prof_StringWrapper {
431
- /**
432
- * This is a String stuffed into the vec.
433
- */
434
- struct ddog_Vec_U8 message;
435
- } ddog_prof_StringWrapper;
300
+ typedef enum ddog_prof_Endpoint_Tag {
301
+ DDOG_PROF_ENDPOINT_AGENT,
302
+ DDOG_PROF_ENDPOINT_AGENTLESS,
303
+ DDOG_PROF_ENDPOINT_FILE,
304
+ } ddog_prof_Endpoint_Tag;
436
305
 
437
- /**
438
- * Returned by [ddog_prof_Profile_new].
439
- */
440
- typedef enum ddog_prof_StringWrapperResult_Tag {
441
- DDOG_PROF_STRING_WRAPPER_RESULT_OK,
442
- DDOG_PROF_STRING_WRAPPER_RESULT_ERR,
443
- } ddog_prof_StringWrapperResult_Tag;
306
+ typedef struct ddog_prof_Endpoint_ddog_prof_Agentless_Body {
307
+ ddog_CharSlice _0;
308
+ ddog_CharSlice _1;
309
+ } ddog_prof_Endpoint_ddog_prof_Agentless_Body;
444
310
 
445
- typedef struct ddog_prof_StringWrapperResult {
446
- ddog_prof_StringWrapperResult_Tag tag;
311
+ typedef struct ddog_prof_Endpoint {
312
+ ddog_prof_Endpoint_Tag tag;
447
313
  union {
448
314
  struct {
449
- struct ddog_prof_StringWrapper ok;
315
+ ddog_CharSlice agent;
450
316
  };
317
+ ddog_prof_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
451
318
  struct {
452
- struct ddog_Error err;
319
+ ddog_CharSlice file;
453
320
  };
454
321
  };
455
- } ddog_prof_StringWrapperResult;
456
-
457
- typedef struct ddog_prof_Exporter_File {
458
- ddog_CharSlice name;
459
- ddog_ByteSlice file;
460
- } ddog_prof_Exporter_File;
461
-
462
- typedef struct ddog_prof_Exporter_Slice_File {
463
- /**
464
- * Must be non-null and suitably aligned for the underlying type.
465
- */
466
- const struct ddog_prof_Exporter_File *ptr;
467
- /**
468
- * The number of elements (not bytes) that `.ptr` points to. Must be less
469
- * than or equal to [isize::MAX].
470
- */
471
- uintptr_t len;
472
- } ddog_prof_Exporter_Slice_File;
322
+ } ddog_prof_Endpoint;
473
323
 
474
324
  typedef enum ddog_prof_Exporter_NewResult_Tag {
475
325
  DDOG_PROF_EXPORTER_NEW_RESULT_OK,
@@ -488,6 +338,22 @@ typedef struct ddog_prof_Exporter_NewResult {
488
338
  };
489
339
  } ddog_prof_Exporter_NewResult;
490
340
 
341
+ typedef enum ddog_prof_Option_Error_Tag {
342
+ DDOG_PROF_OPTION_ERROR_SOME_ERROR,
343
+ DDOG_PROF_OPTION_ERROR_NONE_ERROR,
344
+ } ddog_prof_Option_Error_Tag;
345
+
346
+ typedef struct ddog_prof_Option_Error {
347
+ ddog_prof_Option_Error_Tag tag;
348
+ union {
349
+ struct {
350
+ struct ddog_Error some;
351
+ };
352
+ };
353
+ } ddog_prof_Option_Error;
354
+
355
+ typedef struct ddog_prof_Option_Error ddog_prof_MaybeError;
356
+
491
357
  typedef enum ddog_prof_Exporter_Request_BuildResult_Tag {
492
358
  DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_OK,
493
359
  DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_ERR,
@@ -873,6 +739,272 @@ typedef struct ddog_ContextKey {
873
739
  enum ddog_MetricType _1;
874
740
  } ddog_ContextKey;
875
741
 
742
+ typedef enum ddog_crasht_DemangleOptions {
743
+ DDOG_CRASHT_DEMANGLE_OPTIONS_COMPLETE,
744
+ DDOG_CRASHT_DEMANGLE_OPTIONS_NAME_ONLY,
745
+ } ddog_crasht_DemangleOptions;
746
+
747
+ typedef enum ddog_crasht_NormalizedAddressTypes {
748
+ DDOG_CRASHT_NORMALIZED_ADDRESS_TYPES_NONE = 0,
749
+ DDOG_CRASHT_NORMALIZED_ADDRESS_TYPES_ELF,
750
+ } ddog_crasht_NormalizedAddressTypes;
751
+
752
+ /**
753
+ * This enum represents operations a the tracked library might be engaged in.
754
+ * Currently only implemented for profiling.
755
+ * The idea is that if a crash consistently occurs while a particular operation
756
+ * is ongoing, its likely related.
757
+ *
758
+ * In the future, we might also track wall-clock time of operations
759
+ * (or some statistical sampling thereof) using the same enum.
760
+ *
761
+ * NOTE: This enum is known to be non-exhaustive. Feel free to add new types
762
+ * as needed.
763
+ */
764
+ typedef enum ddog_crasht_OpTypes {
765
+ DDOG_CRASHT_OP_TYPES_PROFILER_INACTIVE = 0,
766
+ DDOG_CRASHT_OP_TYPES_PROFILER_COLLECTING_SAMPLE,
767
+ DDOG_CRASHT_OP_TYPES_PROFILER_UNWINDING,
768
+ DDOG_CRASHT_OP_TYPES_PROFILER_SERIALIZING,
769
+ /**
770
+ * Dummy value to allow easier iteration
771
+ */
772
+ DDOG_CRASHT_OP_TYPES_SIZE,
773
+ } ddog_crasht_OpTypes;
774
+
775
+ /**
776
+ * Stacktrace collection occurs in the context of a crashing process.
777
+ * If the stack is sufficiently corruputed, it is possible (but unlikely),
778
+ * for stack trace collection itself to crash.
779
+ * We recommend fully enabling stacktrace collection, but having an environment
780
+ * variable to allow downgrading the collector.
781
+ */
782
+ typedef enum ddog_crasht_StacktraceCollection {
783
+ /**
784
+ * Stacktrace collection occurs in the
785
+ */
786
+ DDOG_CRASHT_STACKTRACE_COLLECTION_DISABLED,
787
+ DDOG_CRASHT_STACKTRACE_COLLECTION_WITHOUT_SYMBOLS,
788
+ DDOG_CRASHT_STACKTRACE_COLLECTION_ENABLED_WITH_INPROCESS_SYMBOLS,
789
+ DDOG_CRASHT_STACKTRACE_COLLECTION_ENABLED_WITH_SYMBOLS_IN_RECEIVER,
790
+ } ddog_crasht_StacktraceCollection;
791
+
792
+ /**
793
+ * A generic result type for when a crashtracking operation may fail,
794
+ * but there's nothing to return in the case of success.
795
+ */
796
+ typedef enum ddog_crasht_Result_Tag {
797
+ DDOG_CRASHT_RESULT_OK,
798
+ DDOG_CRASHT_RESULT_ERR,
799
+ } ddog_crasht_Result_Tag;
800
+
801
+ typedef struct ddog_crasht_Result {
802
+ ddog_crasht_Result_Tag tag;
803
+ union {
804
+ struct {
805
+ /**
806
+ * Do not use the value of Ok. This value only exists to overcome
807
+ * Rust -> C code generation.
808
+ */
809
+ bool ok;
810
+ };
811
+ struct {
812
+ struct ddog_Error err;
813
+ };
814
+ };
815
+ } ddog_crasht_Result;
816
+
817
+ typedef struct ddog_crasht_Slice_CharSlice {
818
+ /**
819
+ * Must be non-null and suitably aligned for the underlying type.
820
+ */
821
+ const ddog_CharSlice *ptr;
822
+ /**
823
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
824
+ * than or equal to [isize::MAX].
825
+ */
826
+ uintptr_t len;
827
+ } ddog_crasht_Slice_CharSlice;
828
+
829
+ typedef struct ddog_crasht_Config {
830
+ struct ddog_crasht_Slice_CharSlice additional_files;
831
+ bool create_alt_stack;
832
+ /**
833
+ * The endpoint to send the crash report to (can be a file://).
834
+ * If None, the crashtracker will infer the agent host from env variables.
835
+ */
836
+ const struct ddog_Endpoint *endpoint;
837
+ enum ddog_crasht_StacktraceCollection resolve_frames;
838
+ uint64_t timeout_secs;
839
+ bool wait_for_receiver;
840
+ } ddog_crasht_Config;
841
+
842
+ typedef struct ddog_crasht_EnvVar {
843
+ ddog_CharSlice key;
844
+ ddog_CharSlice val;
845
+ } ddog_crasht_EnvVar;
846
+
847
+ typedef struct ddog_crasht_Slice_EnvVar {
848
+ /**
849
+ * Must be non-null and suitably aligned for the underlying type.
850
+ */
851
+ const struct ddog_crasht_EnvVar *ptr;
852
+ /**
853
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
854
+ * than or equal to [isize::MAX].
855
+ */
856
+ uintptr_t len;
857
+ } ddog_crasht_Slice_EnvVar;
858
+
859
+ typedef struct ddog_crasht_ReceiverConfig {
860
+ struct ddog_crasht_Slice_CharSlice args;
861
+ struct ddog_crasht_Slice_EnvVar env;
862
+ ddog_CharSlice path_to_receiver_binary;
863
+ /**
864
+ * Optional filename to forward stderr to (useful for logging/debugging)
865
+ */
866
+ ddog_CharSlice optional_stderr_filename;
867
+ /**
868
+ * Optional filename to forward stdout to (useful for logging/debugging)
869
+ */
870
+ ddog_CharSlice optional_stdout_filename;
871
+ } ddog_crasht_ReceiverConfig;
872
+
873
+ typedef struct ddog_crasht_Metadata {
874
+ ddog_CharSlice library_name;
875
+ ddog_CharSlice library_version;
876
+ ddog_CharSlice family;
877
+ /**
878
+ * Should include "service", "environment", etc
879
+ */
880
+ const struct ddog_Vec_Tag *tags;
881
+ } ddog_crasht_Metadata;
882
+
883
+ typedef enum ddog_crasht_UsizeResult_Tag {
884
+ DDOG_CRASHT_USIZE_RESULT_OK,
885
+ DDOG_CRASHT_USIZE_RESULT_ERR,
886
+ } ddog_crasht_UsizeResult_Tag;
887
+
888
+ typedef struct ddog_crasht_UsizeResult {
889
+ ddog_crasht_UsizeResult_Tag tag;
890
+ union {
891
+ struct {
892
+ uintptr_t ok;
893
+ };
894
+ struct {
895
+ struct ddog_Error err;
896
+ };
897
+ };
898
+ } ddog_crasht_UsizeResult;
899
+
900
+ /**
901
+ * Represents a CrashInfo. Do not access its member for any reason, only use
902
+ * the C API functions on this struct.
903
+ */
904
+ typedef struct ddog_crasht_CrashInfo {
905
+ struct ddog_crasht_CrashInfo *inner;
906
+ } ddog_crasht_CrashInfo;
907
+
908
+ /**
909
+ * Returned by [ddog_prof_Profile_new].
910
+ */
911
+ typedef enum ddog_crasht_CrashInfoNewResult_Tag {
912
+ DDOG_CRASHT_CRASH_INFO_NEW_RESULT_OK,
913
+ DDOG_CRASHT_CRASH_INFO_NEW_RESULT_ERR,
914
+ } ddog_crasht_CrashInfoNewResult_Tag;
915
+
916
+ typedef struct ddog_crasht_CrashInfoNewResult {
917
+ ddog_crasht_CrashInfoNewResult_Tag tag;
918
+ union {
919
+ struct {
920
+ struct ddog_crasht_CrashInfo ok;
921
+ };
922
+ struct {
923
+ struct ddog_Error err;
924
+ };
925
+ };
926
+ } ddog_crasht_CrashInfoNewResult;
927
+
928
+ typedef struct ddog_crasht_SigInfo {
929
+ uint64_t signum;
930
+ ddog_CharSlice signame;
931
+ } ddog_crasht_SigInfo;
932
+
933
+ typedef struct ddog_crasht_StackFrameNames {
934
+ struct ddog_Option_U32 colno;
935
+ ddog_CharSlice filename;
936
+ struct ddog_Option_U32 lineno;
937
+ ddog_CharSlice name;
938
+ } ddog_crasht_StackFrameNames;
939
+
940
+ typedef struct ddog_crasht_Slice_StackFrameNames {
941
+ /**
942
+ * Must be non-null and suitably aligned for the underlying type.
943
+ */
944
+ const struct ddog_crasht_StackFrameNames *ptr;
945
+ /**
946
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
947
+ * than or equal to [isize::MAX].
948
+ */
949
+ uintptr_t len;
950
+ } ddog_crasht_Slice_StackFrameNames;
951
+
952
+ typedef struct ddog_crasht_NormalizedAddress {
953
+ uint64_t file_offset;
954
+ ddog_ByteSlice build_id;
955
+ ddog_CharSlice path;
956
+ enum ddog_crasht_NormalizedAddressTypes typ;
957
+ } ddog_crasht_NormalizedAddress;
958
+
959
+ typedef struct ddog_crasht_StackFrame {
960
+ ddog_CharSlice build_id;
961
+ uintptr_t ip;
962
+ uintptr_t module_base_address;
963
+ struct ddog_crasht_Slice_StackFrameNames names;
964
+ struct ddog_crasht_NormalizedAddress normalized_ip;
965
+ uintptr_t sp;
966
+ uintptr_t symbol_address;
967
+ } ddog_crasht_StackFrame;
968
+
969
+ typedef struct ddog_crasht_Slice_StackFrame {
970
+ /**
971
+ * Must be non-null and suitably aligned for the underlying type.
972
+ */
973
+ const struct ddog_crasht_StackFrame *ptr;
974
+ /**
975
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
976
+ * than or equal to [isize::MAX].
977
+ */
978
+ uintptr_t len;
979
+ } ddog_crasht_Slice_StackFrame;
980
+
981
+ /**
982
+ * A wrapper for returning owned strings from FFI
983
+ */
984
+ typedef struct ddog_crasht_StringWrapper {
985
+ /**
986
+ * This is a String stuffed into the vec.
987
+ */
988
+ struct ddog_Vec_U8 message;
989
+ } ddog_crasht_StringWrapper;
990
+
991
+ typedef enum ddog_crasht_StringWrapperResult_Tag {
992
+ DDOG_CRASHT_STRING_WRAPPER_RESULT_OK,
993
+ DDOG_CRASHT_STRING_WRAPPER_RESULT_ERR,
994
+ } ddog_crasht_StringWrapperResult_Tag;
995
+
996
+ typedef struct ddog_crasht_StringWrapperResult {
997
+ ddog_crasht_StringWrapperResult_Tag tag;
998
+ union {
999
+ struct {
1000
+ struct ddog_crasht_StringWrapper ok;
1001
+ };
1002
+ struct {
1003
+ struct ddog_Error err;
1004
+ };
1005
+ };
1006
+ } ddog_crasht_StringWrapperResult;
1007
+
876
1008
  #ifdef __cplusplus
877
1009
  extern "C" {
878
1010
  #endif // __cplusplus
@@ -893,8 +1025,80 @@ ddog_CharSlice ddog_Error_message(const struct ddog_Error *error);
893
1025
 
894
1026
  void ddog_MaybeError_drop(ddog_MaybeError);
895
1027
 
1028
+ /**
1029
+ * Creates a new ArrayQueue with the given capacity and item_delete_fn.
1030
+ * The item_delete_fn is called when an item is dropped from the queue.
1031
+ */
1032
+ DDOG_CHECK_RETURN
1033
+ struct ddog_ArrayQueue_NewResult ddog_ArrayQueue_new(uintptr_t capacity,
1034
+ void (*item_delete_fn)(void*));
1035
+
1036
+ /**
1037
+ * Drops the ArrayQueue.
1038
+ * # Safety
1039
+ * The pointer is null or points to a valid memory location allocated by ArrayQueue_new.
1040
+ */
1041
+ void ddog_ArrayQueue_drop(struct ddog_ArrayQueue *queue);
1042
+
1043
+ /**
1044
+ * Pushes an item into the ArrayQueue. It returns the given value if the queue is full.
1045
+ * # Safety
1046
+ * The pointer is null or points to a valid memory location allocated by ArrayQueue_new. The value
1047
+ * is null or points to a valid memory location that can be deallocated by the item_delete_fn.
1048
+ */
1049
+ struct ddog_ArrayQueue_PushResult ddog_ArrayQueue_push(const struct ddog_ArrayQueue *queue_ptr,
1050
+ void *value);
1051
+
1052
+ /**
1053
+ * Pushes an element into the queue, replacing the oldest element if necessary.
1054
+ * # Safety
1055
+ * The pointer is null or points to a valid memory location allocated by ArrayQueue_new. The value
1056
+ * is null or points to a valid memory location that can be deallocated by the item_delete_fn.
1057
+ */
1058
+ DDOG_CHECK_RETURN
1059
+ struct ddog_ArrayQueue_PushResult ddog_ArrayQueue_force_push(const struct ddog_ArrayQueue *queue_ptr,
1060
+ void *value);
1061
+
1062
+ /**
1063
+ * Pops an item from the ArrayQueue.
1064
+ * # Safety
1065
+ * The pointer is null or points to a valid memory location allocated by ArrayQueue_new.
1066
+ */
1067
+ DDOG_CHECK_RETURN
1068
+ struct ddog_ArrayQueue_PopResult ddog_ArrayQueue_pop(const struct ddog_ArrayQueue *queue_ptr);
1069
+
1070
+ /**
1071
+ * Checks if the ArrayQueue is empty.
1072
+ * # Safety
1073
+ * The pointer is null or points to a valid memory location allocated by ArrayQueue_new.
1074
+ */
1075
+ struct ddog_ArrayQueue_BoolResult ddog_ArrayQueue_is_empty(const struct ddog_ArrayQueue *queue_ptr);
1076
+
1077
+ /**
1078
+ * Returns the length of the ArrayQueue.
1079
+ * # Safety
1080
+ * The pointer is null or points to a valid memory location allocated by ArrayQueue_new.
1081
+ */
1082
+ struct ddog_ArrayQueue_UsizeResult ddog_ArrayQueue_len(const struct ddog_ArrayQueue *queue_ptr);
1083
+
1084
+ /**
1085
+ * Returns true if the underlying queue is full.
1086
+ * # Safety
1087
+ * The pointer is null or points to a valid memory location allocated by ArrayQueue_new.
1088
+ */
1089
+ struct ddog_ArrayQueue_BoolResult ddog_ArrayQueue_is_full(const struct ddog_ArrayQueue *queue_ptr);
1090
+
1091
+ /**
1092
+ * Returns the capacity of the ArrayQueue.
1093
+ * # Safety
1094
+ * The pointer is null or points to a valid memory location allocated by ArrayQueue_new.
1095
+ */
1096
+ struct ddog_ArrayQueue_UsizeResult ddog_ArrayQueue_capacity(const struct ddog_ArrayQueue *queue_ptr);
1097
+
896
1098
  DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_url(ddog_CharSlice url);
897
1099
 
1100
+ DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_filename(ddog_CharSlice filename);
1101
+
898
1102
  DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_api_key(ddog_CharSlice api_key);
899
1103
 
900
1104
  DDOG_CHECK_RETURN
@@ -902,8 +1106,14 @@ struct ddog_Error *ddog_endpoint_from_api_key_and_site(ddog_CharSlice api_key,
902
1106
  ddog_CharSlice site,
903
1107
  struct ddog_Endpoint **endpoint);
904
1108
 
1109
+ void ddog_endpoint_set_timeout(struct ddog_Endpoint *endpoint, uint64_t millis);
1110
+
905
1111
  void ddog_endpoint_drop(struct ddog_Endpoint*);
906
1112
 
1113
+ struct ddog_Option_U32 ddog_Option_U32_some(uint32_t v);
1114
+
1115
+ struct ddog_Option_U32 ddog_Option_U32_none(void);
1116
+
907
1117
  /**
908
1118
  * # Safety
909
1119
  * Only pass null or a valid reference to a `ddog_StringWrapper`.