libdatadog 25.0.0.1.0 → 26.0.0.1.0

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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/lib/libdatadog.rb +6 -0
  4. data/vendor/{libdatadog-25.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-26.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/LICENSE-3rdparty.yml +11292 -5944
  5. data/vendor/{libdatadog-25.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-26.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/common.h +156 -179
  6. data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/profiling.h +32 -62
  7. data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  8. data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  9. data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/LICENSE-3rdparty.yml +11292 -5944
  10. data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/common.h +156 -179
  11. data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/profiling.h +32 -62
  12. data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  13. data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  14. data/vendor/{libdatadog-25.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/LICENSE-3rdparty.yml +11292 -5944
  15. data/vendor/libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin/bin/libdatadog-crashtracking-receiver +0 -0
  16. data/vendor/{libdatadog-25.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/common.h +156 -179
  17. data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/profiling.h +32 -62
  18. data/vendor/libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin/lib/libdatadog_profiling.dylib +0 -0
  19. data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  20. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE +202 -0
  21. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +55070 -0
  22. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/NOTICE +4 -0
  23. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/blazesym.h +1497 -0
  24. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/common.h +2651 -0
  25. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/crashtracker.h +953 -0
  26. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/data-pipeline.h +183 -0
  27. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/ddsketch.h +89 -0
  28. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/ffe.h +175 -0
  29. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/library-config.h +113 -0
  30. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/log.h +63 -0
  31. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/profiling.h +941 -0
  32. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/telemetry.h +286 -0
  33. data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  34. data/vendor/libdatadog-26.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +15 -0
  35. data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +11292 -5944
  36. data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/common.h +156 -179
  37. data/vendor/{libdatadog-25.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/profiling.h +32 -62
  38. data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  39. data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  40. metadata +81 -65
  41. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE +0 -0
  42. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/NOTICE +0 -0
  43. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
  44. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/blazesym.h +0 -0
  45. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/crashtracker.h +0 -0
  46. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/data-pipeline.h +0 -0
  47. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/ddsketch.h +0 -0
  48. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/ffe.h +0 -0
  49. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/library-config.h +0 -0
  50. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/log.h +0 -0
  51. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/telemetry.h +0 -0
  52. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE +0 -0
  53. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/NOTICE +0 -0
  54. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  55. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/blazesym.h +0 -0
  56. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/crashtracker.h +0 -0
  57. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/data-pipeline.h +0 -0
  58. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/ddsketch.h +0 -0
  59. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/ffe.h +0 -0
  60. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/library-config.h +0 -0
  61. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/log.h +0 -0
  62. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/telemetry.h +0 -0
  63. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/LICENSE +0 -0
  64. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/NOTICE +0 -0
  65. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/blazesym.h +0 -0
  66. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/crashtracker.h +0 -0
  67. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/data-pipeline.h +0 -0
  68. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/ddsketch.h +0 -0
  69. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/ffe.h +0 -0
  70. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/library-config.h +0 -0
  71. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/log.h +0 -0
  72. /data/vendor/{libdatadog-25.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-26.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/telemetry.h +0 -0
  73. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
  74. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/LICENSE +0 -0
  75. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/NOTICE +0 -0
  76. /data/vendor/{libdatadog-25.0.0 → libdatadog-26.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  77. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/blazesym.h +0 -0
  78. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/crashtracker.h +0 -0
  79. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/data-pipeline.h +0 -0
  80. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/ddsketch.h +0 -0
  81. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/ffe.h +0 -0
  82. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/library-config.h +0 -0
  83. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/log.h +0 -0
  84. /data/vendor/{libdatadog-25.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-26.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/telemetry.h +0 -0
@@ -0,0 +1,953 @@
1
+ // Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+
5
+ #ifndef DDOG_CRASHTRACKER_H
6
+ #define DDOG_CRASHTRACKER_H
7
+
8
+ #pragma once
9
+
10
+ #include <stdbool.h>
11
+ #include <stddef.h>
12
+ #include <stdint.h>
13
+ #include "common.h"
14
+
15
+ #if defined(_WIN32) && defined(_CRASHTRACKING_COLLECTOR)
16
+ #include <werapi.h>
17
+ #include <windows.h>
18
+ #endif
19
+
20
+
21
+
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif // __cplusplus
25
+
26
+ /**
27
+ * Disables the crashtracker.
28
+ * Note that this does not restore the old signal handlers, but rather turns crash-tracking into a
29
+ * no-op, and then chains the old handlers. This means that handlers registered after the
30
+ * crashtracker will continue to work as expected.
31
+ *
32
+ * # Preconditions
33
+ * None
34
+ * # Safety
35
+ * None
36
+ * # Atomicity
37
+ * This function is atomic and idempotent. Calling it multiple times is allowed.
38
+ */
39
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_disable(void);
40
+
41
+ /**
42
+ * Enables the crashtracker, if it had been previously disabled.
43
+ * If crashtracking has not been initialized, this function will have no effect.
44
+ *
45
+ * # Preconditions
46
+ * None
47
+ * # Safety
48
+ * None
49
+ * # Atomicity
50
+ * This function is atomic and idempotent. Calling it multiple times is allowed.
51
+ */
52
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_enable(void);
53
+
54
+ /**
55
+ * Reinitialize the crash-tracking infrastructure after a fork.
56
+ * This should be one of the first things done after a fork, to minimize the
57
+ * chance that a crash occurs between the fork, and this call.
58
+ * In particular, reset the counters that track the profiler state machine.
59
+ * NOTE: An alternative design would be to have a 1:many sidecar listening on a
60
+ * socket instead of 1:1 receiver listening on a pipe, but the only real
61
+ * advantage would be to have fewer processes in `ps -a`.
62
+ *
63
+ * # Preconditions
64
+ * This function assumes that the crash-tracker has previously been
65
+ * initialized.
66
+ * # Safety
67
+ * Crash-tracking functions are not reentrant.
68
+ * No other crash-handler functions should be called concurrently.
69
+ * # Atomicity
70
+ * This function is not atomic. A crash during its execution may lead to
71
+ * unexpected crash-handling behaviour.
72
+ */
73
+ DDOG_CHECK_RETURN
74
+ struct ddog_VoidResult ddog_crasht_update_on_fork(struct ddog_crasht_Config config,
75
+ struct ddog_crasht_ReceiverConfig receiver_config,
76
+ struct ddog_crasht_Metadata metadata);
77
+
78
+ /**
79
+ * Initialize the crash-tracking infrastructure.
80
+ *
81
+ * # Preconditions
82
+ * None.
83
+ * # Safety
84
+ * Crash-tracking functions are not reentrant.
85
+ * No other crash-handler functions should be called concurrently.
86
+ * # Atomicity
87
+ * This function is not atomic. A crash during its execution may lead to
88
+ * unexpected crash-handling behaviour.
89
+ */
90
+ DDOG_CHECK_RETURN
91
+ struct ddog_VoidResult ddog_crasht_init(struct ddog_crasht_Config config,
92
+ struct ddog_crasht_ReceiverConfig receiver_config,
93
+ struct ddog_crasht_Metadata metadata);
94
+
95
+ /**
96
+ * Reconfigure the crashtracker and re-enables it.
97
+ * If the crashtracker has not been initialized, this function will have no effect.
98
+ *
99
+ * # Preconditions
100
+ * None.
101
+ * # Safety
102
+ * Crash-tracking functions are not reentrant.
103
+ * No other crash-handler functions should be called concurrently.
104
+ * # Atomicity
105
+ * This function is not atomic. A crash during its execution may lead to
106
+ * unexpected crash-handling behaviour.
107
+ */
108
+ DDOG_CHECK_RETURN
109
+ struct ddog_VoidResult ddog_crasht_reconfigure(struct ddog_crasht_Config config,
110
+ struct ddog_crasht_ReceiverConfig receiver_config,
111
+ struct ddog_crasht_Metadata metadata);
112
+
113
+ /**
114
+ * Initialize the crash-tracking infrastructure without launching the receiver.
115
+ *
116
+ * # Preconditions
117
+ * Requires `config` to be given with a `unix_socket_path`, which is normally optional.
118
+ * # Safety
119
+ * Crash-tracking functions are not reentrant.
120
+ * No other crash-handler functions should be called concurrently.
121
+ * # Atomicity
122
+ * This function is not atomic. A crash during its execution may lead to
123
+ * unexpected crash-handling behaviour.
124
+ */
125
+ DDOG_CHECK_RETURN
126
+ struct ddog_VoidResult ddog_crasht_init_without_receiver(struct ddog_crasht_Config config,
127
+ struct ddog_crasht_Metadata metadata);
128
+
129
+ /**
130
+ * Returns a list of signals suitable for use in a crashtracker config.
131
+ */
132
+ struct ddog_crasht_Slice_CInt ddog_crasht_default_signals(void);
133
+
134
+ /**
135
+ * Removes all existing additional tags
136
+ * Expected to be used after a fork, to reset the additional tags on the child
137
+ * ATOMICITY:
138
+ * This is NOT ATOMIC.
139
+ * Should only be used when no conflicting updates can occur,
140
+ * e.g. after a fork but before profiling ops start on the child.
141
+ * # Safety
142
+ * No safety concerns.
143
+ */
144
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_clear_additional_tags(void);
145
+
146
+ /**
147
+ * Atomically registers a string as an additional tag.
148
+ * Useful for tracking what operations were occurring when a crash occurred.
149
+ * The set does not check for duplicates.
150
+ *
151
+ * Returns:
152
+ * Ok(handle) on success. The handle is needed to later remove the id;
153
+ * Err() on failure. The most likely cause of failure is that the underlying set is full.
154
+ *
155
+ * # Safety
156
+ * The string argument must be valid.
157
+ */
158
+ DDOG_CHECK_RETURN
159
+ struct ddog_crasht_Result_Usize ddog_crasht_insert_additional_tag(ddog_CharSlice s);
160
+
161
+ /**
162
+ * Atomically removes a completed SpanId.
163
+ * Useful for tracking what operations were occurring when a crash occurred.
164
+ * 0 is reserved for "NoId"
165
+ *
166
+ * Returns:
167
+ * `Ok` on success.
168
+ * `Err` on failure.
169
+ *
170
+ * # Safety
171
+ * No safety concerns.
172
+ */
173
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_remove_additional_tag(uintptr_t idx);
174
+
175
+ /**
176
+ * Resets all counters to 0.
177
+ * Expected to be used after a fork, to reset the counters on the child
178
+ * ATOMICITY:
179
+ * This is NOT ATOMIC.
180
+ * Should only be used when no conflicting updates can occur,
181
+ * e.g. after a fork but before profiling ops start on the child.
182
+ * # Safety
183
+ * No safety concerns.
184
+ */
185
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_reset_counters(void);
186
+
187
+ /**
188
+ * Atomically increments the count associated with `op`.
189
+ * Useful for tracking what operations were occuring when a crash occurred.
190
+ *
191
+ * # Safety
192
+ * No safety concerns.
193
+ */
194
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_begin_op(enum ddog_crasht_OpTypes op);
195
+
196
+ /**
197
+ * Atomically decrements the count associated with `op`.
198
+ * Useful for tracking what operations were occuring when a crash occurred.
199
+ *
200
+ * # Safety
201
+ * No safety concerns.
202
+ */
203
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_end_op(enum ddog_crasht_OpTypes op);
204
+
205
+ /**
206
+ * Resets all stored spans to 0.
207
+ * Expected to be used after a fork, to reset the spans on the child
208
+ * ATOMICITY:
209
+ * This is NOT ATOMIC.
210
+ * Should only be used when no conflicting updates can occur,
211
+ * e.g. after a fork but before profiling ops start on the child.
212
+ * # Safety
213
+ * No safety concerns.
214
+ */
215
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_clear_span_ids(void);
216
+
217
+ /**
218
+ * Resets all stored traces to 0.
219
+ * Expected to be used after a fork, to reset the traces on the child
220
+ * ATOMICITY:
221
+ * This is NOT ATOMIC.
222
+ * Should only be used when no conflicting updates can occur,
223
+ * e.g. after a fork but before profiling ops start on the child.
224
+ * # Safety
225
+ * No safety concerns.
226
+ */
227
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_clear_trace_ids(void);
228
+
229
+ /**
230
+ * Atomically registers an active traceId.
231
+ * Useful for tracking what operations were occurring when a crash occurred.
232
+ * 0 is reserved for "NoId"
233
+ * The set does not check for duplicates. Adding the same id twice is an error.
234
+ *
235
+ * Inputs:
236
+ * id<high/low>: the 128 bit id, broken into 2 64 bit chunks (see note)
237
+ *
238
+ * Returns:
239
+ * Ok(handle) on success. The handle is needed to later remove the id;
240
+ * Err() on failure. The most likely cause of failure is that the underlying set is full.
241
+ *
242
+ * Note: 128 bit ints in FFI were not stabilized until Rust 1.77
243
+ * https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
244
+ * We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints
245
+ * until we can upgrade.
246
+ *
247
+ * # Safety
248
+ * No safety concerns.
249
+ */
250
+ DDOG_CHECK_RETURN
251
+ struct ddog_crasht_Result_Usize ddog_crasht_insert_trace_id(uint64_t id_high,
252
+ uint64_t id_low);
253
+
254
+ /**
255
+ * Atomically registers an active SpanId.
256
+ * Useful for tracking what operations were occurring when a crash occurred.
257
+ * 0 is reserved for "NoId".
258
+ * The set does not check for duplicates. Adding the same id twice is an error.
259
+ *
260
+ * Inputs:
261
+ * id<high/low>: the 128 bit id, broken into 2 64 bit chunks (see note)
262
+ *
263
+ * Returns:
264
+ * Ok(handle) on success. The handle is needed to later remove the id;
265
+ * Err() on failure. The most likely cause of failure is that the underlying set is full.
266
+ *
267
+ * Note: 128 bit ints in FFI were not stabilized until Rust 1.77
268
+ * https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
269
+ * We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints
270
+ * until we can upgrade.
271
+ *
272
+ * # Safety
273
+ * No safety concerns.
274
+ */
275
+ DDOG_CHECK_RETURN
276
+ struct ddog_crasht_Result_Usize ddog_crasht_insert_span_id(uint64_t id_high,
277
+ uint64_t id_low);
278
+
279
+ /**
280
+ * Atomically removes a completed SpanId.
281
+ * Useful for tracking what operations were occurring when a crash occurred.
282
+ * 0 is reserved for "NoId"
283
+ *
284
+ * Inputs:
285
+ * id<high/low>: the 128 bit id, broken into 2 64 bit chunks (see note)
286
+ * idx: The handle for the id, from a previous successful call to `insert_span_id`.
287
+ * Attempting to remove the same element twice is an error.
288
+ * Returns:
289
+ * `Ok` on success.
290
+ * `Err` on failure. If `id` is not found at `idx`, `Err` will be returned and the set will not
291
+ * be modified.
292
+ *
293
+ * Note: 128 bit ints in FFI were not stabilized until Rust 1.77
294
+ * https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
295
+ * We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints
296
+ * until we can upgrade.
297
+ *
298
+ * # Safety
299
+ * No safety concerns.
300
+ */
301
+ DDOG_CHECK_RETURN
302
+ struct ddog_VoidResult ddog_crasht_remove_span_id(uint64_t id_high,
303
+ uint64_t id_low,
304
+ uintptr_t idx);
305
+
306
+ /**
307
+ * Atomically removes a completed TraceId.
308
+ * Useful for tracking what operations were occurring when a crash occurred.
309
+ * 0 is reserved for "NoId"
310
+ *
311
+ * Inputs:
312
+ * id<high/low>: the 128 bit id, broken into 2 64 bit chunks (see note)
313
+ * idx: The handle for the id, from a previous successful call to `insert_span_id`.
314
+ * Attempting to remove the same element twice is an error.
315
+ * Returns:
316
+ * `Ok` on success.
317
+ * `Err` on failure. If `id` is not found at `idx`, `Err` will be returned and the set will not
318
+ * be modified.
319
+ *
320
+ * Note: 128 bit ints in FFI were not stabilized until Rust 1.77
321
+ * https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
322
+ * We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints
323
+ * until we can upgrade.
324
+ *
325
+ * # Safety
326
+ * No safety concerns.
327
+ */
328
+ DDOG_CHECK_RETURN
329
+ struct ddog_VoidResult ddog_crasht_remove_trace_id(uint64_t id_high,
330
+ uint64_t id_low,
331
+ uintptr_t idx);
332
+
333
+ #if (defined(_CRASHTRACKING_COLLECTOR) && defined(_WIN32))
334
+ /**
335
+ * Initialize the crash-tracking infrastructure.
336
+ *
337
+ * # Preconditions
338
+ * None.
339
+ * # Safety
340
+ * Crash-tracking functions are not reentrant.
341
+ * No other crash-handler functions should be called concurrently.
342
+ * # Atomicity
343
+ * This function is not atomic. A crash during its execution may lead to
344
+ * unexpected crash-handling behaviour.
345
+ */
346
+ DDOG_CHECK_RETURN
347
+ bool ddog_crasht_init_windows(ddog_CharSlice module,
348
+ const struct ddog_Endpoint *endpoint,
349
+ struct ddog_crasht_Metadata metadata);
350
+ #endif
351
+
352
+ #if (defined(_CRASHTRACKING_COLLECTOR) && defined(_WIN32))
353
+ HRESULT OutOfProcessExceptionEventSignatureCallback(const void *_context,
354
+ const WER_RUNTIME_EXCEPTION_INFORMATION *_exception_information,
355
+ int32_t _index,
356
+ uint16_t *_name,
357
+ uint32_t *_name_size,
358
+ uint16_t *_value,
359
+ uint32_t *_value_size);
360
+ #endif
361
+
362
+ #if (defined(_CRASHTRACKING_COLLECTOR) && defined(_WIN32))
363
+ HRESULT OutOfProcessExceptionEventDebuggerLaunchCallback(const void *_context,
364
+ const WER_RUNTIME_EXCEPTION_INFORMATION *_exception_information,
365
+ BOOL *_is_custom_debugger,
366
+ uint16_t *_debugger_launch,
367
+ uint32_t *_debugger_launch_size,
368
+ BOOL *_is_debugger_auto_launch);
369
+ #endif
370
+
371
+ #if (defined(_CRASHTRACKING_COLLECTOR) && defined(_WIN32))
372
+ HRESULT OutOfProcessExceptionEventCallback(const void *context,
373
+ const WER_RUNTIME_EXCEPTION_INFORMATION *exception_information,
374
+ BOOL *_ownership_claimed,
375
+ uint16_t *_event_name,
376
+ uint32_t *_size,
377
+ uint32_t *_signature_count);
378
+ #endif
379
+
380
+ /**
381
+ * # Safety
382
+ * The `crash_info` can be null, but if non-null it must point to a Builder made by this module,
383
+ * which has not previously been dropped.
384
+ */
385
+ DDOG_CHECK_RETURN
386
+ struct ddog_VoidResult ddog_crasht_CrashInfo_demangle_names(struct ddog_crasht_Handle_CrashInfo *crash_info);
387
+
388
+ /**
389
+ * # Safety
390
+ * The `builder` can be null, but if non-null it must point to a Frame
391
+ * made by this module, which has not previously been dropped.
392
+ */
393
+ void ddog_crasht_CrashInfo_drop(struct ddog_crasht_Handle_CrashInfo *builder);
394
+
395
+ /**
396
+ * # Safety
397
+ * The `crash_info` can be null, but if non-null it must point to a Builder made by this module,
398
+ * which has not previously been dropped.
399
+ */
400
+ DDOG_CHECK_RETURN
401
+ struct ddog_VoidResult ddog_crasht_CrashInfo_normalize_ips(struct ddog_crasht_Handle_CrashInfo *crash_info,
402
+ uint32_t pid);
403
+
404
+ /**
405
+ * # Safety
406
+ * The `crash_info` can be null, but if non-null it must point to a Builder made by this module,
407
+ * which has not previously been dropped.
408
+ */
409
+ DDOG_CHECK_RETURN
410
+ struct ddog_VoidResult ddog_crasht_CrashInfo_resolve_names(struct ddog_crasht_Handle_CrashInfo *crash_info,
411
+ uint32_t pid);
412
+
413
+ /**
414
+ * # Safety
415
+ * The `crash_info` can be null, but if non-null it must point to a Builder made by this module,
416
+ * which has not previously been dropped.
417
+ * This function will:
418
+ */
419
+ DDOG_CHECK_RETURN
420
+ struct ddog_VoidResult ddog_crasht_CrashInfo_enrich_callstacks(struct ddog_crasht_Handle_CrashInfo *crash_info,
421
+ uint32_t pid);
422
+
423
+ /**
424
+ * # Safety
425
+ * The `crash_info` can be null, but if non-null it must point to a Builder made by this module,
426
+ * which has not previously been dropped.
427
+ * The CharSlice must be valid.
428
+ */
429
+ DDOG_CHECK_RETURN
430
+ struct ddog_VoidResult ddog_crasht_CrashInfo_upload_to_endpoint(struct ddog_crasht_Handle_CrashInfo *crash_info,
431
+ const struct ddog_Endpoint *endpoint);
432
+
433
+ /**
434
+ * Create a new CrashInfoBuilder, and returns an opaque reference to it.
435
+ * # Safety
436
+ * No safety issues.
437
+ */
438
+ DDOG_CHECK_RETURN
439
+ struct ddog_crasht_CrashInfoBuilder_NewResult ddog_crasht_CrashInfoBuilder_new(void);
440
+
441
+ /**
442
+ * # Safety
443
+ * The `builder` can be null, but if non-null it must point to a Frame
444
+ * made by this module, which has not previously been dropped.
445
+ */
446
+ void ddog_crasht_CrashInfoBuilder_drop(struct ddog_crasht_Handle_CrashInfoBuilder *builder);
447
+
448
+ /**
449
+ * # Safety
450
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
451
+ * which has not previously been dropped.
452
+ */
453
+ DDOG_CHECK_RETURN
454
+ ddog_crasht_CrashInfo_NewResult ddog_crasht_CrashInfoBuilder_build(struct ddog_crasht_Handle_CrashInfoBuilder *builder);
455
+
456
+ /**
457
+ * # Safety
458
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
459
+ * which has not previously been dropped.
460
+ * The CharSlice must be valid.
461
+ */
462
+ DDOG_CHECK_RETURN
463
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_counter(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
464
+ ddog_CharSlice name,
465
+ int64_t value);
466
+
467
+ /**
468
+ * # Safety
469
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
470
+ * which has not previously been dropped.
471
+ * The Kind must be valid.
472
+ */
473
+ DDOG_CHECK_RETURN
474
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_kind(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
475
+ enum ddog_crasht_ErrorKind kind);
476
+
477
+ /**
478
+ * # Safety
479
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
480
+ * which has not previously been dropped.
481
+ * The CharSlice must be valid.
482
+ */
483
+ DDOG_CHECK_RETURN
484
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_file(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
485
+ ddog_CharSlice filename);
486
+
487
+ /**
488
+ * # Safety
489
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
490
+ * which has not previously been dropped.
491
+ * The CharSlice must be valid.
492
+ */
493
+ DDOG_CHECK_RETURN
494
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_file_and_contents(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
495
+ ddog_CharSlice filename,
496
+ struct ddog_crasht_Slice_CharSlice contents);
497
+
498
+ /**
499
+ * # Safety
500
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
501
+ * which has not previously been dropped.
502
+ * The CharSlice must be valid.
503
+ */
504
+ DDOG_CHECK_RETURN
505
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_fingerprint(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
506
+ ddog_CharSlice fingerprint);
507
+
508
+ /**
509
+ * # Safety
510
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
511
+ * which has not previously been dropped.
512
+ * The CharSlice must be valid.
513
+ */
514
+ DDOG_CHECK_RETURN
515
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_incomplete(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
516
+ bool incomplete);
517
+
518
+ /**
519
+ * # Safety
520
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
521
+ * which has not previously been dropped.
522
+ * The CharSlice must be valid.
523
+ */
524
+ DDOG_CHECK_RETURN
525
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_log_message(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
526
+ ddog_CharSlice message,
527
+ bool also_print);
528
+
529
+ /**
530
+ * # Safety
531
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
532
+ * which has not previously been dropped.
533
+ * All arguments must be valid.
534
+ */
535
+ DDOG_CHECK_RETURN
536
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_metadata(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
537
+ struct ddog_crasht_Metadata metadata);
538
+
539
+ /**
540
+ * # Safety
541
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
542
+ * which has not previously been dropped.
543
+ * All arguments must be valid.
544
+ */
545
+ DDOG_CHECK_RETURN
546
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_os_info(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
547
+ struct ddog_crasht_OsInfo os_info);
548
+
549
+ /**
550
+ * # Safety
551
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
552
+ * which has not previously been dropped.
553
+ * All arguments must be valid.
554
+ */
555
+ DDOG_CHECK_RETURN
556
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_os_info_this_machine(struct ddog_crasht_Handle_CrashInfoBuilder *builder);
557
+
558
+ /**
559
+ * # Safety
560
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
561
+ * which has not previously been dropped.
562
+ * All arguments must be valid.
563
+ */
564
+ DDOG_CHECK_RETURN
565
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_proc_info(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
566
+ struct ddog_crasht_ProcInfo proc_info);
567
+
568
+ /**
569
+ * # Safety
570
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
571
+ * which has not previously been dropped.
572
+ * All arguments must be valid.
573
+ */
574
+ DDOG_CHECK_RETURN
575
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_sig_info(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
576
+ struct ddog_crasht_SigInfo sig_info);
577
+
578
+ /**
579
+ * # Safety
580
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
581
+ * which has not previously been dropped.
582
+ * All arguments must be valid.
583
+ */
584
+ DDOG_CHECK_RETURN
585
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_span_id(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
586
+ struct ddog_crasht_Span span_id);
587
+
588
+ /**
589
+ * # Safety
590
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
591
+ * which has not previously been dropped.
592
+ * All arguments must be valid.
593
+ * Consumes the stack argument.
594
+ */
595
+ DDOG_CHECK_RETURN
596
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_stack(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
597
+ struct ddog_crasht_Handle_StackTrace *stack);
598
+
599
+ /**
600
+ * # Safety
601
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
602
+ * which has not previously been dropped.
603
+ * All arguments must be valid.
604
+ * Consumes the stack argument.
605
+ */
606
+ DDOG_CHECK_RETURN
607
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_thread(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
608
+ struct ddog_crasht_ThreadData thread);
609
+
610
+ /**
611
+ * # Safety
612
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
613
+ * which has not previously been dropped.
614
+ * The CharSlice must be valid.
615
+ */
616
+ DDOG_CHECK_RETURN
617
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_timestamp(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
618
+ struct ddog_Timespec ts);
619
+
620
+ /**
621
+ * # Safety
622
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
623
+ * which has not previously been dropped.
624
+ * The CharSlice must be valid.
625
+ */
626
+ DDOG_CHECK_RETURN
627
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_timestamp_now(struct ddog_crasht_Handle_CrashInfoBuilder *builder);
628
+
629
+ /**
630
+ * # Safety
631
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
632
+ * which has not previously been dropped.
633
+ * All arguments must be valid.
634
+ */
635
+ DDOG_CHECK_RETURN
636
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_trace_id(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
637
+ struct ddog_crasht_Span trace_id);
638
+
639
+ /**
640
+ * # Safety
641
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
642
+ * which has not previously been dropped.
643
+ * The CharSlice must be valid.
644
+ */
645
+ DDOG_CHECK_RETURN
646
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_message(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
647
+ ddog_CharSlice message);
648
+
649
+ /**
650
+ * # Safety
651
+ * The `builder` can be null, but if non-null it must point to a Builder made by this module,
652
+ * which has not previously been dropped.
653
+ * All arguments must be valid.
654
+ * This method requires that the builder has a UUID, siginfo, and metadata set
655
+ */
656
+ DDOG_CHECK_RETURN
657
+ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_upload_ping_to_endpoint(struct ddog_crasht_Handle_CrashInfoBuilder *builder,
658
+ const struct ddog_Endpoint *endpoint);
659
+
660
+ /**
661
+ * Create a new StackFrame, and returns an opaque reference to it.
662
+ * # Safety
663
+ * No safety issues.
664
+ */
665
+ DDOG_CHECK_RETURN struct ddog_crasht_StackFrame_NewResult ddog_crasht_StackFrame_new(void);
666
+
667
+ /**
668
+ * # Safety
669
+ * The `frame` can be null, but if non-null it must point to a Frame
670
+ * made by this module, which has not previously been dropped.
671
+ */
672
+ void ddog_crasht_StackFrame_drop(struct ddog_crasht_Handle_StackFrame *frame);
673
+
674
+ /**
675
+ * # Safety
676
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
677
+ * which has not previously been dropped.
678
+ * The CharSlice must be valid.
679
+ */
680
+ DDOG_CHECK_RETURN
681
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_ip(struct ddog_crasht_Handle_StackFrame *frame,
682
+ uintptr_t ip);
683
+
684
+ /**
685
+ * # Safety
686
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
687
+ * which has not previously been dropped.
688
+ * The CharSlice must be valid.
689
+ */
690
+ DDOG_CHECK_RETURN
691
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_module_base_address(struct ddog_crasht_Handle_StackFrame *frame,
692
+ uintptr_t module_base_address);
693
+
694
+ /**
695
+ * # Safety
696
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
697
+ * which has not previously been dropped.
698
+ * The CharSlice must be valid.
699
+ */
700
+ DDOG_CHECK_RETURN
701
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_sp(struct ddog_crasht_Handle_StackFrame *frame,
702
+ uintptr_t sp);
703
+
704
+ /**
705
+ * # Safety
706
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
707
+ * which has not previously been dropped.
708
+ * The CharSlice must be valid.
709
+ */
710
+ DDOG_CHECK_RETURN
711
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_symbol_address(struct ddog_crasht_Handle_StackFrame *frame,
712
+ uintptr_t symbol_address);
713
+
714
+ /**
715
+ * # Safety
716
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
717
+ * which has not previously been dropped.
718
+ * The CharSlice must be valid.
719
+ */
720
+ DDOG_CHECK_RETURN
721
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_build_id(struct ddog_crasht_Handle_StackFrame *frame,
722
+ ddog_CharSlice build_id);
723
+
724
+ /**
725
+ * # Safety
726
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
727
+ * which has not previously been dropped.
728
+ * The BuildIdType must be valid.
729
+ */
730
+ DDOG_CHECK_RETURN
731
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_build_id_type(struct ddog_crasht_Handle_StackFrame *frame,
732
+ enum ddog_crasht_BuildIdType build_id_type);
733
+
734
+ /**
735
+ * # Safety
736
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
737
+ * which has not previously been dropped.
738
+ * The FileType must be valid.
739
+ */
740
+ DDOG_CHECK_RETURN
741
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_file_type(struct ddog_crasht_Handle_StackFrame *frame,
742
+ enum ddog_crasht_FileType file_type);
743
+
744
+ /**
745
+ * # Safety
746
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
747
+ * which has not previously been dropped.
748
+ * The CharSlice must be valid.
749
+ */
750
+ DDOG_CHECK_RETURN
751
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_path(struct ddog_crasht_Handle_StackFrame *frame,
752
+ ddog_CharSlice path);
753
+
754
+ /**
755
+ * # Safety
756
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
757
+ * which has not previously been dropped.
758
+ * The CharSlice must be valid.
759
+ */
760
+ DDOG_CHECK_RETURN
761
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_relative_address(struct ddog_crasht_Handle_StackFrame *frame,
762
+ uintptr_t relative_address);
763
+
764
+ /**
765
+ * # Safety
766
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
767
+ * which has not previously been dropped.
768
+ */
769
+ DDOG_CHECK_RETURN
770
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_column(struct ddog_crasht_Handle_StackFrame *frame,
771
+ uint32_t column);
772
+
773
+ /**
774
+ * # Safety
775
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
776
+ * which has not previously been dropped.
777
+ * The CharSlice must be valid.
778
+ */
779
+ DDOG_CHECK_RETURN
780
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_file(struct ddog_crasht_Handle_StackFrame *frame,
781
+ ddog_CharSlice file);
782
+
783
+ /**
784
+ * # Safety
785
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
786
+ * which has not previously been dropped.
787
+ * The CharSlice must be valid.
788
+ */
789
+ DDOG_CHECK_RETURN
790
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_function(struct ddog_crasht_Handle_StackFrame *frame,
791
+ ddog_CharSlice function);
792
+
793
+ /**
794
+ * # Safety
795
+ * The `frame` can be null, but if non-null it must point to a Frame made by this module,
796
+ * which has not previously been dropped.
797
+ */
798
+ DDOG_CHECK_RETURN
799
+ struct ddog_VoidResult ddog_crasht_StackFrame_with_line(struct ddog_crasht_Handle_StackFrame *frame,
800
+ uint32_t line);
801
+
802
+ /**
803
+ * Create a new StackTrace, and returns an opaque reference to it.
804
+ * # Safety
805
+ * No safety issues.
806
+ */
807
+ DDOG_CHECK_RETURN struct ddog_crasht_StackTrace_NewResult ddog_crasht_StackTrace_new(void);
808
+
809
+ /**
810
+ * # Safety
811
+ * The `frame` can be null, but if non-null it must point to a Frame
812
+ * made by this module, which has not previously been dropped.
813
+ */
814
+ void ddog_crasht_StackTrace_drop(struct ddog_crasht_Handle_StackTrace *trace);
815
+
816
+ /**
817
+ * # Safety
818
+ * The `stacktrace` can be null, but if non-null it must point to a StackTrace made by this module,
819
+ * which has not previously been dropped.
820
+ * The frame can be non-null, but if non-null it must point to a Frame made by this module,
821
+ * which has not previously been dropped.
822
+ * The frame is consumed, and does not need to be dropped after this operation.
823
+ */
824
+ DDOG_CHECK_RETURN
825
+ struct ddog_VoidResult ddog_crasht_StackTrace_push_frame(struct ddog_crasht_Handle_StackTrace *trace,
826
+ struct ddog_crasht_Handle_StackFrame *frame,
827
+ bool incomplete);
828
+
829
+ /**
830
+ * # Safety
831
+ * The `stacktrace` can be null, but if non-null it must point to a StackTrace made by this module,
832
+ * which has not previously been dropped.
833
+ */
834
+ DDOG_CHECK_RETURN
835
+ struct ddog_VoidResult ddog_crasht_StackTrace_set_complete(struct ddog_crasht_Handle_StackTrace *trace);
836
+
837
+ /**
838
+ * Demangles the string "name".
839
+ * If demangling fails, returns an empty string ""
840
+ *
841
+ * # Safety
842
+ * `name` should be a valid reference to a utf8 encoded String.
843
+ * The string is copied into the result, and does not need to outlive this call
844
+ */
845
+ DDOG_CHECK_RETURN
846
+ struct ddog_StringWrapperResult ddog_crasht_demangle(ddog_CharSlice name,
847
+ enum ddog_crasht_DemangleOptions options);
848
+
849
+ /**
850
+ * Receives data from a crash collector via a pipe on `stdin`, formats it into
851
+ * `CrashInfo` json, and emits it to the endpoint/file defined in `config`.
852
+ *
853
+ * At a high-level, this exists because doing anything in a
854
+ * signal handler is dangerous, so we fork a sidecar to do the stuff we aren't
855
+ * allowed to do in the handler.
856
+ *
857
+ * See comments in [libdd-crashtracker/lib.rs] for a full architecture description.
858
+ * # Safety
859
+ * No safety concerns
860
+ */
861
+ DDOG_CHECK_RETURN struct ddog_VoidResult ddog_crasht_receiver_entry_point_stdin(void);
862
+
863
+ /**
864
+ * Receives data from a crash collector via a pipe on `stdin`, formats it into
865
+ * `CrashInfo` json, and emits it to the endpoint/file defined in `config`.
866
+ *
867
+ * At a high-level, this exists because doing anything in a
868
+ * signal handler is dangerous, so we fork a sidecar to do the stuff we aren't
869
+ * allowed to do in the handler.
870
+ *
871
+ * See comments in [libdd-crashtracker/lib.rs] for a full architecture
872
+ * description.
873
+ * # Safety
874
+ * No safety concerns
875
+ */
876
+ DDOG_CHECK_RETURN
877
+ struct ddog_VoidResult ddog_crasht_receiver_entry_point_unix_socket(ddog_CharSlice socket_path);
878
+
879
+ /**
880
+ * Register a runtime stack collection callback
881
+ *
882
+ * # Arguments
883
+ * - `callback`: The callback function to invoke during crashes
884
+ *
885
+ * # Returns
886
+ * - `CallbackResult::Ok` if registration succeeds
887
+ * - `CallbackResult::Error` if registration fails
888
+ *
889
+ * # Safety
890
+ * - The callback must be signal-safe
891
+ * - Only one callback can be registered at a time
892
+ * - The callback must be registered once on CrashTracker initialization, before any crash occurs
893
+ *
894
+ * # Example Usage from C
895
+ * ```c
896
+ * static void my_runtime_callback(
897
+ * void (*emit_frame)(const ddog_RuntimeStackFrameFFI*),
898
+ * ) {
899
+ * // Collect runtime frames and call emit_frame for each one
900
+ * const char* function_name = "my_function";
901
+ * const char* file_name = "script.rb";
902
+ * ddog_CharSlice type_name = DDOG_CHARSLICE_FROM_CSTR("MyModule.MyClass");
903
+ * ddog_crasht_RuntimeStackFrameFFI frame = {
904
+ * .type_name = type_name,
905
+ * .function = DDOG_CHARSLICE_FROM_CSTR(function_name),
906
+ * .file = DDOG_CHARSLICE_FROM_CSTR(file_name),
907
+ * .line = 42,
908
+ * .column = 10
909
+ * };
910
+ * emit_frame(&frame);
911
+ * }
912
+ */
913
+ enum ddog_crasht_CallbackResult ddog_crasht_register_runtime_frame_callback(ddog_crasht_RuntimeStackFrameCallback callback);
914
+
915
+ /**
916
+ * Register a runtime stacktrace string collection callback
917
+ *
918
+ * # Arguments
919
+ * - `callback`: The callback function to invoke during crashes
920
+ *
921
+ * # Returns
922
+ * - `CallbackResult::Ok` if registration succeeds (replaces any existing callback)
923
+ * - `CallbackResult::Error` if registration fails
924
+ *
925
+ * # Safety
926
+ * - The callback must be signal-safe
927
+ * - Only one callback can be registered at a time (this replaces any existing one)
928
+ */
929
+ enum ddog_crasht_CallbackResult ddog_crasht_register_runtime_stacktrace_string_callback(ddog_crasht_RuntimeStacktraceStringCallback callback);
930
+
931
+ /**
932
+ * Returns true if a callback is registered, false otherwise
933
+ *
934
+ * # Safety
935
+ * This function is safe to call at any time
936
+ */
937
+ bool ddog_crasht_is_runtime_callback_registered(void);
938
+
939
+ /**
940
+ * Get the callback type from the currently registered callback context
941
+ *
942
+ * # Safety
943
+ * - The returned pointer is valid only while the callback remains registered
944
+ * - The caller should not free the returned pointer
945
+ * - The returned string should be copied if it needs to persist beyond callback lifetime
946
+ */
947
+ const char *ddog_crasht_get_registered_callback_type(void);
948
+
949
+ #ifdef __cplusplus
950
+ } // extern "C"
951
+ #endif // __cplusplus
952
+
953
+ #endif /* DDOG_CRASHTRACKER_H */