libdatadog 19.1.0.1.0-x86_64-linux → 22.0.0.1.0-x86_64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/vendor/{libdatadog-19.1.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-22.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu}/LICENSE-3rdparty.yml +11709 -16104
  4. data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
  5. data/vendor/{libdatadog-19.1.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-22.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu}/include/datadog/common.h +587 -525
  6. data/vendor/{libdatadog-19.1.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-22.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu}/include/datadog/crashtracker.h +0 -34
  7. data/vendor/{libdatadog-19.1.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-22.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu}/include/datadog/data-pipeline.h +9 -11
  8. data/vendor/libdatadog-22.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/ddsketch.h +89 -0
  9. data/vendor/libdatadog-22.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/library-config.h +113 -0
  10. data/vendor/{libdatadog-19.1.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-22.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu}/include/datadog/profiling.h +2 -1
  11. data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  12. data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  13. data/vendor/{libdatadog-19.1.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-22.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/LICENSE-3rdparty.yml +11709 -16104
  14. data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  15. data/vendor/{libdatadog-19.1.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-22.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/common.h +587 -525
  16. data/vendor/{libdatadog-19.1.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-22.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/crashtracker.h +0 -34
  17. data/vendor/{libdatadog-19.1.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-22.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/data-pipeline.h +9 -11
  18. data/vendor/libdatadog-22.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/ddsketch.h +89 -0
  19. data/vendor/libdatadog-22.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/library-config.h +113 -0
  20. data/vendor/{libdatadog-19.1.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-22.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/profiling.h +2 -1
  21. data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  22. data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  23. metadata +31 -29
  24. data/vendor/libdatadog-19.1.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/library-config.h +0 -73
  25. data/vendor/libdatadog-19.1.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/library-config.h +0 -73
  26. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE +0 -0
  27. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/NOTICE +0 -0
  28. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/blazesym.h +0 -0
  29. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/log.h +0 -0
  30. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/telemetry.h +0 -0
  31. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE +0 -0
  32. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/NOTICE +0 -0
  33. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/blazesym.h +0 -0
  34. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/log.h +0 -0
  35. /data/vendor/{libdatadog-19.1.0 → libdatadog-22.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/telemetry.h +0 -0
@@ -792,9 +792,9 @@ typedef struct ddog_prof_FunctionId_Result {
792
792
  * A value of 0 means "no string" or "empty string" (they are synonymous).
793
793
  */
794
794
  typedef struct OpaqueStringId {
795
- uint32_t _0;
795
+ uint32_t offset;
796
796
  } OpaqueStringId;
797
- #define OpaqueStringId_ZERO (OpaqueStringId){ ._0 = 0 }
797
+ #define OpaqueStringId_ZERO (OpaqueStringId){ }
798
798
 
799
799
  typedef struct OpaqueStringId OpaqueStringId;
800
800
 
@@ -1224,695 +1224,757 @@ typedef struct ddog_ContextKey {
1224
1224
  enum ddog_MetricType _1;
1225
1225
  } ddog_ContextKey;
1226
1226
 
1227
- typedef enum ddog_crasht_BuildIdType {
1228
- DDOG_CRASHT_BUILD_ID_TYPE_GNU,
1229
- DDOG_CRASHT_BUILD_ID_TYPE_GO,
1230
- DDOG_CRASHT_BUILD_ID_TYPE_PDB,
1231
- DDOG_CRASHT_BUILD_ID_TYPE_SHA1,
1232
- } ddog_crasht_BuildIdType;
1233
-
1234
- typedef enum ddog_crasht_DemangleOptions {
1235
- DDOG_CRASHT_DEMANGLE_OPTIONS_COMPLETE,
1236
- DDOG_CRASHT_DEMANGLE_OPTIONS_NAME_ONLY,
1237
- } ddog_crasht_DemangleOptions;
1238
-
1239
- typedef enum ddog_crasht_ErrorKind {
1240
- DDOG_CRASHT_ERROR_KIND_PANIC,
1241
- DDOG_CRASHT_ERROR_KIND_UNHANDLED_EXCEPTION,
1242
- DDOG_CRASHT_ERROR_KIND_UNIX_SIGNAL,
1243
- } ddog_crasht_ErrorKind;
1244
-
1245
- typedef enum ddog_crasht_FileType {
1246
- DDOG_CRASHT_FILE_TYPE_APK,
1247
- DDOG_CRASHT_FILE_TYPE_ELF,
1248
- DDOG_CRASHT_FILE_TYPE_PE,
1249
- } ddog_crasht_FileType;
1227
+ /**
1228
+ * Represent error codes that `Error` struct can hold
1229
+ */
1230
+ typedef enum ddog_TraceExporterErrorCode {
1231
+ DDOG_TRACE_EXPORTER_ERROR_CODE_ADDRESS_IN_USE,
1232
+ DDOG_TRACE_EXPORTER_ERROR_CODE_CONNECTION_ABORTED,
1233
+ DDOG_TRACE_EXPORTER_ERROR_CODE_CONNECTION_REFUSED,
1234
+ DDOG_TRACE_EXPORTER_ERROR_CODE_CONNECTION_RESET,
1235
+ DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_BODY_FORMAT,
1236
+ DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_BODY_TOO_LONG,
1237
+ DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_CLIENT,
1238
+ DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_EMPTY_BODY,
1239
+ DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_PARSE,
1240
+ DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_SERVER,
1241
+ DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_UNKNOWN,
1242
+ DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_WRONG_STATUS,
1243
+ DDOG_TRACE_EXPORTER_ERROR_CODE_INVALID_ARGUMENT,
1244
+ DDOG_TRACE_EXPORTER_ERROR_CODE_INVALID_DATA,
1245
+ DDOG_TRACE_EXPORTER_ERROR_CODE_INVALID_INPUT,
1246
+ DDOG_TRACE_EXPORTER_ERROR_CODE_INVALID_URL,
1247
+ DDOG_TRACE_EXPORTER_ERROR_CODE_IO_ERROR,
1248
+ DDOG_TRACE_EXPORTER_ERROR_CODE_NETWORK_UNKNOWN,
1249
+ DDOG_TRACE_EXPORTER_ERROR_CODE_SERDE,
1250
+ DDOG_TRACE_EXPORTER_ERROR_CODE_SHUTDOWN,
1251
+ DDOG_TRACE_EXPORTER_ERROR_CODE_TIMED_OUT,
1252
+ DDOG_TRACE_EXPORTER_ERROR_CODE_TELEMETRY,
1253
+ DDOG_TRACE_EXPORTER_ERROR_CODE_INTERNAL,
1254
+ DDOG_TRACE_EXPORTER_ERROR_CODE_PANIC,
1255
+ } ddog_TraceExporterErrorCode;
1250
1256
 
1251
1257
  /**
1252
- * This enum represents operations a the tracked library might be engaged in.
1253
- * Currently only implemented for profiling.
1254
- * The idea is that if a crash consistently occurs while a particular operation
1255
- * is ongoing, its likely related.
1256
- *
1257
- * In the future, we might also track wall-clock time of operations
1258
- * (or some statistical sampling thereof) using the same enum.
1258
+ * Structure containing the agent response to a trace payload
1259
+ * MUST be freed with `ddog_trace_exporter_response_free`
1259
1260
  *
1260
- * NOTE: This enum is known to be non-exhaustive. Feel free to add new types
1261
- * as needed.
1261
+ * If the agent payload version is enabled on the trace exporter, and
1262
+ * the agent response indicates that the payload version hasn't changed,
1263
+ * the body will be empty.
1262
1264
  */
1263
- typedef enum ddog_crasht_OpTypes {
1264
- DDOG_CRASHT_OP_TYPES_PROFILER_INACTIVE = 0,
1265
- DDOG_CRASHT_OP_TYPES_PROFILER_COLLECTING_SAMPLE,
1266
- DDOG_CRASHT_OP_TYPES_PROFILER_UNWINDING,
1267
- DDOG_CRASHT_OP_TYPES_PROFILER_SERIALIZING,
1268
- /**
1269
- * Dummy value to allow easier iteration
1270
- */
1271
- DDOG_CRASHT_OP_TYPES_SIZE,
1272
- } ddog_crasht_OpTypes;
1265
+ typedef struct ddog_TraceExporterResponse ddog_TraceExporterResponse;
1266
+
1267
+ typedef struct ddog_TraceExporter ddog_TraceExporter;
1273
1268
 
1274
1269
  /**
1275
- * See https://man7.org/linux/man-pages/man2/sigaction.2.html
1276
- * MUST REMAIN IN SYNC WITH THE ENUM IN emit_sigcodes.c
1270
+ * The TraceExporterConfig object will hold the configuration properties for the TraceExporter.
1271
+ * Once the configuration is passed to the TraceExporter constructor the config is no longer
1272
+ * needed by the handle and it can be freed.
1277
1273
  */
1278
- typedef enum ddog_crasht_SiCodes {
1279
- DDOG_CRASHT_SI_CODES_BUS_ADRALN,
1280
- DDOG_CRASHT_SI_CODES_BUS_ADRERR,
1281
- DDOG_CRASHT_SI_CODES_BUS_MCEERR_AO,
1282
- DDOG_CRASHT_SI_CODES_BUS_MCEERR_AR,
1283
- DDOG_CRASHT_SI_CODES_BUS_OBJERR,
1284
- DDOG_CRASHT_SI_CODES_ILL_BADSTK,
1285
- DDOG_CRASHT_SI_CODES_ILL_COPROC,
1286
- DDOG_CRASHT_SI_CODES_ILL_ILLADR,
1287
- DDOG_CRASHT_SI_CODES_ILL_ILLOPC,
1288
- DDOG_CRASHT_SI_CODES_ILL_ILLOPN,
1289
- DDOG_CRASHT_SI_CODES_ILL_ILLTRP,
1290
- DDOG_CRASHT_SI_CODES_ILL_PRVOPC,
1291
- DDOG_CRASHT_SI_CODES_ILL_PRVREG,
1292
- DDOG_CRASHT_SI_CODES_SEGV_ACCERR,
1293
- DDOG_CRASHT_SI_CODES_SEGV_BNDERR,
1294
- DDOG_CRASHT_SI_CODES_SEGV_MAPERR,
1295
- DDOG_CRASHT_SI_CODES_SEGV_PKUERR,
1296
- DDOG_CRASHT_SI_CODES_SI_ASYNCIO,
1297
- DDOG_CRASHT_SI_CODES_SI_KERNEL,
1298
- DDOG_CRASHT_SI_CODES_SI_MESGQ,
1299
- DDOG_CRASHT_SI_CODES_SI_QUEUE,
1300
- DDOG_CRASHT_SI_CODES_SI_SIGIO,
1301
- DDOG_CRASHT_SI_CODES_SI_TIMER,
1302
- DDOG_CRASHT_SI_CODES_SI_TKILL,
1303
- DDOG_CRASHT_SI_CODES_SI_USER,
1304
- DDOG_CRASHT_SI_CODES_SYS_SECCOMP,
1305
- DDOG_CRASHT_SI_CODES_UNKNOWN,
1306
- } ddog_crasht_SiCodes;
1274
+ typedef struct ddog_TraceExporterConfig ddog_TraceExporterConfig;
1307
1275
 
1308
1276
  /**
1309
- * See https://man7.org/linux/man-pages/man7/signal.7.html
1277
+ * Structure that contains error information that `TraceExporter` API can return.
1310
1278
  */
1311
- typedef enum ddog_crasht_SignalNames {
1312
- DDOG_CRASHT_SIGNAL_NAMES_SIGHUP,
1313
- DDOG_CRASHT_SIGNAL_NAMES_SIGINT,
1314
- DDOG_CRASHT_SIGNAL_NAMES_SIGQUIT,
1315
- DDOG_CRASHT_SIGNAL_NAMES_SIGILL,
1316
- DDOG_CRASHT_SIGNAL_NAMES_SIGTRAP,
1317
- DDOG_CRASHT_SIGNAL_NAMES_SIGABRT,
1318
- DDOG_CRASHT_SIGNAL_NAMES_SIGBUS,
1319
- DDOG_CRASHT_SIGNAL_NAMES_SIGFPE,
1320
- DDOG_CRASHT_SIGNAL_NAMES_SIGKILL,
1321
- DDOG_CRASHT_SIGNAL_NAMES_SIGUSR1,
1322
- DDOG_CRASHT_SIGNAL_NAMES_SIGSEGV,
1323
- DDOG_CRASHT_SIGNAL_NAMES_SIGUSR2,
1324
- DDOG_CRASHT_SIGNAL_NAMES_SIGPIPE,
1325
- DDOG_CRASHT_SIGNAL_NAMES_SIGALRM,
1326
- DDOG_CRASHT_SIGNAL_NAMES_SIGTERM,
1327
- DDOG_CRASHT_SIGNAL_NAMES_SIGCHLD,
1328
- DDOG_CRASHT_SIGNAL_NAMES_SIGCONT,
1329
- DDOG_CRASHT_SIGNAL_NAMES_SIGSTOP,
1330
- DDOG_CRASHT_SIGNAL_NAMES_SIGTSTP,
1331
- DDOG_CRASHT_SIGNAL_NAMES_SIGTTIN,
1332
- DDOG_CRASHT_SIGNAL_NAMES_SIGTTOU,
1333
- DDOG_CRASHT_SIGNAL_NAMES_SIGURG,
1334
- DDOG_CRASHT_SIGNAL_NAMES_SIGXCPU,
1335
- DDOG_CRASHT_SIGNAL_NAMES_SIGXFSZ,
1336
- DDOG_CRASHT_SIGNAL_NAMES_SIGVTALRM,
1337
- DDOG_CRASHT_SIGNAL_NAMES_SIGPROF,
1338
- DDOG_CRASHT_SIGNAL_NAMES_SIGWINCH,
1339
- DDOG_CRASHT_SIGNAL_NAMES_SIGIO,
1340
- DDOG_CRASHT_SIGNAL_NAMES_SIGSYS,
1341
- DDOG_CRASHT_SIGNAL_NAMES_SIGEMT,
1342
- DDOG_CRASHT_SIGNAL_NAMES_SIGINFO,
1343
- DDOG_CRASHT_SIGNAL_NAMES_UNKNOWN,
1344
- } ddog_crasht_SignalNames;
1279
+ typedef struct ddog_TraceExporterError {
1280
+ enum ddog_TraceExporterErrorCode code;
1281
+ char *msg;
1282
+ } ddog_TraceExporterError;
1345
1283
 
1346
1284
  /**
1347
- * Stacktrace collection occurs in the context of a crashing process.
1348
- * If the stack is sufficiently corruputed, it is possible (but unlikely),
1349
- * for stack trace collection itself to crash.
1350
- * We recommend fully enabling stacktrace collection, but having an environment
1351
- * variable to allow downgrading the collector.
1285
+ * FFI compatible configuration for the TelemetryClient.
1352
1286
  */
1353
- typedef enum ddog_crasht_StacktraceCollection {
1287
+ typedef struct ddog_TelemetryClientConfig {
1354
1288
  /**
1355
- * Stacktrace collection occurs in the
1289
+ * How often telemetry should be sent, in milliseconds.
1356
1290
  */
1357
- DDOG_CRASHT_STACKTRACE_COLLECTION_DISABLED,
1358
- DDOG_CRASHT_STACKTRACE_COLLECTION_WITHOUT_SYMBOLS,
1291
+ uint64_t interval;
1359
1292
  /**
1360
- * This option uses `backtrace::resolve_frame_unsynchronized()` to gather symbol information
1361
- * and also unwind inlined functions. Enabling this feature will not only provide symbolic
1362
- * details, but may also yield additional or less stack frames compared to other
1363
- * configurations.
1293
+ * A V4 UUID that represents a tracer session. This ID should:
1294
+ * - Be generated when the tracer starts
1295
+ * - Be identical within the context of a host (i.e. multiple threads/processes that belong to
1296
+ * a single instrumented app should share the same runtime_id)
1297
+ * - Be associated with traces to allow correlation between traces and telemetry data
1364
1298
  */
1365
- DDOG_CRASHT_STACKTRACE_COLLECTION_ENABLED_WITH_INPROCESS_SYMBOLS,
1366
- DDOG_CRASHT_STACKTRACE_COLLECTION_ENABLED_WITH_SYMBOLS_IN_RECEIVER,
1367
- } ddog_crasht_StacktraceCollection;
1299
+ ddog_CharSlice runtime_id;
1300
+ /**
1301
+ * Whether to enable debug mode for telemetry.
1302
+ * When enabled, sets the DD-Telemetry-Debug-Enabled header to true.
1303
+ * Defaults to false.
1304
+ */
1305
+ bool debug_enabled;
1306
+ } ddog_TelemetryClientConfig;
1368
1307
 
1369
- typedef struct ddog_crasht_CrashInfo ddog_crasht_CrashInfo;
1308
+ typedef enum ddog_LibraryConfigSource {
1309
+ DDOG_LIBRARY_CONFIG_SOURCE_LOCAL_STABLE_CONFIG = 0,
1310
+ DDOG_LIBRARY_CONFIG_SOURCE_FLEET_STABLE_CONFIG = 1,
1311
+ } ddog_LibraryConfigSource;
1370
1312
 
1371
- typedef struct ddog_crasht_CrashInfoBuilder ddog_crasht_CrashInfoBuilder;
1313
+ /**
1314
+ * Represents the types of metadata that can be set on a `TracerMetadata` object.
1315
+ */
1316
+ typedef enum ddog_MetadataKind {
1317
+ DDOG_METADATA_KIND_RUNTIME_ID = 0,
1318
+ DDOG_METADATA_KIND_TRACER_LANGUAGE = 1,
1319
+ DDOG_METADATA_KIND_TRACER_VERSION = 2,
1320
+ DDOG_METADATA_KIND_HOSTNAME = 3,
1321
+ DDOG_METADATA_KIND_SERVICE_NAME = 4,
1322
+ DDOG_METADATA_KIND_SERVICE_ENV = 5,
1323
+ DDOG_METADATA_KIND_SERVICE_VERSION = 6,
1324
+ DDOG_METADATA_KIND_PROCESS_TAGS = 7,
1325
+ DDOG_METADATA_KIND_CONTAINER_ID = 8,
1326
+ } ddog_MetadataKind;
1372
1327
 
1373
- typedef struct ddog_crasht_StackFrame ddog_crasht_StackFrame;
1328
+ typedef struct ddog_Configurator ddog_Configurator;
1374
1329
 
1375
- typedef struct ddog_crasht_StackTrace ddog_crasht_StackTrace;
1330
+ /**
1331
+ * This struct MUST be backward compatible.
1332
+ */
1333
+ typedef struct ddog_TracerMetadata ddog_TracerMetadata;
1376
1334
 
1377
- typedef struct ddog_crasht_Slice_CharSlice {
1335
+ /**
1336
+ * Ffi safe type representing a borrowed null-terminated C array
1337
+ * Equivalent to a std::ffi::CStr
1338
+ */
1339
+ typedef struct ddog_CStr {
1378
1340
  /**
1379
- * Should be non-null and suitably aligned for the underlying type. It is
1380
- * allowed but not recommended for the pointer to be null when the len is
1381
- * zero.
1341
+ * Null terminated char array
1382
1342
  */
1383
- const ddog_CharSlice *ptr;
1343
+ char *ptr;
1384
1344
  /**
1385
- * The number of elements (not bytes) that `.ptr` points to. Must be less
1386
- * than or equal to [isize::MAX].
1345
+ * Length of the array, not counting the null-terminator
1387
1346
  */
1388
- uintptr_t len;
1389
- } ddog_crasht_Slice_CharSlice;
1347
+ uintptr_t length;
1348
+ } ddog_CStr;
1390
1349
 
1391
- typedef struct ddog_crasht_Slice_I32 {
1350
+ typedef struct ddog_Slice_CharSlice {
1392
1351
  /**
1393
1352
  * Should be non-null and suitably aligned for the underlying type. It is
1394
1353
  * allowed but not recommended for the pointer to be null when the len is
1395
1354
  * zero.
1396
1355
  */
1397
- const int32_t *ptr;
1356
+ const ddog_CharSlice *ptr;
1398
1357
  /**
1399
1358
  * The number of elements (not bytes) that `.ptr` points to. Must be less
1400
1359
  * than or equal to [isize::MAX].
1401
1360
  */
1402
1361
  uintptr_t len;
1403
- } ddog_crasht_Slice_I32;
1362
+ } ddog_Slice_CharSlice;
1404
1363
 
1405
- typedef struct ddog_crasht_Config {
1406
- struct ddog_crasht_Slice_CharSlice additional_files;
1407
- bool create_alt_stack;
1408
- bool demangle_names;
1409
- /**
1410
- * The endpoint to send the crash report to (can be a file://).
1411
- * If None, the crashtracker will infer the agent host from env variables.
1412
- */
1413
- const struct ddog_Endpoint *endpoint;
1364
+ typedef struct ddog_ProcessInfo {
1365
+ struct ddog_Slice_CharSlice args;
1366
+ struct ddog_Slice_CharSlice envp;
1367
+ ddog_CharSlice language;
1368
+ } ddog_ProcessInfo;
1369
+
1370
+ /**
1371
+ * Ffi safe type representing an owned null-terminated C array
1372
+ * Equivalent to a std::ffi::CString
1373
+ */
1374
+ typedef struct ddog_CString {
1414
1375
  /**
1415
- * Optional filename for a unix domain socket if the receiver is used asynchonously
1376
+ * Null terminated char array
1416
1377
  */
1417
- ddog_CharSlice optional_unix_socket_filename;
1418
- enum ddog_crasht_StacktraceCollection resolve_frames;
1378
+ char *ptr;
1419
1379
  /**
1420
- * The set of signals we should be registered for.
1421
- * If empty, use the default set.
1380
+ * Length of the array, not counting the null-terminator
1422
1381
  */
1423
- struct ddog_crasht_Slice_I32 signals;
1424
- /**
1425
- * Timeout in milliseconds before the signal handler starts tearing things down to return.
1426
- * If 0, uses the default timeout as specified in
1427
- * `datadog_crashtracker::shared::constants::DD_CRASHTRACK_DEFAULT_TIMEOUT`. Otherwise, uses
1428
- * the specified timeout value.
1429
- * This is given as a uint32_t, but the actual timeout needs to fit inside of an i32 (max
1430
- * 2^31-1). This is a limitation of the various interfaces used to guarantee the timeout.
1431
- */
1432
- uint32_t timeout_ms;
1433
- bool use_alt_stack;
1434
- } ddog_crasht_Config;
1435
-
1436
- typedef struct ddog_crasht_EnvVar {
1437
- ddog_CharSlice key;
1438
- ddog_CharSlice val;
1439
- } ddog_crasht_EnvVar;
1440
-
1441
- typedef struct ddog_crasht_Slice_EnvVar {
1442
- /**
1443
- * Should be non-null and suitably aligned for the underlying type. It is
1444
- * allowed but not recommended for the pointer to be null when the len is
1445
- * zero.
1446
- */
1447
- const struct ddog_crasht_EnvVar *ptr;
1448
- /**
1449
- * The number of elements (not bytes) that `.ptr` points to. Must be less
1450
- * than or equal to [isize::MAX].
1451
- */
1452
- uintptr_t len;
1453
- } ddog_crasht_Slice_EnvVar;
1454
-
1455
- typedef struct ddog_crasht_ReceiverConfig {
1456
- struct ddog_crasht_Slice_CharSlice args;
1457
- struct ddog_crasht_Slice_EnvVar env;
1458
- ddog_CharSlice path_to_receiver_binary;
1459
- /**
1460
- * Optional filename to forward stderr to (useful for logging/debugging)
1461
- */
1462
- ddog_CharSlice optional_stderr_filename;
1463
- /**
1464
- * Optional filename to forward stdout to (useful for logging/debugging)
1465
- */
1466
- ddog_CharSlice optional_stdout_filename;
1467
- } ddog_crasht_ReceiverConfig;
1382
+ uintptr_t length;
1383
+ } ddog_CString;
1468
1384
 
1469
- typedef struct ddog_crasht_Metadata {
1470
- ddog_CharSlice library_name;
1471
- ddog_CharSlice library_version;
1472
- ddog_CharSlice family;
1473
- /**
1474
- * Should include "service", "environment", etc
1475
- */
1476
- const struct ddog_Vec_Tag *tags;
1477
- } ddog_crasht_Metadata;
1385
+ typedef struct ddog_LibraryConfig {
1386
+ struct ddog_CString name;
1387
+ struct ddog_CString value;
1388
+ enum ddog_LibraryConfigSource source;
1389
+ struct ddog_CString config_id;
1390
+ } ddog_LibraryConfig;
1478
1391
 
1479
- typedef struct ddog_crasht_Slice_CInt {
1480
- /**
1481
- * Should be non-null and suitably aligned for the underlying type. It is
1482
- * allowed but not recommended for the pointer to be null when the len is
1483
- * zero.
1484
- */
1485
- const int *ptr;
1486
- /**
1487
- * The number of elements (not bytes) that `.ptr` points to. Must be less
1488
- * than or equal to [isize::MAX].
1489
- */
1392
+ /**
1393
+ * Holds the raw parts of a Rust Vec; it should only be created from Rust,
1394
+ * never from C.
1395
+ */
1396
+ typedef struct ddog_Vec_LibraryConfig {
1397
+ const struct ddog_LibraryConfig *ptr;
1490
1398
  uintptr_t len;
1491
- } ddog_crasht_Slice_CInt;
1399
+ uintptr_t capacity;
1400
+ } ddog_Vec_LibraryConfig;
1492
1401
 
1493
1402
  /**
1494
- * A generic result type for when an operation may fail,
1495
- * or may return <T> in case of success.
1403
+ * A result type that includes debug/log messages along with the data
1496
1404
  */
1497
- typedef enum ddog_crasht_Result_Usize_Tag {
1498
- DDOG_CRASHT_RESULT_USIZE_OK_USIZE,
1499
- DDOG_CRASHT_RESULT_USIZE_ERR_USIZE,
1500
- } ddog_crasht_Result_Usize_Tag;
1405
+ typedef struct ddog_OkResult {
1406
+ struct ddog_Vec_LibraryConfig value;
1407
+ struct ddog_CString logs;
1408
+ } ddog_OkResult;
1501
1409
 
1502
- typedef struct ddog_crasht_Result_Usize {
1503
- ddog_crasht_Result_Usize_Tag tag;
1410
+ typedef enum ddog_LibraryConfigLoggedResult_Tag {
1411
+ DDOG_LIBRARY_CONFIG_LOGGED_RESULT_OK,
1412
+ DDOG_LIBRARY_CONFIG_LOGGED_RESULT_ERR,
1413
+ } ddog_LibraryConfigLoggedResult_Tag;
1414
+
1415
+ typedef struct ddog_LibraryConfigLoggedResult {
1416
+ ddog_LibraryConfigLoggedResult_Tag tag;
1504
1417
  union {
1505
1418
  struct {
1506
- uintptr_t ok;
1419
+ struct ddog_OkResult ok;
1507
1420
  };
1508
1421
  struct {
1509
1422
  struct ddog_Error err;
1510
1423
  };
1511
1424
  };
1512
- } ddog_crasht_Result_Usize;
1425
+ } ddog_LibraryConfigLoggedResult;
1513
1426
 
1514
1427
  /**
1515
- * Represents an object that should only be referred to by its handle.
1516
- * Do not access its member for any reason, only use the C API functions on this struct.
1428
+ * C-compatible representation of an anonymous file handle
1517
1429
  */
1518
- typedef struct ddog_crasht_Handle_CrashInfo {
1519
- struct ddog_crasht_CrashInfo *inner;
1520
- } ddog_crasht_Handle_CrashInfo;
1430
+ typedef struct ddog_TracerMemfdHandle {
1431
+ /**
1432
+ * File descriptor (relevant only on Linux)
1433
+ */
1434
+ int fd;
1435
+ } ddog_TracerMemfdHandle;
1521
1436
 
1522
1437
  /**
1523
- * Represents an object that should only be referred to by its handle.
1524
- * Do not access its member for any reason, only use the C API functions on this struct.
1438
+ * A generic result type for when an operation may fail,
1439
+ * or may return <T> in case of success.
1525
1440
  */
1526
- typedef struct ddog_crasht_Handle_CrashInfoBuilder {
1527
- struct ddog_crasht_CrashInfoBuilder *inner;
1528
- } ddog_crasht_Handle_CrashInfoBuilder;
1529
-
1530
- typedef enum ddog_crasht_CrashInfo_NewResult_Tag {
1531
- DDOG_CRASHT_CRASH_INFO_NEW_RESULT_OK,
1532
- DDOG_CRASHT_CRASH_INFO_NEW_RESULT_ERR,
1533
- } ddog_crasht_CrashInfo_NewResult_Tag;
1441
+ typedef enum ddog_Result_TracerMemfdHandle_Tag {
1442
+ DDOG_RESULT_TRACER_MEMFD_HANDLE_OK_TRACER_MEMFD_HANDLE,
1443
+ DDOG_RESULT_TRACER_MEMFD_HANDLE_ERR_TRACER_MEMFD_HANDLE,
1444
+ } ddog_Result_TracerMemfdHandle_Tag;
1534
1445
 
1535
- typedef struct ddog_crasht_CrashInfo_NewResult {
1536
- ddog_crasht_CrashInfo_NewResult_Tag tag;
1446
+ typedef struct ddog_Result_TracerMemfdHandle {
1447
+ ddog_Result_TracerMemfdHandle_Tag tag;
1537
1448
  union {
1538
1449
  struct {
1539
- struct ddog_crasht_Handle_CrashInfo ok;
1450
+ struct ddog_TracerMemfdHandle ok;
1540
1451
  };
1541
1452
  struct {
1542
1453
  struct ddog_Error err;
1543
1454
  };
1544
1455
  };
1545
- } ddog_crasht_CrashInfo_NewResult;
1546
-
1547
- typedef struct ddog_crasht_OsInfo {
1548
- ddog_CharSlice architecture;
1549
- ddog_CharSlice bitness;
1550
- ddog_CharSlice os_type;
1551
- ddog_CharSlice version;
1552
- } ddog_crasht_OsInfo;
1456
+ } ddog_Result_TracerMemfdHandle;
1553
1457
 
1554
- typedef struct ddog_crasht_ProcInfo {
1555
- uint32_t pid;
1556
- } ddog_crasht_ProcInfo;
1458
+ /**
1459
+ * Log level for filtering log events.
1460
+ */
1461
+ typedef enum ddog_LogEventLevel {
1462
+ /**
1463
+ * The "trace" level.
1464
+ *
1465
+ * Designates very low priority, often extremely verbose, information.
1466
+ */
1467
+ DDOG_LOG_EVENT_LEVEL_TRACE = 0,
1468
+ /**
1469
+ * The "debug" level.
1470
+ *
1471
+ * Designates lower priority information.
1472
+ */
1473
+ DDOG_LOG_EVENT_LEVEL_DEBUG = 1,
1474
+ /**
1475
+ * The "info" level.
1476
+ *
1477
+ * Designates useful information.
1478
+ */
1479
+ DDOG_LOG_EVENT_LEVEL_INFO = 2,
1480
+ /**
1481
+ * The "warn" level.
1482
+ *
1483
+ * Designates hazardous situations.
1484
+ */
1485
+ DDOG_LOG_EVENT_LEVEL_WARN = 3,
1486
+ /**
1487
+ * The "error" level.
1488
+ *
1489
+ * Designates very serious errors.
1490
+ */
1491
+ DDOG_LOG_EVENT_LEVEL_ERROR = 4,
1492
+ } ddog_LogEventLevel;
1557
1493
 
1558
- typedef struct ddog_crasht_SigInfo {
1559
- ddog_CharSlice addr;
1560
- int code;
1561
- enum ddog_crasht_SiCodes code_human_readable;
1562
- int signo;
1563
- enum ddog_crasht_SignalNames signo_human_readable;
1564
- } ddog_crasht_SigInfo;
1494
+ /**
1495
+ * Target for standard stream output.
1496
+ */
1497
+ typedef enum ddog_StdTarget {
1498
+ /**
1499
+ * Write to standard output (stdout).
1500
+ */
1501
+ DDOG_STD_TARGET_OUT,
1502
+ /**
1503
+ * Write to standard error (stderr).
1504
+ */
1505
+ DDOG_STD_TARGET_ERR,
1506
+ } ddog_StdTarget;
1565
1507
 
1566
- typedef struct ddog_crasht_Span {
1567
- ddog_CharSlice id;
1568
- ddog_CharSlice thread_name;
1569
- } ddog_crasht_Span;
1508
+ /**
1509
+ * Configuration for standard stream output.
1510
+ */
1511
+ typedef struct ddog_StdConfig {
1512
+ /**
1513
+ * Target stream (stdout or stderr)
1514
+ */
1515
+ enum ddog_StdTarget target;
1516
+ } ddog_StdConfig;
1570
1517
 
1571
1518
  /**
1572
- * Represents an object that should only be referred to by its handle.
1573
- * Do not access its member for any reason, only use the C API functions on this struct.
1519
+ * Configuration for file output.
1574
1520
  */
1575
- typedef struct ddog_crasht_Handle_StackTrace {
1576
- struct ddog_crasht_StackTrace *inner;
1577
- } ddog_crasht_Handle_StackTrace;
1521
+ typedef struct ddog_FileConfig {
1522
+ /**
1523
+ * Path to the log file
1524
+ */
1525
+ ddog_CharSlice path;
1526
+ /**
1527
+ * Maximum total number of files (current + rotated) to keep on disk.
1528
+ * When this limit is exceeded, the oldest rotated files are deleted.
1529
+ * Set to 0 to disable file cleanup.
1530
+ */
1531
+ uint64_t max_files;
1532
+ /**
1533
+ * Maximum size in bytes for each log file.
1534
+ * Set to 0 to disable size-based rotation.
1535
+ */
1536
+ uint64_t max_size_bytes;
1537
+ } ddog_FileConfig;
1578
1538
 
1579
- typedef struct ddog_crasht_ThreadData {
1580
- bool crashed;
1581
- ddog_CharSlice name;
1582
- struct ddog_crasht_Handle_StackTrace stack;
1583
- ddog_CharSlice state;
1584
- } ddog_crasht_ThreadData;
1539
+ /**
1540
+ * This is a minimal DDSketch implementation
1541
+ *
1542
+ * This implementation only supports a part of the standard (which is also only the parts dd
1543
+ * backend supports :shrug:)
1544
+ * - max length contiguous bin store, with lower bin collapse behavior.
1545
+ * - Positive or zero values
1546
+ *
1547
+ * The default sketch has a 1% relative accuracy, and only accepts positive points
1548
+ *
1549
+ * See <https://github.com/DataDog/sketches-go> for the reference implementation
1550
+ */
1551
+ typedef struct ddsketch_DDSketch ddsketch_DDSketch;
1585
1552
 
1586
1553
  /**
1587
1554
  * Represents an object that should only be referred to by its handle.
1588
1555
  * Do not access its member for any reason, only use the C API functions on this struct.
1589
1556
  */
1590
- typedef struct ddog_crasht_Handle_StackFrame {
1591
- struct ddog_crasht_StackFrame *inner;
1592
- } ddog_crasht_Handle_StackFrame;
1557
+ typedef struct ddsketch_Handle_DDSketch {
1558
+ struct ddsketch_DDSketch *inner;
1559
+ } ddsketch_Handle_DDSketch;
1593
1560
 
1594
- typedef enum ddog_crasht_StackFrame_NewResult_Tag {
1595
- DDOG_CRASHT_STACK_FRAME_NEW_RESULT_OK,
1596
- DDOG_CRASHT_STACK_FRAME_NEW_RESULT_ERR,
1597
- } ddog_crasht_StackFrame_NewResult_Tag;
1561
+ typedef enum ddog_crasht_BuildIdType {
1562
+ DDOG_CRASHT_BUILD_ID_TYPE_GNU,
1563
+ DDOG_CRASHT_BUILD_ID_TYPE_GO,
1564
+ DDOG_CRASHT_BUILD_ID_TYPE_PDB,
1565
+ DDOG_CRASHT_BUILD_ID_TYPE_SHA1,
1566
+ } ddog_crasht_BuildIdType;
1598
1567
 
1599
- typedef struct ddog_crasht_StackFrame_NewResult {
1600
- ddog_crasht_StackFrame_NewResult_Tag tag;
1601
- union {
1602
- struct {
1603
- struct ddog_crasht_Handle_StackFrame ok;
1604
- };
1605
- struct {
1606
- struct ddog_Error err;
1607
- };
1608
- };
1609
- } ddog_crasht_StackFrame_NewResult;
1568
+ typedef enum ddog_crasht_DemangleOptions {
1569
+ DDOG_CRASHT_DEMANGLE_OPTIONS_COMPLETE,
1570
+ DDOG_CRASHT_DEMANGLE_OPTIONS_NAME_ONLY,
1571
+ } ddog_crasht_DemangleOptions;
1610
1572
 
1611
- /**
1612
- * Represent error codes that `Error` struct can hold
1613
- */
1614
- typedef enum ddog_TraceExporterErrorCode {
1615
- DDOG_TRACE_EXPORTER_ERROR_CODE_ADDRESS_IN_USE,
1616
- DDOG_TRACE_EXPORTER_ERROR_CODE_CONNECTION_ABORTED,
1617
- DDOG_TRACE_EXPORTER_ERROR_CODE_CONNECTION_REFUSED,
1618
- DDOG_TRACE_EXPORTER_ERROR_CODE_CONNECTION_RESET,
1619
- DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_BODY_FORMAT,
1620
- DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_BODY_TOO_LONG,
1621
- DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_CLIENT,
1622
- DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_EMPTY_BODY,
1623
- DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_PARSE,
1624
- DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_SERVER,
1625
- DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_UNKNOWN,
1626
- DDOG_TRACE_EXPORTER_ERROR_CODE_HTTP_WRONG_STATUS,
1627
- DDOG_TRACE_EXPORTER_ERROR_CODE_INVALID_ARGUMENT,
1628
- DDOG_TRACE_EXPORTER_ERROR_CODE_INVALID_DATA,
1629
- DDOG_TRACE_EXPORTER_ERROR_CODE_INVALID_INPUT,
1630
- DDOG_TRACE_EXPORTER_ERROR_CODE_INVALID_URL,
1631
- DDOG_TRACE_EXPORTER_ERROR_CODE_IO_ERROR,
1632
- DDOG_TRACE_EXPORTER_ERROR_CODE_NETWORK_UNKNOWN,
1633
- DDOG_TRACE_EXPORTER_ERROR_CODE_SERDE,
1634
- DDOG_TRACE_EXPORTER_ERROR_CODE_TIMED_OUT,
1635
- DDOG_TRACE_EXPORTER_ERROR_CODE_INTERNAL,
1636
- DDOG_TRACE_EXPORTER_ERROR_CODE_PANIC,
1637
- } ddog_TraceExporterErrorCode;
1573
+ typedef enum ddog_crasht_ErrorKind {
1574
+ DDOG_CRASHT_ERROR_KIND_PANIC,
1575
+ DDOG_CRASHT_ERROR_KIND_UNHANDLED_EXCEPTION,
1576
+ DDOG_CRASHT_ERROR_KIND_UNIX_SIGNAL,
1577
+ } ddog_crasht_ErrorKind;
1638
1578
 
1639
- /**
1640
- * Structure containing the agent response to a trace payload
1641
- * MUST be freed with `ddog_trace_exporter_response_free`
1642
- *
1643
- * If the agent payload version is enabled on the trace exporter, and
1644
- * the agent response indicates that the payload version hasn't changed,
1645
- * the body will be empty.
1646
- */
1647
- typedef struct ddog_TraceExporterResponse ddog_TraceExporterResponse;
1579
+ typedef enum ddog_crasht_FileType {
1580
+ DDOG_CRASHT_FILE_TYPE_APK,
1581
+ DDOG_CRASHT_FILE_TYPE_ELF,
1582
+ DDOG_CRASHT_FILE_TYPE_PE,
1583
+ } ddog_crasht_FileType;
1648
1584
 
1649
1585
  /**
1650
- * The TraceExporter ingest traces from the tracers serialized as messagepack and forward them to
1651
- * the agent while applying some transformation.
1652
- *
1653
- * # Proxy
1654
- * If the input format is set as `Proxy`, the exporter will forward traces to the agent without
1655
- * deserializing them.
1656
- *
1657
- * # Features
1658
- * When the input format is set to `V04` the TraceExporter will deserialize the traces and perform
1659
- * some operation before sending them to the agent. The available operations are described below.
1586
+ * This enum represents operations a the tracked library might be engaged in.
1587
+ * Currently only implemented for profiling.
1588
+ * The idea is that if a crash consistently occurs while a particular operation
1589
+ * is ongoing, its likely related.
1660
1590
  *
1661
- * ## V07 Serialization
1662
- * The Trace exporter can serialize the traces to V07 before sending them to the agent.
1591
+ * In the future, we might also track wall-clock time of operations
1592
+ * (or some statistical sampling thereof) using the same enum.
1663
1593
  *
1664
- * ## Stats computation
1665
- * The Trace Exporter can compute stats on traces. In this case the trace exporter will start
1666
- * another task to send stats when a time bucket expire. When this feature is enabled the
1667
- * TraceExporter drops all spans that may not be sampled by the agent.
1594
+ * NOTE: This enum is known to be non-exhaustive. Feel free to add new types
1595
+ * as needed.
1668
1596
  */
1669
- typedef struct ddog_TraceExporter ddog_TraceExporter;
1597
+ typedef enum ddog_crasht_OpTypes {
1598
+ DDOG_CRASHT_OP_TYPES_PROFILER_INACTIVE = 0,
1599
+ DDOG_CRASHT_OP_TYPES_PROFILER_COLLECTING_SAMPLE,
1600
+ DDOG_CRASHT_OP_TYPES_PROFILER_UNWINDING,
1601
+ DDOG_CRASHT_OP_TYPES_PROFILER_SERIALIZING,
1602
+ /**
1603
+ * Dummy value to allow easier iteration
1604
+ */
1605
+ DDOG_CRASHT_OP_TYPES_SIZE,
1606
+ } ddog_crasht_OpTypes;
1670
1607
 
1671
1608
  /**
1672
- * The TraceExporterConfig object will hold the configuration properties for the TraceExporter.
1673
- * Once the configuration is passed to the TraceExporter constructor the config is no longer
1674
- * needed by the handle and it can be freed.
1609
+ * See https://man7.org/linux/man-pages/man2/sigaction.2.html
1610
+ * MUST REMAIN IN SYNC WITH THE ENUM IN emit_sigcodes.c
1675
1611
  */
1676
- typedef struct ddog_TraceExporterConfig ddog_TraceExporterConfig;
1612
+ typedef enum ddog_crasht_SiCodes {
1613
+ DDOG_CRASHT_SI_CODES_BUS_ADRALN,
1614
+ DDOG_CRASHT_SI_CODES_BUS_ADRERR,
1615
+ DDOG_CRASHT_SI_CODES_BUS_MCEERR_AO,
1616
+ DDOG_CRASHT_SI_CODES_BUS_MCEERR_AR,
1617
+ DDOG_CRASHT_SI_CODES_BUS_OBJERR,
1618
+ DDOG_CRASHT_SI_CODES_ILL_BADSTK,
1619
+ DDOG_CRASHT_SI_CODES_ILL_COPROC,
1620
+ DDOG_CRASHT_SI_CODES_ILL_ILLADR,
1621
+ DDOG_CRASHT_SI_CODES_ILL_ILLOPC,
1622
+ DDOG_CRASHT_SI_CODES_ILL_ILLOPN,
1623
+ DDOG_CRASHT_SI_CODES_ILL_ILLTRP,
1624
+ DDOG_CRASHT_SI_CODES_ILL_PRVOPC,
1625
+ DDOG_CRASHT_SI_CODES_ILL_PRVREG,
1626
+ DDOG_CRASHT_SI_CODES_SEGV_ACCERR,
1627
+ DDOG_CRASHT_SI_CODES_SEGV_BNDERR,
1628
+ DDOG_CRASHT_SI_CODES_SEGV_MAPERR,
1629
+ DDOG_CRASHT_SI_CODES_SEGV_PKUERR,
1630
+ DDOG_CRASHT_SI_CODES_SI_ASYNCIO,
1631
+ DDOG_CRASHT_SI_CODES_SI_KERNEL,
1632
+ DDOG_CRASHT_SI_CODES_SI_MESGQ,
1633
+ DDOG_CRASHT_SI_CODES_SI_QUEUE,
1634
+ DDOG_CRASHT_SI_CODES_SI_SIGIO,
1635
+ DDOG_CRASHT_SI_CODES_SI_TIMER,
1636
+ DDOG_CRASHT_SI_CODES_SI_TKILL,
1637
+ DDOG_CRASHT_SI_CODES_SI_USER,
1638
+ DDOG_CRASHT_SI_CODES_SYS_SECCOMP,
1639
+ DDOG_CRASHT_SI_CODES_UNKNOWN,
1640
+ } ddog_crasht_SiCodes;
1677
1641
 
1678
1642
  /**
1679
- * Structure that contains error information that `TraceExporter` API can return.
1643
+ * See https://man7.org/linux/man-pages/man7/signal.7.html
1680
1644
  */
1681
- typedef struct ddog_TraceExporterError {
1682
- enum ddog_TraceExporterErrorCode code;
1683
- char *msg;
1684
- } ddog_TraceExporterError;
1645
+ typedef enum ddog_crasht_SignalNames {
1646
+ DDOG_CRASHT_SIGNAL_NAMES_SIGHUP,
1647
+ DDOG_CRASHT_SIGNAL_NAMES_SIGINT,
1648
+ DDOG_CRASHT_SIGNAL_NAMES_SIGQUIT,
1649
+ DDOG_CRASHT_SIGNAL_NAMES_SIGILL,
1650
+ DDOG_CRASHT_SIGNAL_NAMES_SIGTRAP,
1651
+ DDOG_CRASHT_SIGNAL_NAMES_SIGABRT,
1652
+ DDOG_CRASHT_SIGNAL_NAMES_SIGBUS,
1653
+ DDOG_CRASHT_SIGNAL_NAMES_SIGFPE,
1654
+ DDOG_CRASHT_SIGNAL_NAMES_SIGKILL,
1655
+ DDOG_CRASHT_SIGNAL_NAMES_SIGUSR1,
1656
+ DDOG_CRASHT_SIGNAL_NAMES_SIGSEGV,
1657
+ DDOG_CRASHT_SIGNAL_NAMES_SIGUSR2,
1658
+ DDOG_CRASHT_SIGNAL_NAMES_SIGPIPE,
1659
+ DDOG_CRASHT_SIGNAL_NAMES_SIGALRM,
1660
+ DDOG_CRASHT_SIGNAL_NAMES_SIGTERM,
1661
+ DDOG_CRASHT_SIGNAL_NAMES_SIGCHLD,
1662
+ DDOG_CRASHT_SIGNAL_NAMES_SIGCONT,
1663
+ DDOG_CRASHT_SIGNAL_NAMES_SIGSTOP,
1664
+ DDOG_CRASHT_SIGNAL_NAMES_SIGTSTP,
1665
+ DDOG_CRASHT_SIGNAL_NAMES_SIGTTIN,
1666
+ DDOG_CRASHT_SIGNAL_NAMES_SIGTTOU,
1667
+ DDOG_CRASHT_SIGNAL_NAMES_SIGURG,
1668
+ DDOG_CRASHT_SIGNAL_NAMES_SIGXCPU,
1669
+ DDOG_CRASHT_SIGNAL_NAMES_SIGXFSZ,
1670
+ DDOG_CRASHT_SIGNAL_NAMES_SIGVTALRM,
1671
+ DDOG_CRASHT_SIGNAL_NAMES_SIGPROF,
1672
+ DDOG_CRASHT_SIGNAL_NAMES_SIGWINCH,
1673
+ DDOG_CRASHT_SIGNAL_NAMES_SIGIO,
1674
+ DDOG_CRASHT_SIGNAL_NAMES_SIGSYS,
1675
+ DDOG_CRASHT_SIGNAL_NAMES_SIGEMT,
1676
+ DDOG_CRASHT_SIGNAL_NAMES_SIGINFO,
1677
+ DDOG_CRASHT_SIGNAL_NAMES_UNKNOWN,
1678
+ } ddog_crasht_SignalNames;
1685
1679
 
1686
1680
  /**
1687
- * FFI compatible configuration for the TelemetryClient.
1681
+ * Stacktrace collection occurs in the context of a crashing process.
1682
+ * If the stack is sufficiently corruputed, it is possible (but unlikely),
1683
+ * for stack trace collection itself to crash.
1684
+ * We recommend fully enabling stacktrace collection, but having an environment
1685
+ * variable to allow downgrading the collector.
1688
1686
  */
1689
- typedef struct ddog_TelemetryClientConfig {
1687
+ typedef enum ddog_crasht_StacktraceCollection {
1690
1688
  /**
1691
- * How often telemetry should be sent, in milliseconds.
1689
+ * Stacktrace collection occurs in the
1692
1690
  */
1693
- uint64_t interval;
1691
+ DDOG_CRASHT_STACKTRACE_COLLECTION_DISABLED,
1692
+ DDOG_CRASHT_STACKTRACE_COLLECTION_WITHOUT_SYMBOLS,
1694
1693
  /**
1695
- * A V4 UUID that represents a tracer session. This ID should:
1696
- * - Be generated when the tracer starts
1697
- * - Be identical within the context of a host (i.e. multiple threads/processes that belong to
1698
- * a single instrumented app should share the same runtime_id)
1699
- * - Be associated with traces to allow correlation between traces and telemetry data
1694
+ * This option uses `backtrace::resolve_frame_unsynchronized()` to gather symbol information
1695
+ * and also unwind inlined functions. Enabling this feature will not only provide symbolic
1696
+ * details, but may also yield additional or less stack frames compared to other
1697
+ * configurations.
1700
1698
  */
1701
- ddog_CharSlice runtime_id;
1699
+ DDOG_CRASHT_STACKTRACE_COLLECTION_ENABLED_WITH_INPROCESS_SYMBOLS,
1700
+ DDOG_CRASHT_STACKTRACE_COLLECTION_ENABLED_WITH_SYMBOLS_IN_RECEIVER,
1701
+ } ddog_crasht_StacktraceCollection;
1702
+
1703
+ typedef struct ddog_crasht_CrashInfo ddog_crasht_CrashInfo;
1704
+
1705
+ typedef struct ddog_crasht_CrashInfoBuilder ddog_crasht_CrashInfoBuilder;
1706
+
1707
+ typedef struct ddog_crasht_StackFrame ddog_crasht_StackFrame;
1708
+
1709
+ typedef struct ddog_crasht_StackTrace ddog_crasht_StackTrace;
1710
+
1711
+ typedef struct ddog_crasht_Slice_CharSlice {
1702
1712
  /**
1703
- * Whether to enable debug mode for telemetry.
1704
- * When enabled, sets the DD-Telemetry-Debug-Enabled header to true.
1705
- * Defaults to false.
1713
+ * Should be non-null and suitably aligned for the underlying type. It is
1714
+ * allowed but not recommended for the pointer to be null when the len is
1715
+ * zero.
1706
1716
  */
1707
- bool debug_enabled;
1708
- } ddog_TelemetryClientConfig;
1709
-
1710
- typedef enum ddog_LibraryConfigSource {
1711
- DDOG_LIBRARY_CONFIG_SOURCE_LOCAL_STABLE_CONFIG = 0,
1712
- DDOG_LIBRARY_CONFIG_SOURCE_FLEET_STABLE_CONFIG = 1,
1713
- } ddog_LibraryConfigSource;
1717
+ const ddog_CharSlice *ptr;
1718
+ /**
1719
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
1720
+ * than or equal to [isize::MAX].
1721
+ */
1722
+ uintptr_t len;
1723
+ } ddog_crasht_Slice_CharSlice;
1714
1724
 
1715
- typedef struct ddog_Configurator ddog_Configurator;
1725
+ typedef struct ddog_crasht_Slice_I32 {
1726
+ /**
1727
+ * Should be non-null and suitably aligned for the underlying type. It is
1728
+ * allowed but not recommended for the pointer to be null when the len is
1729
+ * zero.
1730
+ */
1731
+ const int32_t *ptr;
1732
+ /**
1733
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
1734
+ * than or equal to [isize::MAX].
1735
+ */
1736
+ uintptr_t len;
1737
+ } ddog_crasht_Slice_I32;
1716
1738
 
1717
- /**
1718
- * Ffi safe type representing a borrowed null-terminated C array
1719
- * Equivalent to a std::ffi::CStr
1720
- */
1721
- typedef struct ddog_CStr {
1739
+ typedef struct ddog_crasht_Config {
1740
+ struct ddog_crasht_Slice_CharSlice additional_files;
1741
+ bool create_alt_stack;
1742
+ bool demangle_names;
1722
1743
  /**
1723
- * Null terminated char array
1744
+ * The endpoint to send the crash report to (can be a file://).
1745
+ * If None, the crashtracker will infer the agent host from env variables.
1724
1746
  */
1725
- char *ptr;
1747
+ const struct ddog_Endpoint *endpoint;
1726
1748
  /**
1727
- * Length of the array, not counting the null-terminator
1749
+ * Optional filename for a unix domain socket if the receiver is used asynchonously
1728
1750
  */
1729
- uintptr_t length;
1730
- } ddog_CStr;
1751
+ ddog_CharSlice optional_unix_socket_filename;
1752
+ enum ddog_crasht_StacktraceCollection resolve_frames;
1753
+ /**
1754
+ * The set of signals we should be registered for.
1755
+ * If empty, use the default set.
1756
+ */
1757
+ struct ddog_crasht_Slice_I32 signals;
1758
+ /**
1759
+ * Timeout in milliseconds before the signal handler starts tearing things down to return.
1760
+ * If 0, uses the default timeout as specified in
1761
+ * `datadog_crashtracker::shared::constants::DD_CRASHTRACK_DEFAULT_TIMEOUT`. Otherwise, uses
1762
+ * the specified timeout value.
1763
+ * This is given as a uint32_t, but the actual timeout needs to fit inside of an i32 (max
1764
+ * 2^31-1). This is a limitation of the various interfaces used to guarantee the timeout.
1765
+ */
1766
+ uint32_t timeout_ms;
1767
+ bool use_alt_stack;
1768
+ } ddog_crasht_Config;
1731
1769
 
1732
- typedef struct ddog_Slice_CharSlice {
1770
+ typedef struct ddog_crasht_EnvVar {
1771
+ ddog_CharSlice key;
1772
+ ddog_CharSlice val;
1773
+ } ddog_crasht_EnvVar;
1774
+
1775
+ typedef struct ddog_crasht_Slice_EnvVar {
1733
1776
  /**
1734
1777
  * Should be non-null and suitably aligned for the underlying type. It is
1735
1778
  * allowed but not recommended for the pointer to be null when the len is
1736
1779
  * zero.
1737
1780
  */
1738
- const ddog_CharSlice *ptr;
1781
+ const struct ddog_crasht_EnvVar *ptr;
1739
1782
  /**
1740
1783
  * The number of elements (not bytes) that `.ptr` points to. Must be less
1741
1784
  * than or equal to [isize::MAX].
1742
1785
  */
1743
1786
  uintptr_t len;
1744
- } ddog_Slice_CharSlice;
1745
-
1746
- typedef struct ddog_ProcessInfo {
1747
- struct ddog_Slice_CharSlice args;
1748
- struct ddog_Slice_CharSlice envp;
1749
- ddog_CharSlice language;
1750
- } ddog_ProcessInfo;
1787
+ } ddog_crasht_Slice_EnvVar;
1751
1788
 
1752
- /**
1753
- * Ffi safe type representing an owned null-terminated C array
1754
- * Equivalent to a std::ffi::CString
1755
- */
1756
- typedef struct ddog_CString {
1789
+ typedef struct ddog_crasht_ReceiverConfig {
1790
+ struct ddog_crasht_Slice_CharSlice args;
1791
+ struct ddog_crasht_Slice_EnvVar env;
1792
+ ddog_CharSlice path_to_receiver_binary;
1757
1793
  /**
1758
- * Null terminated char array
1794
+ * Optional filename to forward stderr to (useful for logging/debugging)
1759
1795
  */
1760
- char *ptr;
1796
+ ddog_CharSlice optional_stderr_filename;
1761
1797
  /**
1762
- * Length of the array, not counting the null-terminator
1798
+ * Optional filename to forward stdout to (useful for logging/debugging)
1763
1799
  */
1764
- uintptr_t length;
1765
- } ddog_CString;
1800
+ ddog_CharSlice optional_stdout_filename;
1801
+ } ddog_crasht_ReceiverConfig;
1766
1802
 
1767
- typedef struct ddog_LibraryConfig {
1768
- struct ddog_CString name;
1769
- struct ddog_CString value;
1770
- enum ddog_LibraryConfigSource source;
1771
- struct ddog_CString config_id;
1772
- } ddog_LibraryConfig;
1803
+ typedef struct ddog_crasht_Metadata {
1804
+ ddog_CharSlice library_name;
1805
+ ddog_CharSlice library_version;
1806
+ ddog_CharSlice family;
1807
+ /**
1808
+ * Should include "service", "environment", etc
1809
+ */
1810
+ const struct ddog_Vec_Tag *tags;
1811
+ } ddog_crasht_Metadata;
1773
1812
 
1774
- /**
1775
- * Holds the raw parts of a Rust Vec; it should only be created from Rust,
1776
- * never from C.
1777
- */
1778
- typedef struct ddog_Vec_LibraryConfig {
1779
- const struct ddog_LibraryConfig *ptr;
1813
+ typedef struct ddog_crasht_Slice_CInt {
1814
+ /**
1815
+ * Should be non-null and suitably aligned for the underlying type. It is
1816
+ * allowed but not recommended for the pointer to be null when the len is
1817
+ * zero.
1818
+ */
1819
+ const int *ptr;
1820
+ /**
1821
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
1822
+ * than or equal to [isize::MAX].
1823
+ */
1780
1824
  uintptr_t len;
1781
- uintptr_t capacity;
1782
- } ddog_Vec_LibraryConfig;
1825
+ } ddog_crasht_Slice_CInt;
1783
1826
 
1784
1827
  /**
1785
1828
  * A generic result type for when an operation may fail,
1786
1829
  * or may return <T> in case of success.
1787
1830
  */
1788
- typedef enum ddog_Result_VecLibraryConfig_Tag {
1789
- DDOG_RESULT_VEC_LIBRARY_CONFIG_OK_VEC_LIBRARY_CONFIG,
1790
- DDOG_RESULT_VEC_LIBRARY_CONFIG_ERR_VEC_LIBRARY_CONFIG,
1791
- } ddog_Result_VecLibraryConfig_Tag;
1831
+ typedef enum ddog_crasht_Result_Usize_Tag {
1832
+ DDOG_CRASHT_RESULT_USIZE_OK_USIZE,
1833
+ DDOG_CRASHT_RESULT_USIZE_ERR_USIZE,
1834
+ } ddog_crasht_Result_Usize_Tag;
1792
1835
 
1793
- typedef struct ddog_Result_VecLibraryConfig {
1794
- ddog_Result_VecLibraryConfig_Tag tag;
1836
+ typedef struct ddog_crasht_Result_Usize {
1837
+ ddog_crasht_Result_Usize_Tag tag;
1795
1838
  union {
1796
1839
  struct {
1797
- struct ddog_Vec_LibraryConfig ok;
1840
+ uintptr_t ok;
1798
1841
  };
1799
1842
  struct {
1800
1843
  struct ddog_Error err;
1801
1844
  };
1802
1845
  };
1803
- } ddog_Result_VecLibraryConfig;
1846
+ } ddog_crasht_Result_Usize;
1804
1847
 
1805
1848
  /**
1806
- * C-compatible representation of an anonymous file handle
1849
+ * Represents an object that should only be referred to by its handle.
1850
+ * Do not access its member for any reason, only use the C API functions on this struct.
1807
1851
  */
1808
- typedef struct ddog_TracerMemfdHandle {
1809
- /**
1810
- * File descriptor (relevant only on Linux)
1811
- */
1812
- int fd;
1813
- } ddog_TracerMemfdHandle;
1852
+ typedef struct ddog_crasht_Handle_CrashInfo {
1853
+ struct ddog_crasht_CrashInfo *inner;
1854
+ } ddog_crasht_Handle_CrashInfo;
1814
1855
 
1815
1856
  /**
1816
- * A generic result type for when an operation may fail,
1817
- * or may return <T> in case of success.
1857
+ * Represents an object that should only be referred to by its handle.
1858
+ * Do not access its member for any reason, only use the C API functions on this struct.
1818
1859
  */
1819
- typedef enum ddog_Result_TracerMemfdHandle_Tag {
1820
- DDOG_RESULT_TRACER_MEMFD_HANDLE_OK_TRACER_MEMFD_HANDLE,
1821
- DDOG_RESULT_TRACER_MEMFD_HANDLE_ERR_TRACER_MEMFD_HANDLE,
1822
- } ddog_Result_TracerMemfdHandle_Tag;
1860
+ typedef struct ddog_crasht_Handle_CrashInfoBuilder {
1861
+ struct ddog_crasht_CrashInfoBuilder *inner;
1862
+ } ddog_crasht_Handle_CrashInfoBuilder;
1823
1863
 
1824
- typedef struct ddog_Result_TracerMemfdHandle {
1825
- ddog_Result_TracerMemfdHandle_Tag tag;
1864
+ typedef enum ddog_crasht_CrashInfoBuilder_NewResult_Tag {
1865
+ DDOG_CRASHT_CRASH_INFO_BUILDER_NEW_RESULT_OK,
1866
+ DDOG_CRASHT_CRASH_INFO_BUILDER_NEW_RESULT_ERR,
1867
+ } ddog_crasht_CrashInfoBuilder_NewResult_Tag;
1868
+
1869
+ typedef struct ddog_crasht_CrashInfoBuilder_NewResult {
1870
+ ddog_crasht_CrashInfoBuilder_NewResult_Tag tag;
1826
1871
  union {
1827
1872
  struct {
1828
- struct ddog_TracerMemfdHandle ok;
1873
+ struct ddog_crasht_Handle_CrashInfoBuilder ok;
1829
1874
  };
1830
1875
  struct {
1831
1876
  struct ddog_Error err;
1832
1877
  };
1833
1878
  };
1834
- } ddog_Result_TracerMemfdHandle;
1879
+ } ddog_crasht_CrashInfoBuilder_NewResult;
1835
1880
 
1836
- /**
1837
- * Log level for filtering log events.
1838
- */
1839
- typedef enum ddog_LogEventLevel {
1840
- /**
1841
- * The "trace" level.
1842
- *
1843
- * Designates very low priority, often extremely verbose, information.
1844
- */
1845
- DDOG_LOG_EVENT_LEVEL_TRACE = 0,
1846
- /**
1847
- * The "debug" level.
1848
- *
1849
- * Designates lower priority information.
1850
- */
1851
- DDOG_LOG_EVENT_LEVEL_DEBUG = 1,
1852
- /**
1853
- * The "info" level.
1854
- *
1855
- * Designates useful information.
1856
- */
1857
- DDOG_LOG_EVENT_LEVEL_INFO = 2,
1858
- /**
1859
- * The "warn" level.
1860
- *
1861
- * Designates hazardous situations.
1862
- */
1863
- DDOG_LOG_EVENT_LEVEL_WARN = 3,
1864
- /**
1865
- * The "error" level.
1866
- *
1867
- * Designates very serious errors.
1868
- */
1869
- DDOG_LOG_EVENT_LEVEL_ERROR = 4,
1870
- } ddog_LogEventLevel;
1881
+ typedef enum ddog_crasht_CrashInfo_NewResult_Tag {
1882
+ DDOG_CRASHT_CRASH_INFO_NEW_RESULT_OK,
1883
+ DDOG_CRASHT_CRASH_INFO_NEW_RESULT_ERR,
1884
+ } ddog_crasht_CrashInfo_NewResult_Tag;
1871
1885
 
1872
- /**
1873
- * Target for standard stream output.
1874
- */
1875
- typedef enum ddog_StdTarget {
1876
- /**
1877
- * Write to standard output (stdout).
1878
- */
1879
- DDOG_STD_TARGET_OUT,
1880
- /**
1881
- * Write to standard error (stderr).
1882
- */
1883
- DDOG_STD_TARGET_ERR,
1884
- } ddog_StdTarget;
1886
+ typedef struct ddog_crasht_CrashInfo_NewResult {
1887
+ ddog_crasht_CrashInfo_NewResult_Tag tag;
1888
+ union {
1889
+ struct {
1890
+ struct ddog_crasht_Handle_CrashInfo ok;
1891
+ };
1892
+ struct {
1893
+ struct ddog_Error err;
1894
+ };
1895
+ };
1896
+ } ddog_crasht_CrashInfo_NewResult;
1897
+
1898
+ typedef struct ddog_crasht_OsInfo {
1899
+ ddog_CharSlice architecture;
1900
+ ddog_CharSlice bitness;
1901
+ ddog_CharSlice os_type;
1902
+ ddog_CharSlice version;
1903
+ } ddog_crasht_OsInfo;
1904
+
1905
+ typedef struct ddog_crasht_ProcInfo {
1906
+ uint32_t pid;
1907
+ } ddog_crasht_ProcInfo;
1908
+
1909
+ typedef struct ddog_crasht_SigInfo {
1910
+ ddog_CharSlice addr;
1911
+ int code;
1912
+ enum ddog_crasht_SiCodes code_human_readable;
1913
+ int signo;
1914
+ enum ddog_crasht_SignalNames signo_human_readable;
1915
+ } ddog_crasht_SigInfo;
1916
+
1917
+ typedef struct ddog_crasht_Span {
1918
+ ddog_CharSlice id;
1919
+ ddog_CharSlice thread_name;
1920
+ } ddog_crasht_Span;
1885
1921
 
1886
1922
  /**
1887
- * Configuration for standard stream output.
1923
+ * Represents an object that should only be referred to by its handle.
1924
+ * Do not access its member for any reason, only use the C API functions on this struct.
1888
1925
  */
1889
- typedef struct ddog_StdConfig {
1890
- /**
1891
- * Target stream (stdout or stderr)
1892
- */
1893
- enum ddog_StdTarget target;
1894
- } ddog_StdConfig;
1926
+ typedef struct ddog_crasht_Handle_StackTrace {
1927
+ struct ddog_crasht_StackTrace *inner;
1928
+ } ddog_crasht_Handle_StackTrace;
1929
+
1930
+ typedef struct ddog_crasht_ThreadData {
1931
+ bool crashed;
1932
+ ddog_CharSlice name;
1933
+ struct ddog_crasht_Handle_StackTrace stack;
1934
+ ddog_CharSlice state;
1935
+ } ddog_crasht_ThreadData;
1895
1936
 
1896
1937
  /**
1897
- * Configuration for file output.
1938
+ * Represents an object that should only be referred to by its handle.
1939
+ * Do not access its member for any reason, only use the C API functions on this struct.
1898
1940
  */
1899
- typedef struct ddog_FileConfig {
1900
- /**
1901
- * Path to the log file
1902
- */
1903
- ddog_CharSlice path;
1904
- /**
1905
- * Maximum total number of files (current + rotated) to keep on disk.
1906
- * When this limit is exceeded, the oldest rotated files are deleted.
1907
- * Set to 0 to disable file cleanup.
1908
- */
1909
- uint64_t max_files;
1910
- /**
1911
- * Maximum size in bytes for each log file.
1912
- * Set to 0 to disable size-based rotation.
1913
- */
1914
- uint64_t max_size_bytes;
1915
- } ddog_FileConfig;
1941
+ typedef struct ddog_crasht_Handle_StackFrame {
1942
+ struct ddog_crasht_StackFrame *inner;
1943
+ } ddog_crasht_Handle_StackFrame;
1944
+
1945
+ typedef enum ddog_crasht_StackFrame_NewResult_Tag {
1946
+ DDOG_CRASHT_STACK_FRAME_NEW_RESULT_OK,
1947
+ DDOG_CRASHT_STACK_FRAME_NEW_RESULT_ERR,
1948
+ } ddog_crasht_StackFrame_NewResult_Tag;
1949
+
1950
+ typedef struct ddog_crasht_StackFrame_NewResult {
1951
+ ddog_crasht_StackFrame_NewResult_Tag tag;
1952
+ union {
1953
+ struct {
1954
+ struct ddog_crasht_Handle_StackFrame ok;
1955
+ };
1956
+ struct {
1957
+ struct ddog_Error err;
1958
+ };
1959
+ };
1960
+ } ddog_crasht_StackFrame_NewResult;
1961
+
1962
+ typedef enum ddog_crasht_StackTrace_NewResult_Tag {
1963
+ DDOG_CRASHT_STACK_TRACE_NEW_RESULT_OK,
1964
+ DDOG_CRASHT_STACK_TRACE_NEW_RESULT_ERR,
1965
+ } ddog_crasht_StackTrace_NewResult_Tag;
1966
+
1967
+ typedef struct ddog_crasht_StackTrace_NewResult {
1968
+ ddog_crasht_StackTrace_NewResult_Tag tag;
1969
+ union {
1970
+ struct {
1971
+ struct ddog_crasht_Handle_StackTrace ok;
1972
+ };
1973
+ struct {
1974
+ struct ddog_Error err;
1975
+ };
1976
+ };
1977
+ } ddog_crasht_StackTrace_NewResult;
1916
1978
 
1917
1979
  #ifdef __cplusplus
1918
1980
  extern "C" {