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