libdatadog 10.0.0.1.0-x86_64-linux → 12.0.0.1.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +6687 -1277
  4. data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
  5. data/vendor/libdatadog-12.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/blazesym.h +1229 -0
  6. data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/common.h +487 -262
  7. data/vendor/libdatadog-12.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/crashtracker.h +419 -0
  8. data/vendor/{libdatadog-10.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-12.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu}/include/datadog/profiling.h +10 -248
  9. data/vendor/libdatadog-12.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  10. data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +6687 -1277
  11. data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  12. data/vendor/libdatadog-12.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/blazesym.h +1229 -0
  13. data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/common.h +487 -262
  14. data/vendor/libdatadog-12.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/crashtracker.h +419 -0
  15. data/vendor/{libdatadog-10.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-12.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/profiling.h +10 -248
  16. data/vendor/libdatadog-12.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  17. metadata +25 -23
  18. data/vendor/libdatadog-10.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/blazesym.h +0 -895
  19. data/vendor/libdatadog-10.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  20. data/vendor/libdatadog-10.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/blazesym.h +0 -895
  21. data/vendor/libdatadog-10.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  22. /data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE +0 -0
  23. /data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/NOTICE +0 -0
  24. /data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/telemetry.h +0 -0
  25. /data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +0 -0
  26. /data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE +0 -0
  27. /data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/NOTICE +0 -0
  28. /data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/telemetry.h +0 -0
  29. /data/vendor/{libdatadog-10.0.0 → libdatadog-12.0.0}/x86_64-linux-musl/libdatadog-x86_64-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,328 +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;
107
+ typedef struct ddog_ArrayQueue {
108
+ struct ddog_ArrayQueue *inner;
109
+ void (*item_delete_fn)(void*);
110
+ } ddog_ArrayQueue;
111
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;
121
-
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
- /**
147
- * This enum represents operations a profiler might be engaged in.
148
- * The idea is that if a crash consistently occurs while a particular operation
149
- * is ongoing, its likely related.
150
- *
151
- * In the future, we might also track wall-clock time of operations
152
- * (or some statistical sampling thereof) using the same enum.
153
- *
154
- * NOTE: This enum is known to be non-exhaustive. Feel free to add new types
155
- * as needed.
156
- */
157
- typedef enum ddog_prof_ProfilingOpTypes {
158
- DDOG_PROF_PROFILING_OP_TYPES_NOT_PROFILING = 0,
159
- DDOG_PROF_PROFILING_OP_TYPES_COLLECTING_SAMPLE,
160
- DDOG_PROF_PROFILING_OP_TYPES_UNWINDING,
161
- DDOG_PROF_PROFILING_OP_TYPES_SERIALIZING,
162
- /**
163
- * Dummy value to allow easier iteration
164
- */
165
- DDOG_PROF_PROFILING_OP_TYPES_SIZE,
166
- } ddog_prof_ProfilingOpTypes;
127
+ } ddog_ArrayQueue_NewResult;
167
128
 
168
129
  /**
169
- * Stacktrace collection occurs in the context of a crashing process.
170
- * If the stack is sufficiently corruputed, it is possible (but unlikely),
171
- * for stack trace collection itself to crash.
172
- * We recommend fully enabling stacktrace collection, but having an environment
173
- * 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().
174
134
  */
175
- typedef enum ddog_prof_StacktraceCollection {
176
- /**
177
- * Stacktrace collection occurs in the
178
- */
179
- DDOG_PROF_STACKTRACE_COLLECTION_DISABLED,
180
- DDOG_PROF_STACKTRACE_COLLECTION_WITHOUT_SYMBOLS,
181
- DDOG_PROF_STACKTRACE_COLLECTION_ENABLED_WITH_INPROCESS_SYMBOLS,
182
- DDOG_PROF_STACKTRACE_COLLECTION_ENABLED_WITH_SYMBOLS_IN_RECEIVER,
183
- } ddog_prof_StacktraceCollection;
184
-
185
- typedef struct ddog_CancellationToken ddog_CancellationToken;
186
-
187
- typedef struct ddog_prof_Exporter ddog_prof_Exporter;
188
-
189
- typedef struct ddog_prof_ProfiledEndpointsStats ddog_prof_ProfiledEndpointsStats;
190
-
191
- typedef struct ddog_prof_Exporter_Request ddog_prof_Exporter_Request;
192
-
193
- /**
194
- * A generic result type for when a crashtracking operation may fail,
195
- * but there's nothing to return in the case of success.
196
- */
197
- typedef enum ddog_prof_CrashtrackerResult_Tag {
198
- DDOG_PROF_CRASHTRACKER_RESULT_OK,
199
- DDOG_PROF_CRASHTRACKER_RESULT_ERR,
200
- } ddog_prof_CrashtrackerResult_Tag;
201
-
202
- typedef struct ddog_prof_CrashtrackerResult {
203
- ddog_prof_CrashtrackerResult_Tag tag;
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;
204
143
  union {
205
144
  struct {
206
- /**
207
- * Do not use the value of Ok. This value only exists to overcome
208
- * Rust -> C code generation.
209
- */
210
- bool ok;
145
+ void *full;
211
146
  };
212
147
  struct {
213
148
  struct ddog_Error err;
214
149
  };
215
150
  };
216
- } ddog_prof_CrashtrackerResult;
217
-
218
- typedef struct ddog_prof_Slice_CharSlice {
219
- /**
220
- * Must be non-null and suitably aligned for the underlying type.
221
- */
222
- const ddog_CharSlice *ptr;
223
- /**
224
- * The number of elements (not bytes) that `.ptr` points to. Must be less
225
- * than or equal to [isize::MAX].
226
- */
227
- uintptr_t len;
228
- } ddog_prof_Slice_CharSlice;
229
-
230
- typedef enum ddog_prof_Endpoint_Tag {
231
- DDOG_PROF_ENDPOINT_AGENT,
232
- DDOG_PROF_ENDPOINT_AGENTLESS,
233
- DDOG_PROF_ENDPOINT_FILE,
234
- } ddog_prof_Endpoint_Tag;
151
+ } ddog_ArrayQueue_PushResult;
235
152
 
236
- typedef struct ddog_prof_Endpoint_ddog_prof_Agentless_Body {
237
- ddog_CharSlice _0;
238
- ddog_CharSlice _1;
239
- } ddog_prof_Endpoint_ddog_prof_Agentless_Body;
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;
240
158
 
241
- typedef struct ddog_prof_Endpoint {
242
- ddog_prof_Endpoint_Tag tag;
159
+ typedef struct ddog_ArrayQueue_PopResult {
160
+ ddog_ArrayQueue_PopResult_Tag tag;
243
161
  union {
244
162
  struct {
245
- ddog_CharSlice agent;
163
+ void *ok;
246
164
  };
247
- ddog_prof_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
248
165
  struct {
249
- ddog_CharSlice file;
166
+ struct ddog_Error err;
250
167
  };
251
168
  };
252
- } ddog_prof_Endpoint;
253
-
254
- typedef struct ddog_prof_CrashtrackerConfiguration {
255
- struct ddog_prof_Slice_CharSlice additional_files;
256
- bool create_alt_stack;
257
- /**
258
- * The endpoint to send the crash report to (can be a file://)
259
- *
260
- * If ProfilingEndpoint is left to a zero value (enum value for Agent + empty charslice),
261
- * the crashtracker will infer the agent host from env variables.
262
- */
263
- struct ddog_prof_Endpoint endpoint;
264
- enum ddog_prof_StacktraceCollection resolve_frames;
265
- uint64_t timeout_secs;
266
- } ddog_prof_CrashtrackerConfiguration;
267
-
268
- typedef struct ddog_prof_EnvVar {
269
- ddog_CharSlice key;
270
- ddog_CharSlice val;
271
- } ddog_prof_EnvVar;
169
+ } ddog_ArrayQueue_PopResult;
272
170
 
273
- typedef struct ddog_prof_Slice_EnvVar {
274
- /**
275
- * Must be non-null and suitably aligned for the underlying type.
276
- */
277
- const struct ddog_prof_EnvVar *ptr;
278
- /**
279
- * The number of elements (not bytes) that `.ptr` points to. Must be less
280
- * than or equal to [isize::MAX].
281
- */
282
- uintptr_t len;
283
- } ddog_prof_Slice_EnvVar;
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;
284
175
 
285
- typedef struct ddog_prof_CrashtrackerReceiverConfig {
286
- struct ddog_prof_Slice_CharSlice args;
287
- struct ddog_prof_Slice_EnvVar env;
288
- ddog_CharSlice path_to_receiver_binary;
289
- /**
290
- * Optional filename to forward stderr to (useful for logging/debugging)
291
- */
292
- ddog_CharSlice optional_stderr_filename;
293
- /**
294
- * Optional filename to forward stdout to (useful for logging/debugging)
295
- */
296
- ddog_CharSlice optional_stdout_filename;
297
- } ddog_prof_CrashtrackerReceiverConfig;
298
-
299
- typedef struct ddog_prof_CrashtrackerMetadata {
300
- ddog_CharSlice profiling_library_name;
301
- ddog_CharSlice profiling_library_version;
302
- ddog_CharSlice family;
303
- /**
304
- * Should include "service", "environment", etc
305
- */
306
- const struct ddog_Vec_Tag *tags;
307
- } ddog_prof_CrashtrackerMetadata;
308
-
309
- /**
310
- * Represents a CrashInfo. Do not access its member for any reason, only use
311
- * the C API functions on this struct.
312
- */
313
- typedef struct ddog_prof_CrashInfo {
314
- struct ddog_prof_CrashInfo *inner;
315
- } ddog_prof_CrashInfo;
176
+ typedef struct ddog_ArrayQueue_BoolResult {
177
+ ddog_ArrayQueue_BoolResult_Tag tag;
178
+ union {
179
+ struct {
180
+ bool ok;
181
+ };
182
+ struct {
183
+ struct ddog_Error err;
184
+ };
185
+ };
186
+ } ddog_ArrayQueue_BoolResult;
316
187
 
317
- /**
318
- * Returned by [ddog_prof_Profile_new].
319
- */
320
- typedef enum ddog_prof_CrashInfoNewResult_Tag {
321
- DDOG_PROF_CRASH_INFO_NEW_RESULT_OK,
322
- DDOG_PROF_CRASH_INFO_NEW_RESULT_ERR,
323
- } ddog_prof_CrashInfoNewResult_Tag;
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;
324
192
 
325
- typedef struct ddog_prof_CrashInfoNewResult {
326
- ddog_prof_CrashInfoNewResult_Tag tag;
193
+ typedef struct ddog_ArrayQueue_UsizeResult {
194
+ ddog_ArrayQueue_UsizeResult_Tag tag;
327
195
  union {
328
196
  struct {
329
- struct ddog_prof_CrashInfo ok;
197
+ uintptr_t ok;
330
198
  };
331
199
  struct {
332
200
  struct ddog_Error err;
333
201
  };
334
202
  };
335
- } ddog_prof_CrashInfoNewResult;
203
+ } ddog_ArrayQueue_UsizeResult;
336
204
 
337
- typedef struct ddog_prof_SigInfo {
338
- uint64_t signum;
339
- ddog_CharSlice signame;
340
- } ddog_prof_SigInfo;
341
-
342
- typedef enum ddog_prof_Option_U32_Tag {
343
- DDOG_PROF_OPTION_U32_SOME_U32,
344
- DDOG_PROF_OPTION_U32_NONE_U32,
345
- } ddog_prof_Option_U32_Tag;
205
+ typedef enum ddog_Option_U32_Tag {
206
+ DDOG_OPTION_U32_SOME_U32,
207
+ DDOG_OPTION_U32_NONE_U32,
208
+ } ddog_Option_U32_Tag;
346
209
 
347
- typedef struct ddog_prof_Option_U32 {
348
- ddog_prof_Option_U32_Tag tag;
210
+ typedef struct ddog_Option_U32 {
211
+ ddog_Option_U32_Tag tag;
349
212
  union {
350
213
  struct {
351
214
  uint32_t some;
352
215
  };
353
216
  };
354
- } ddog_prof_Option_U32;
355
-
356
- typedef struct ddog_prof_StackFrameNames {
357
- struct ddog_prof_Option_U32 colno;
358
- ddog_CharSlice filename;
359
- struct ddog_prof_Option_U32 lineno;
360
- ddog_CharSlice name;
361
- } ddog_prof_StackFrameNames;
362
-
363
- typedef struct ddog_prof_Slice_StackFrameNames {
364
- /**
365
- * Must be non-null and suitably aligned for the underlying type.
366
- */
367
- const struct ddog_prof_StackFrameNames *ptr;
368
- /**
369
- * The number of elements (not bytes) that `.ptr` points to. Must be less
370
- * than or equal to [isize::MAX].
371
- */
372
- uintptr_t len;
373
- } ddog_prof_Slice_StackFrameNames;
374
-
375
- typedef struct ddog_prof_StackFrame {
376
- uintptr_t ip;
377
- uintptr_t module_base_address;
378
- struct ddog_prof_Slice_StackFrameNames names;
379
- uintptr_t sp;
380
- uintptr_t symbol_address;
381
- } ddog_prof_StackFrame;
382
-
383
- typedef struct ddog_prof_Slice_StackFrame {
384
- /**
385
- * Must be non-null and suitably aligned for the underlying type.
386
- */
387
- const struct ddog_prof_StackFrame *ptr;
388
- /**
389
- * The number of elements (not bytes) that `.ptr` points to. Must be less
390
- * than or equal to [isize::MAX].
391
- */
392
- uintptr_t len;
393
- } ddog_prof_Slice_StackFrame;
217
+ } ddog_Option_U32;
394
218
 
395
219
  /**
396
220
  * A wrapper for returning owned strings from FFI
397
221
  */
398
- typedef struct ddog_prof_StringWrapper {
222
+ typedef struct ddog_StringWrapper {
399
223
  /**
400
224
  * This is a String stuffed into the vec.
401
225
  */
402
226
  struct ddog_Vec_U8 message;
403
- } ddog_prof_StringWrapper;
227
+ } ddog_StringWrapper;
404
228
 
405
229
  /**
406
- * Returned by [ddog_prof_Profile_new].
230
+ * Holds the raw parts of a Rust Vec; it should only be created from Rust,
231
+ * never from C.
407
232
  */
408
- typedef enum ddog_prof_StringWrapperResult_Tag {
409
- DDOG_PROF_STRING_WRAPPER_RESULT_OK,
410
- DDOG_PROF_STRING_WRAPPER_RESULT_ERR,
411
- } ddog_prof_StringWrapperResult_Tag;
233
+ typedef struct ddog_Vec_Tag {
234
+ const struct ddog_Tag *ptr;
235
+ uintptr_t len;
236
+ uintptr_t capacity;
237
+ } ddog_Vec_Tag;
412
238
 
413
- typedef struct ddog_prof_StringWrapperResult {
414
- ddog_prof_StringWrapperResult_Tag 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;
243
+
244
+ typedef struct ddog_Vec_Tag_PushResult {
245
+ ddog_Vec_Tag_PushResult_Tag tag;
415
246
  union {
416
- struct {
417
- struct ddog_prof_StringWrapper ok;
418
- };
419
247
  struct {
420
248
  struct ddog_Error err;
421
249
  };
422
250
  };
423
- } ddog_prof_StringWrapperResult;
251
+ } ddog_Vec_Tag_PushResult;
252
+
253
+ typedef struct ddog_Vec_Tag_ParseResult {
254
+ struct ddog_Vec_Tag tags;
255
+ struct ddog_Error *error_message;
256
+ } ddog_Vec_Tag_ParseResult;
257
+
258
+ typedef struct ddog_CancellationToken ddog_CancellationToken;
259
+
260
+ typedef struct ddog_prof_Exporter ddog_prof_Exporter;
261
+
262
+ typedef struct ddog_prof_ProfiledEndpointsStats ddog_prof_ProfiledEndpointsStats;
263
+
264
+ typedef struct ddog_prof_Exporter_Request ddog_prof_Exporter_Request;
424
265
 
425
266
  typedef struct ddog_Slice_U8 {
426
267
  /**
@@ -456,6 +297,30 @@ typedef struct ddog_prof_Exporter_Slice_File {
456
297
  uintptr_t len;
457
298
  } ddog_prof_Exporter_Slice_File;
458
299
 
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;
305
+
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;
310
+
311
+ typedef struct ddog_prof_Endpoint {
312
+ ddog_prof_Endpoint_Tag tag;
313
+ union {
314
+ struct {
315
+ ddog_CharSlice agent;
316
+ };
317
+ ddog_prof_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
318
+ struct {
319
+ ddog_CharSlice file;
320
+ };
321
+ };
322
+ } ddog_prof_Endpoint;
323
+
459
324
  typedef enum ddog_prof_Exporter_NewResult_Tag {
460
325
  DDOG_PROF_EXPORTER_NEW_RESULT_OK,
461
326
  DDOG_PROF_EXPORTER_NEW_RESULT_ERR,
@@ -473,6 +338,22 @@ typedef struct ddog_prof_Exporter_NewResult {
473
338
  };
474
339
  } ddog_prof_Exporter_NewResult;
475
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
+
476
357
  typedef enum ddog_prof_Exporter_Request_BuildResult_Tag {
477
358
  DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_OK,
478
359
  DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_ERR,
@@ -858,6 +739,272 @@ typedef struct ddog_ContextKey {
858
739
  enum ddog_MetricType _1;
859
740
  } ddog_ContextKey;
860
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
+
861
1008
  #ifdef __cplusplus
862
1009
  extern "C" {
863
1010
  #endif // __cplusplus
@@ -878,8 +1025,80 @@ ddog_CharSlice ddog_Error_message(const struct ddog_Error *error);
878
1025
 
879
1026
  void ddog_MaybeError_drop(ddog_MaybeError);
880
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
+
881
1098
  DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_url(ddog_CharSlice url);
882
1099
 
1100
+ DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_filename(ddog_CharSlice filename);
1101
+
883
1102
  DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_api_key(ddog_CharSlice api_key);
884
1103
 
885
1104
  DDOG_CHECK_RETURN
@@ -887,8 +1106,14 @@ struct ddog_Error *ddog_endpoint_from_api_key_and_site(ddog_CharSlice api_key,
887
1106
  ddog_CharSlice site,
888
1107
  struct ddog_Endpoint **endpoint);
889
1108
 
1109
+ void ddog_endpoint_set_timeout(struct ddog_Endpoint *endpoint, uint64_t millis);
1110
+
890
1111
  void ddog_endpoint_drop(struct ddog_Endpoint*);
891
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
+
892
1117
  /**
893
1118
  * # Safety
894
1119
  * Only pass null or a valid reference to a `ddog_StringWrapper`.