libdatadog 6.0.0.2.0-x86_64-linux → 9.0.0.1.0-x86_64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/libdatadog/version.rb +2 -2
- data/lib/libdatadog.rb +16 -0
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +17283 -7448
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
- data/vendor/libdatadog-9.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/blazesym.h +895 -0
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/common.h +369 -42
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/profiling.h +293 -40
- data/vendor/libdatadog-9.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/telemetry.h +288 -0
- data/vendor/libdatadog-9.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +2 -4
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +17283 -7448
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
- data/vendor/libdatadog-9.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/blazesym.h +895 -0
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/common.h +369 -42
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/profiling.h +293 -40
- data/vendor/libdatadog-9.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/telemetry.h +288 -0
- data/vendor/libdatadog-9.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
- data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +2 -4
- metadata +22 -18
- data/vendor/libdatadog-6.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
- data/vendor/libdatadog-6.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
- /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE +0 -0
- /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/NOTICE +0 -0
- /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE +0 -0
- /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/NOTICE +0 -0
@@ -1,5 +1,6 @@
|
|
1
|
-
//
|
2
|
-
//
|
1
|
+
// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
3
|
+
|
3
4
|
|
4
5
|
#ifndef DDOG_PROFILING_H
|
5
6
|
#define DDOG_PROFILING_H
|
@@ -11,23 +12,255 @@
|
|
11
12
|
#include <stdint.h>
|
12
13
|
#include "common.h"
|
13
14
|
|
15
|
+
#ifdef __cplusplus
|
16
|
+
extern "C" {
|
17
|
+
#endif // __cplusplus
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Cleans up after the crash-tracker:
|
21
|
+
* Unregister the crash handler, restore the previous handler (if any), and
|
22
|
+
* shut down the receiver. Note that the use of this function is optional:
|
23
|
+
* the receiver will automatically shutdown when the pipe is closed on program
|
24
|
+
* exit.
|
25
|
+
*
|
26
|
+
* # Preconditions
|
27
|
+
* This function assumes that the crash-tracker has previously been
|
28
|
+
* initialized.
|
29
|
+
* # Safety
|
30
|
+
* Crash-tracking functions are not reentrant.
|
31
|
+
* No other crash-handler functions should be called concurrently.
|
32
|
+
* # Atomicity
|
33
|
+
* This function is not atomic. A crash during its execution may lead to
|
34
|
+
* unexpected crash-handling behaviour.
|
35
|
+
*/
|
36
|
+
DDOG_CHECK_RETURN struct ddog_prof_CrashtrackerResult ddog_prof_Crashtracker_shutdown(void);
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Reinitialize the crash-tracking infrastructure after a fork.
|
40
|
+
* This should be one of the first things done after a fork, to minimize the
|
41
|
+
* chance that a crash occurs between the fork, and this call.
|
42
|
+
* In particular, reset the counters that track the profiler state machine,
|
43
|
+
* and start a new receiver to collect data from this fork.
|
44
|
+
* NOTE: An alternative design would be to have a 1:many sidecar listening on a
|
45
|
+
* socket instead of 1:1 receiver listening on a pipe, but the only real
|
46
|
+
* advantage would be to have fewer processes in `ps -a`.
|
47
|
+
*
|
48
|
+
* # Preconditions
|
49
|
+
* This function assumes that the crash-tracker has previously been
|
50
|
+
* initialized.
|
51
|
+
* # Safety
|
52
|
+
* Crash-tracking functions are not reentrant.
|
53
|
+
* No other crash-handler functions should be called concurrently.
|
54
|
+
* # Atomicity
|
55
|
+
* This function is not atomic. A crash during its execution may lead to
|
56
|
+
* unexpected crash-handling behaviour.
|
57
|
+
*/
|
58
|
+
DDOG_CHECK_RETURN
|
59
|
+
struct ddog_prof_CrashtrackerResult ddog_prof_Crashtracker_update_on_fork(struct ddog_prof_CrashtrackerConfiguration config,
|
60
|
+
struct ddog_prof_CrashtrackerReceiverConfig receiver_config,
|
61
|
+
struct ddog_prof_CrashtrackerMetadata metadata);
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Receives data from a crash collector via a pipe on `stdin`, formats it into
|
65
|
+
* `CrashInfo` json, and emits it to the endpoint/file defined in `config`.
|
66
|
+
*
|
67
|
+
* At a high-level, this exists because doing anything in a
|
68
|
+
* signal handler is dangerous, so we fork a sidecar to do the stuff we aren't
|
69
|
+
* allowed to do in the handler.
|
70
|
+
*
|
71
|
+
* See comments in [profiling/crashtracker/mod.rs] for a full architecture
|
72
|
+
* description.
|
73
|
+
* # Safety
|
74
|
+
* No safety concerns
|
75
|
+
*/
|
76
|
+
DDOG_CHECK_RETURN
|
77
|
+
struct ddog_prof_CrashtrackerResult ddog_prof_Crashtracker_receiver_entry_point(void);
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Initialize the crash-tracking infrastructure.
|
81
|
+
*
|
82
|
+
* # Preconditions
|
83
|
+
* None.
|
84
|
+
* # Safety
|
85
|
+
* Crash-tracking functions are not reentrant.
|
86
|
+
* No other crash-handler functions should be called concurrently.
|
87
|
+
* # Atomicity
|
88
|
+
* This function is not atomic. A crash during its execution may lead to
|
89
|
+
* unexpected crash-handling behaviour.
|
90
|
+
*/
|
91
|
+
DDOG_CHECK_RETURN
|
92
|
+
struct ddog_prof_CrashtrackerResult ddog_prof_Crashtracker_init(struct ddog_prof_CrashtrackerConfiguration config,
|
93
|
+
struct ddog_prof_CrashtrackerReceiverConfig receiver_config,
|
94
|
+
struct ddog_prof_CrashtrackerMetadata metadata);
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Resets all counters to 0.
|
98
|
+
* Expected to be used after a fork, to reset the counters on the child
|
99
|
+
* ATOMICITY:
|
100
|
+
* This is NOT ATOMIC.
|
101
|
+
* Should only be used when no conflicting updates can occur,
|
102
|
+
* e.g. after a fork but before profiling ops start on the child.
|
103
|
+
* # Safety
|
104
|
+
* No safety concerns.
|
105
|
+
*/
|
106
|
+
DDOG_CHECK_RETURN struct ddog_prof_CrashtrackerResult ddog_prof_Crashtracker_reset_counters(void);
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Atomically increments the count associated with `op`.
|
110
|
+
* Useful for tracking what operations were occuring when a crash occurred.
|
111
|
+
*
|
112
|
+
* # Safety
|
113
|
+
* No safety concerns.
|
114
|
+
*/
|
115
|
+
DDOG_CHECK_RETURN
|
116
|
+
struct ddog_prof_CrashtrackerResult ddog_prof_Crashtracker_begin_profiling_op(enum ddog_prof_ProfilingOpTypes op);
|
117
|
+
|
118
|
+
/**
|
119
|
+
* Atomically decrements the count associated with `op`.
|
120
|
+
* Useful for tracking what operations were occuring when a crash occurred.
|
121
|
+
*
|
122
|
+
* # Safety
|
123
|
+
* No safety concerns.
|
124
|
+
*/
|
125
|
+
DDOG_CHECK_RETURN
|
126
|
+
struct ddog_prof_CrashtrackerResult ddog_prof_Crashtracker_end_profiling_op(enum ddog_prof_ProfilingOpTypes op);
|
127
|
+
|
128
|
+
/**
|
129
|
+
* Create a new crashinfo, and returns an opaque reference to it.
|
130
|
+
* # Safety
|
131
|
+
* No safety issues.
|
132
|
+
*/
|
133
|
+
DDOG_CHECK_RETURN struct ddog_prof_CrashInfoNewResult ddog_crashinfo_new(void);
|
134
|
+
|
135
|
+
/**
|
136
|
+
* # Safety
|
137
|
+
* The `crash_info` can be null, but if non-null it must point to a CrashInfo
|
138
|
+
* made by this module, which has not previously been dropped.
|
139
|
+
*/
|
140
|
+
void ddog_crashinfo_drop(struct ddog_prof_CrashInfo *crashinfo);
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Adds a "counter" variable, with the given value. Useful for determining if
|
144
|
+
* "interesting" operations were occurring when the crash did.
|
145
|
+
*
|
146
|
+
* # Safety
|
147
|
+
* `crashinfo` must be a valid pointer to a `CrashInfo` object.
|
148
|
+
* `name` should be a valid reference to a utf8 encoded String.
|
149
|
+
* The string is copied into the crashinfo, so it does not need to outlive this
|
150
|
+
* call.
|
151
|
+
*/
|
152
|
+
DDOG_CHECK_RETURN
|
153
|
+
struct ddog_prof_CrashtrackerResult ddog_crashinfo_add_counter(struct ddog_prof_CrashInfo *crashinfo,
|
154
|
+
ddog_CharSlice name,
|
155
|
+
int64_t val);
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Adds the contents of "file" to the crashinfo
|
159
|
+
*
|
160
|
+
* # Safety
|
161
|
+
* `crashinfo` must be a valid pointer to a `CrashInfo` object.
|
162
|
+
* `name` should be a valid reference to a utf8 encoded String.
|
163
|
+
* The string is copied into the crashinfo, so it does not need to outlive this
|
164
|
+
* call.
|
165
|
+
*/
|
14
166
|
DDOG_CHECK_RETURN
|
15
|
-
struct
|
167
|
+
struct ddog_prof_CrashtrackerResult ddog_crashinfo_add_file(struct ddog_prof_CrashInfo *crashinfo,
|
168
|
+
ddog_CharSlice name);
|
16
169
|
|
170
|
+
/**
|
171
|
+
* Adds the tag with given "key" and "value" to the crashinfo
|
172
|
+
*
|
173
|
+
* # Safety
|
174
|
+
* `crashinfo` must be a valid pointer to a `CrashInfo` object.
|
175
|
+
* `key` should be a valid reference to a utf8 encoded String.
|
176
|
+
* `value` should be a valid reference to a utf8 encoded String.
|
177
|
+
* The string is copied into the crashinfo, so it does not need to outlive this
|
178
|
+
* call.
|
179
|
+
*/
|
17
180
|
DDOG_CHECK_RETURN
|
18
|
-
struct
|
181
|
+
struct ddog_prof_CrashtrackerResult ddog_crashinfo_add_tag(struct ddog_prof_CrashInfo *crashinfo,
|
182
|
+
ddog_CharSlice key,
|
183
|
+
ddog_CharSlice value);
|
19
184
|
|
20
|
-
|
185
|
+
/**
|
186
|
+
* Sets the crashinfo metadata
|
187
|
+
*
|
188
|
+
* # Safety
|
189
|
+
* `crashinfo` must be a valid pointer to a `CrashInfo` object.
|
190
|
+
* All references inside `metadata` must be valid.
|
191
|
+
* Strings are copied into the crashinfo, and do not need to outlive this call.
|
192
|
+
*/
|
193
|
+
DDOG_CHECK_RETURN
|
194
|
+
struct ddog_prof_CrashtrackerResult ddog_crashinfo_set_metadata(struct ddog_prof_CrashInfo *crashinfo,
|
195
|
+
struct ddog_prof_CrashtrackerMetadata metadata);
|
21
196
|
|
197
|
+
/**
|
198
|
+
* Sets the crashinfo siginfo
|
199
|
+
*
|
200
|
+
* # Safety
|
201
|
+
* `crashinfo` must be a valid pointer to a `CrashInfo` object.
|
202
|
+
* All references inside `metadata` must be valid.
|
203
|
+
* Strings are copied into the crashinfo, and do not need to outlive this call.
|
204
|
+
*/
|
22
205
|
DDOG_CHECK_RETURN
|
23
|
-
struct
|
24
|
-
|
206
|
+
struct ddog_prof_CrashtrackerResult ddog_crashinfo_set_siginfo(struct ddog_prof_CrashInfo *crashinfo,
|
207
|
+
struct ddog_prof_SigInfo siginfo);
|
25
208
|
|
26
|
-
|
209
|
+
/**
|
210
|
+
* If `thread_id` is empty, sets `stacktrace` as the default stacktrace.
|
211
|
+
* Otherwise, adds an additional stacktrace with id "thread_id".
|
212
|
+
*
|
213
|
+
* # Safety
|
214
|
+
* `crashinfo` must be a valid pointer to a `CrashInfo` object.
|
215
|
+
* All references inside `stacktraces` must be valid.
|
216
|
+
* Strings are copied into the crashinfo, and do not need to outlive this call.
|
217
|
+
*/
|
218
|
+
DDOG_CHECK_RETURN
|
219
|
+
struct ddog_prof_CrashtrackerResult ddog_crashinfo_set_stacktrace(struct ddog_prof_CrashInfo *crashinfo,
|
220
|
+
ddog_CharSlice thread_id,
|
221
|
+
struct ddog_prof_Slice_StackFrame stacktrace);
|
27
222
|
|
223
|
+
/**
|
224
|
+
* Sets the timestamp to the given unix timestamp
|
225
|
+
*
|
226
|
+
* # Safety
|
227
|
+
* `crashinfo` must be a valid pointer to a `CrashInfo` object.
|
228
|
+
*/
|
229
|
+
DDOG_CHECK_RETURN
|
230
|
+
struct ddog_prof_CrashtrackerResult ddog_crashinfo_set_timestamp(struct ddog_prof_CrashInfo *crashinfo,
|
231
|
+
int64_t secs,
|
232
|
+
uint32_t nsecs);
|
233
|
+
|
234
|
+
/**
|
235
|
+
* Sets the timestamp to the current time
|
236
|
+
*
|
237
|
+
* # Safety
|
238
|
+
* `crashinfo` must be a valid pointer to a `CrashInfo` object.
|
239
|
+
*/
|
240
|
+
DDOG_CHECK_RETURN
|
241
|
+
struct ddog_prof_CrashtrackerResult ddog_crashinfo_set_timestamp_to_now(struct ddog_prof_CrashInfo *crashinfo);
|
242
|
+
|
243
|
+
/**
|
244
|
+
* Exports `crashinfo` to the backend at `endpoint`
|
245
|
+
* Note that we support the "file://" endpoint for local file output.
|
246
|
+
* # Safety
|
247
|
+
* `crashinfo` must be a valid pointer to a `CrashInfo` object.
|
248
|
+
*/
|
249
|
+
DDOG_CHECK_RETURN
|
250
|
+
struct ddog_prof_CrashtrackerResult ddog_crashinfo_upload_to_endpoint(struct ddog_prof_CrashInfo *crashinfo,
|
251
|
+
struct ddog_prof_CrashtrackerConfiguration config);
|
252
|
+
|
253
|
+
/**
|
254
|
+
* Demangles the string "name".
|
255
|
+
* If demangling fails, returns an empty string ""
|
256
|
+
*
|
257
|
+
* # Safety
|
258
|
+
* `name` should be a valid reference to a utf8 encoded String.
|
259
|
+
* The string is copied into the result, and does not need to outlive this call
|
260
|
+
*/
|
28
261
|
DDOG_CHECK_RETURN
|
29
|
-
struct
|
30
|
-
|
262
|
+
struct ddog_prof_StringWrapperResult ddog_demangle(ddog_CharSlice name,
|
263
|
+
enum ddog_prof_DemangleOptions options);
|
31
264
|
|
32
265
|
DDOG_CHECK_RETURN struct ddog_prof_Exporter_Slice_File ddog_prof_Exporter_Slice_File_empty(void);
|
33
266
|
|
@@ -36,7 +269,7 @@ DDOG_CHECK_RETURN struct ddog_prof_Exporter_Slice_File ddog_prof_Exporter_Slice_
|
|
36
269
|
* # Arguments
|
37
270
|
* * `base_url` - Contains a URL with scheme, host, and port e.g. "https://agent:8126/".
|
38
271
|
*/
|
39
|
-
struct
|
272
|
+
struct ddog_prof_Endpoint ddog_prof_Endpoint_agent(ddog_CharSlice base_url);
|
40
273
|
|
41
274
|
/**
|
42
275
|
* Creates an endpoint that uses the Datadog intake directly aka agentless.
|
@@ -44,18 +277,30 @@ struct ddog_Endpoint ddog_Endpoint_agent(ddog_CharSlice base_url);
|
|
44
277
|
* * `site` - Contains a host and port e.g. "datadoghq.com".
|
45
278
|
* * `api_key` - Contains the Datadog API key.
|
46
279
|
*/
|
47
|
-
struct
|
280
|
+
struct ddog_prof_Endpoint ddog_prof_Endpoint_agentless(ddog_CharSlice site, ddog_CharSlice api_key);
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Creates an endpoint that writes to a file.
|
284
|
+
* Useful for local debugging.
|
285
|
+
* Currently only supported by the crashtracker.
|
286
|
+
* # Arguments
|
287
|
+
* * `filename` - Path to the output file "/tmp/file.txt".
|
288
|
+
*/
|
289
|
+
struct ddog_prof_Endpoint ddog_Endpoint_file(ddog_CharSlice filename);
|
48
290
|
|
49
291
|
/**
|
50
292
|
* Creates a new exporter to be used to report profiling data.
|
51
293
|
* # Arguments
|
52
|
-
* * `profiling_library_name` - Profiling library name, usually dd-trace-something, e.g.
|
53
|
-
*
|
294
|
+
* * `profiling_library_name` - Profiling library name, usually dd-trace-something, e.g.
|
295
|
+
* "dd-trace-rb". See
|
296
|
+
* https://datadoghq.atlassian.net/wiki/spaces/PROF/pages/1538884229/Client#Header-values
|
297
|
+
* (Datadog internal link)
|
54
298
|
* for a list of common values.
|
55
|
-
* * `profliling_library_version` - Version used when publishing the profiling library to a package
|
299
|
+
* * `profliling_library_version` - Version used when publishing the profiling library to a package
|
300
|
+
* manager
|
56
301
|
* * `family` - Profile family, e.g. "ruby"
|
57
|
-
* * `tags` - Tags to include with every profile reported by this exporter. It's also possible to
|
58
|
-
* profile-specific tags, see `additional_tags` on `profile_exporter_build`.
|
302
|
+
* * `tags` - Tags to include with every profile reported by this exporter. It's also possible to
|
303
|
+
* include profile-specific tags, see `additional_tags` on `profile_exporter_build`.
|
59
304
|
* * `endpoint` - Configuration for reporting data
|
60
305
|
* # Safety
|
61
306
|
* All pointers must refer to valid objects of the correct types.
|
@@ -65,7 +310,7 @@ struct ddog_prof_Exporter_NewResult ddog_prof_Exporter_new(ddog_CharSlice profil
|
|
65
310
|
ddog_CharSlice profiling_library_version,
|
66
311
|
ddog_CharSlice family,
|
67
312
|
const struct ddog_Vec_Tag *tags,
|
68
|
-
struct
|
313
|
+
struct ddog_prof_Endpoint endpoint);
|
69
314
|
|
70
315
|
/**
|
71
316
|
* # Safety
|
@@ -81,8 +326,8 @@ void ddog_prof_Exporter_drop(struct ddog_prof_Exporter *exporter);
|
|
81
326
|
*
|
82
327
|
* For details on the `optional_internal_metadata_json`, please reference the Datadog-internal
|
83
328
|
* "RFC: Attaching internal metadata to pprof profiles".
|
84
|
-
* If you use this parameter, please update the RFC with your use-case, so we can keep track of how
|
85
|
-
* is getting used.
|
329
|
+
* If you use this parameter, please update the RFC with your use-case, so we can keep track of how
|
330
|
+
* this is getting used.
|
86
331
|
*
|
87
332
|
* For details on the `optional_info_json`, please reference the Datadog-internal
|
88
333
|
* "RFC: Pprof System Info Support".
|
@@ -118,9 +363,8 @@ void ddog_prof_Exporter_Request_drop(struct ddog_prof_Exporter_Request **request
|
|
118
363
|
*
|
119
364
|
* # Arguments
|
120
365
|
* * `exporter` - Borrows the exporter for sending the request.
|
121
|
-
* * `request` - Takes ownership of the request, replacing it with a null
|
122
|
-
*
|
123
|
-
* a single one.
|
366
|
+
* * `request` - Takes ownership of the request, replacing it with a null pointer. This is why it
|
367
|
+
* takes a double-pointer, rather than a single one.
|
124
368
|
* * `cancel` - Borrows the cancel, if any.
|
125
369
|
*
|
126
370
|
* # Safety
|
@@ -132,10 +376,10 @@ struct ddog_prof_Exporter_SendResult ddog_prof_Exporter_send(struct ddog_prof_Ex
|
|
132
376
|
const struct ddog_CancellationToken *cancel);
|
133
377
|
|
134
378
|
/**
|
135
|
-
* Can be passed as an argument to send and then be used to asynchronously cancel it from a
|
379
|
+
* Can be passed as an argument to send and then be used to asynchronously cancel it from a
|
380
|
+
* different thread.
|
136
381
|
*/
|
137
|
-
DDOG_CHECK_RETURN
|
138
|
-
struct ddog_CancellationToken *ddog_CancellationToken_new(void);
|
382
|
+
DDOG_CHECK_RETURN struct ddog_CancellationToken *ddog_CancellationToken_new(void);
|
139
383
|
|
140
384
|
/**
|
141
385
|
* A cloned CancellationToken is connected to the CancellationToken it was created from.
|
@@ -156,9 +400,9 @@ struct ddog_CancellationToken *ddog_CancellationToken_new(void);
|
|
156
400
|
* ddog_CancellationToken_drop(cancel_t2);
|
157
401
|
* ```
|
158
402
|
*
|
159
|
-
* Without clone, both t1 and t2 would need to synchronize to make sure neither was using the
|
160
|
-
* before it could be dropped. With clone, there is no need for such synchronization, both
|
161
|
-
* have their own cancel and should drop that cancel after they are done with it.
|
403
|
+
* Without clone, both t1 and t2 would need to synchronize to make sure neither was using the
|
404
|
+
* cancel before it could be dropped. With clone, there is no need for such synchronization, both
|
405
|
+
* threads have their own cancel and should drop that cancel after they are done with it.
|
162
406
|
*
|
163
407
|
* # Safety
|
164
408
|
* If the `token` is non-null, it must point to a valid object.
|
@@ -188,7 +432,7 @@ void ddog_CancellationToken_drop(struct ddog_CancellationToken *token);
|
|
188
432
|
* * `sample_types`
|
189
433
|
* * `period` - Optional period of the profile. Passing None/null translates to zero values.
|
190
434
|
* * `start_time` - Optional time the profile started at. Passing None/null will use the current
|
191
|
-
*
|
435
|
+
* time.
|
192
436
|
*
|
193
437
|
* # Safety
|
194
438
|
* All slices must be have pointers that are suitably aligned for their type
|
@@ -274,9 +518,12 @@ struct ddog_prof_Profile_Result ddog_prof_Profile_add_endpoint_count(struct ddog
|
|
274
518
|
* * `offset_values` - offset of the values
|
275
519
|
* * `label_name` - name of the label used to identify sample(s)
|
276
520
|
* * `label_value` - value of the label used to identify sample(s)
|
277
|
-
* * `sum_value_offset` - offset of the value used as a sum (compute the average with
|
278
|
-
*
|
279
|
-
* * `
|
521
|
+
* * `sum_value_offset` - offset of the value used as a sum (compute the average with
|
522
|
+
* `count_value_offset`)
|
523
|
+
* * `count_value_offset` - offset of the value used as a count (compute the average with
|
524
|
+
* `sum_value_offset`)
|
525
|
+
* * `sampling_distance` - this is the threshold for this sampling window. This value must not be
|
526
|
+
* equal to 0
|
280
527
|
*
|
281
528
|
* # Safety
|
282
529
|
* This function must be called before serialize and must not be called after.
|
@@ -302,8 +549,10 @@ struct ddog_prof_Profile_Result ddog_prof_Profile_add_upscaling_rule_poisson(str
|
|
302
549
|
* * `offset_values` - offset of the values
|
303
550
|
* * `label_name` - name of the label used to identify sample(s)
|
304
551
|
* * `label_value` - value of the label used to identify sample(s)
|
305
|
-
* * `total_sampled` - number of sampled event (found in the pprof). This value must not be equal
|
306
|
-
*
|
552
|
+
* * `total_sampled` - number of sampled event (found in the pprof). This value must not be equal
|
553
|
+
* to 0
|
554
|
+
* * `total_real` - number of events the profiler actually witnessed. This value must not be equal
|
555
|
+
* to 0
|
307
556
|
*
|
308
557
|
* # Safety
|
309
558
|
* This function must be called before serialize and must not be called after.
|
@@ -337,12 +586,12 @@ void ddog_prof_EncodedProfile_drop(struct ddog_prof_EncodedProfile *profile);
|
|
337
586
|
* # Arguments
|
338
587
|
* * `profile` - a reference to the profile being serialized.
|
339
588
|
* * `end_time` - optional end time of the profile. If None/null is passed, the current time will
|
340
|
-
*
|
589
|
+
* be used.
|
341
590
|
* * `duration_nanos` - Optional duration of the profile. Passing None or a negative duration will
|
342
|
-
*
|
343
|
-
*
|
344
|
-
*
|
345
|
-
*
|
591
|
+
* mean the duration will based on the end time minus the start time, but under anomalous
|
592
|
+
* conditions this may fail as system clocks can be adjusted, or the programmer accidentally
|
593
|
+
* passed an earlier time. The duration of the serialized profile will be set to zero for these
|
594
|
+
* cases.
|
346
595
|
* * `start_time` - Optional start time for the next profile.
|
347
596
|
*
|
348
597
|
* # Safety
|
@@ -376,4 +625,8 @@ DDOG_CHECK_RETURN
|
|
376
625
|
struct ddog_prof_Profile_Result ddog_prof_Profile_reset(struct ddog_prof_Profile *profile,
|
377
626
|
const struct ddog_Timespec *start_time);
|
378
627
|
|
628
|
+
#ifdef __cplusplus
|
629
|
+
} // extern "C"
|
630
|
+
#endif // __cplusplus
|
631
|
+
|
379
632
|
#endif /* DDOG_PROFILING_H */
|