libdatadog 1.0.1.1.0-aarch64-linux → 3.0.0.1.0-aarch64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/vendor/libdatadog-3.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE-3rdparty.yml +13495 -0
  4. data/vendor/{libdatadog-1.0.1/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-3.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/common.h +123 -52
  5. data/vendor/{libdatadog-1.0.1 → libdatadog-3.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/profiling.h +136 -35
  6. data/vendor/libdatadog-3.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  7. data/vendor/{libdatadog-1.0.1 → libdatadog-3.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  8. data/vendor/libdatadog-3.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE-3rdparty.yml +13495 -0
  9. data/vendor/{libdatadog-1.0.1/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-3.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/common.h +123 -52
  10. data/vendor/{libdatadog-1.0.1 → libdatadog-3.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/profiling.h +136 -35
  11. data/vendor/libdatadog-3.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  12. data/vendor/{libdatadog-1.0.1 → libdatadog-3.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  13. metadata +19 -19
  14. data/vendor/libdatadog-1.0.1/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE-3rdparty.yml +0 -1129
  15. data/vendor/libdatadog-1.0.1/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  16. data/vendor/libdatadog-1.0.1/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE-3rdparty.yml +0 -1129
  17. data/vendor/libdatadog-1.0.1/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  18. /data/vendor/{libdatadog-1.0.1 → libdatadog-3.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE +0 -0
  19. /data/vendor/{libdatadog-1.0.1 → libdatadog-3.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/NOTICE +0 -0
  20. /data/vendor/{libdatadog-1.0.1 → libdatadog-3.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE +0 -0
  21. /data/vendor/{libdatadog-1.0.1 → libdatadog-3.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/NOTICE +0 -0
@@ -46,21 +46,45 @@ typedef struct ddog_Tag ddog_Tag;
46
46
  * Holds the raw parts of a Rust Vec; it should only be created from Rust,
47
47
  * never from C.
48
48
  */
49
- typedef struct ddog_Vec_Tag {
50
- const struct ddog_Tag *ptr;
49
+ typedef struct ddog_Vec_U8 {
50
+ const uint8_t *ptr;
51
51
  uintptr_t len;
52
52
  uintptr_t capacity;
53
- } ddog_Vec_Tag;
53
+ } ddog_Vec_U8;
54
+
55
+ /**
56
+ * Please treat this as opaque; do not reach into it, and especially don't
57
+ * write into it! The most relevant APIs are:
58
+ * * `ddog_Error_message`, to get the message as a slice.
59
+ * * `ddog_Error_drop`.
60
+ */
61
+ typedef struct ddog_Error {
62
+ /**
63
+ * This is a String stuffed into the vec.
64
+ */
65
+ struct ddog_Vec_U8 message;
66
+ } ddog_Error;
67
+
68
+ /**
69
+ * Remember, the data inside of each member is potentially coming from FFI,
70
+ * so every operation on it is unsafe!
71
+ */
72
+ typedef struct ddog_Slice_CChar {
73
+ const char *ptr;
74
+ uintptr_t len;
75
+ } ddog_Slice_CChar;
76
+
77
+ typedef struct ddog_Slice_CChar ddog_CharSlice;
54
78
 
55
79
  /**
56
80
  * Holds the raw parts of a Rust Vec; it should only be created from Rust,
57
81
  * never from C.
58
82
  */
59
- typedef struct ddog_Vec_U8 {
60
- const uint8_t *ptr;
83
+ typedef struct ddog_Vec_Tag {
84
+ const struct ddog_Tag *ptr;
61
85
  uintptr_t len;
62
86
  uintptr_t capacity;
63
- } ddog_Vec_U8;
87
+ } ddog_Vec_Tag;
64
88
 
65
89
  typedef enum ddog_Vec_Tag_PushResult_Tag {
66
90
  DDOG_VEC_TAG_PUSH_RESULT_OK,
@@ -71,25 +95,14 @@ typedef struct ddog_Vec_Tag_PushResult {
71
95
  ddog_Vec_Tag_PushResult_Tag tag;
72
96
  union {
73
97
  struct {
74
- struct ddog_Vec_U8 err;
98
+ struct ddog_Error err;
75
99
  };
76
100
  };
77
101
  } ddog_Vec_Tag_PushResult;
78
102
 
79
- /**
80
- * Remember, the data inside of each member is potentially coming from FFI,
81
- * so every operation on it is unsafe!
82
- */
83
- typedef struct ddog_Slice_CChar {
84
- const char *ptr;
85
- uintptr_t len;
86
- } ddog_Slice_CChar;
87
-
88
- typedef struct ddog_Slice_CChar ddog_CharSlice;
89
-
90
103
  typedef struct ddog_Vec_Tag_ParseResult {
91
104
  struct ddog_Vec_Tag tags;
92
- struct ddog_Vec_U8 *error_message;
105
+ struct ddog_Error *error_message;
93
106
  } ddog_Vec_Tag_ParseResult;
94
107
 
95
108
  typedef struct ddog_CancellationToken ddog_CancellationToken;
@@ -100,21 +113,27 @@ typedef struct ddog_prof_Exporter ddog_prof_Exporter;
100
113
 
101
114
  typedef struct ddog_prof_ProfiledEndpointsStats ddog_prof_ProfiledEndpointsStats;
102
115
 
103
- /**
104
- * This type only exists to workaround a bug in cbindgen; may be removed in the
105
- * future.
106
- */
107
116
  typedef struct ddog_prof_Exporter_Request ddog_prof_Exporter_Request;
108
117
 
109
- /**
110
- * Holds the raw parts of a Rust Vec; it should only be created from Rust,
111
- * never from C.
112
- */
113
- typedef struct ddog_prof_Vec_U8 {
114
- const uint8_t *ptr;
115
- uintptr_t len;
116
- uintptr_t capacity;
117
- } ddog_prof_Vec_U8;
118
+ typedef enum ddog_Endpoint_Tag {
119
+ DDOG_ENDPOINT_AGENT,
120
+ DDOG_ENDPOINT_AGENTLESS,
121
+ } ddog_Endpoint_Tag;
122
+
123
+ typedef struct ddog_Endpoint_ddog_prof_Agentless_Body {
124
+ ddog_CharSlice _0;
125
+ ddog_CharSlice _1;
126
+ } ddog_Endpoint_ddog_prof_Agentless_Body;
127
+
128
+ typedef struct ddog_Endpoint {
129
+ ddog_Endpoint_Tag tag;
130
+ union {
131
+ struct {
132
+ ddog_CharSlice agent;
133
+ };
134
+ ddog_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
135
+ };
136
+ } ddog_Endpoint;
118
137
 
119
138
  typedef enum ddog_prof_Exporter_NewResult_Tag {
120
139
  DDOG_PROF_EXPORTER_NEW_RESULT_OK,
@@ -128,30 +147,27 @@ typedef struct ddog_prof_Exporter_NewResult {
128
147
  struct ddog_prof_Exporter *ok;
129
148
  };
130
149
  struct {
131
- struct ddog_prof_Vec_U8 err;
150
+ struct ddog_Error err;
132
151
  };
133
152
  };
134
153
  } ddog_prof_Exporter_NewResult;
135
154
 
136
- typedef enum ddog_Endpoint_Tag {
137
- DDOG_ENDPOINT_AGENT,
138
- DDOG_ENDPOINT_AGENTLESS,
139
- } ddog_Endpoint_Tag;
155
+ typedef enum ddog_prof_Exporter_Request_BuildResult_Tag {
156
+ DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_OK,
157
+ DDOG_PROF_EXPORTER_REQUEST_BUILD_RESULT_ERR,
158
+ } ddog_prof_Exporter_Request_BuildResult_Tag;
140
159
 
141
- typedef struct ddog_Endpoint_ddog_prof_Agentless_Body {
142
- ddog_CharSlice _0;
143
- ddog_CharSlice _1;
144
- } ddog_Endpoint_ddog_prof_Agentless_Body;
145
-
146
- typedef struct ddog_Endpoint {
147
- ddog_Endpoint_Tag tag;
160
+ typedef struct ddog_prof_Exporter_Request_BuildResult {
161
+ ddog_prof_Exporter_Request_BuildResult_Tag tag;
148
162
  union {
149
163
  struct {
150
- ddog_CharSlice agent;
164
+ struct ddog_prof_Exporter_Request *ok;
165
+ };
166
+ struct {
167
+ struct ddog_Error err;
151
168
  };
152
- ddog_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
153
169
  };
154
- } ddog_Endpoint;
170
+ } ddog_prof_Exporter_Request_BuildResult;
155
171
 
156
172
  /**
157
173
  * Represents time since the Unix Epoch in seconds plus nanoseconds.
@@ -205,7 +221,7 @@ typedef struct ddog_prof_Exporter_SendResult {
205
221
  struct ddog_HttpStatus http_response;
206
222
  };
207
223
  struct {
208
- struct ddog_prof_Vec_U8 err;
224
+ struct ddog_Error err;
209
225
  };
210
226
  };
211
227
  } ddog_prof_Exporter_SendResult;
@@ -229,6 +245,23 @@ typedef struct ddog_prof_Period {
229
245
  int64_t value;
230
246
  } ddog_prof_Period;
231
247
 
248
+ typedef enum ddog_prof_Profile_AddResult_Tag {
249
+ DDOG_PROF_PROFILE_ADD_RESULT_OK,
250
+ DDOG_PROF_PROFILE_ADD_RESULT_ERR,
251
+ } ddog_prof_Profile_AddResult_Tag;
252
+
253
+ typedef struct ddog_prof_Profile_AddResult {
254
+ ddog_prof_Profile_AddResult_Tag tag;
255
+ union {
256
+ struct {
257
+ uint64_t ok;
258
+ };
259
+ struct {
260
+ struct ddog_Error err;
261
+ };
262
+ };
263
+ } ddog_prof_Profile_AddResult;
264
+
232
265
  typedef struct ddog_prof_Mapping {
233
266
  /**
234
267
  * Address at which the binary (or DLL) is loaded into memory.
@@ -396,10 +429,36 @@ typedef struct ddog_prof_Sample {
396
429
  struct ddog_prof_Slice_Label labels;
397
430
  } ddog_prof_Sample;
398
431
 
432
+ typedef enum ddog_prof_Profile_UpscalingRuleAddResult_Tag {
433
+ DDOG_PROF_PROFILE_UPSCALING_RULE_ADD_RESULT_OK,
434
+ DDOG_PROF_PROFILE_UPSCALING_RULE_ADD_RESULT_ERR,
435
+ } ddog_prof_Profile_UpscalingRuleAddResult_Tag;
436
+
437
+ typedef struct ddog_prof_Profile_UpscalingRuleAddResult {
438
+ ddog_prof_Profile_UpscalingRuleAddResult_Tag tag;
439
+ union {
440
+ struct {
441
+ bool ok;
442
+ };
443
+ struct {
444
+ struct ddog_Error err;
445
+ };
446
+ };
447
+ } ddog_prof_Profile_UpscalingRuleAddResult;
448
+
449
+ /**
450
+ * Remember, the data inside of each member is potentially coming from FFI,
451
+ * so every operation on it is unsafe!
452
+ */
453
+ typedef struct ddog_prof_Slice_Usize {
454
+ const uintptr_t *ptr;
455
+ uintptr_t len;
456
+ } ddog_prof_Slice_Usize;
457
+
399
458
  typedef struct ddog_prof_EncodedProfile {
400
459
  struct ddog_Timespec start;
401
460
  struct ddog_Timespec end;
402
- struct ddog_prof_Vec_U8 buffer;
461
+ struct ddog_Vec_U8 buffer;
403
462
  struct ddog_prof_ProfiledEndpointsStats *endpoints_stats;
404
463
  } ddog_prof_EncodedProfile;
405
464
 
@@ -415,17 +474,29 @@ typedef struct ddog_prof_Profile_SerializeResult {
415
474
  struct ddog_prof_EncodedProfile ok;
416
475
  };
417
476
  struct {
418
- struct ddog_prof_Vec_U8 err;
477
+ struct ddog_Error err;
419
478
  };
420
479
  };
421
480
  } ddog_prof_Profile_SerializeResult;
422
481
 
482
+ /**
483
+ * # Safety
484
+ * Only pass null or a valid reference to a `ddog_Error`.
485
+ */
486
+ void ddog_Error_drop(struct ddog_Error *error);
487
+
488
+ /**
489
+ * Returns a CharSlice of the error's message that is valid until the error
490
+ * is dropped.
491
+ * # Safety
492
+ * Only pass null or a valid reference to a `ddog_Error`.
493
+ */
494
+ ddog_CharSlice ddog_Error_message(const struct ddog_Error *error);
495
+
423
496
  DDOG_CHECK_RETURN struct ddog_Vec_Tag ddog_Vec_Tag_new(void);
424
497
 
425
498
  void ddog_Vec_Tag_drop(struct ddog_Vec_Tag);
426
499
 
427
- void ddog_Vec_Tag_PushResult_drop(struct ddog_Vec_Tag_PushResult);
428
-
429
500
  /**
430
501
  * Creates a new Tag from the provided `key` and `value` by doing a utf8
431
502
  * lossy conversion, and pushes into the `vec`. The strings `key` and `value`
@@ -11,8 +11,6 @@
11
11
  #include <stdint.h>
12
12
  #include "common.h"
13
13
 
14
- void ddog_prof_Exporter_NewResult_drop(struct ddog_prof_Exporter_NewResult result);
15
-
16
14
  /**
17
15
  * Creates an endpoint that uses the agent.
18
16
  * # Arguments
@@ -39,6 +37,8 @@ struct ddog_Endpoint ddog_Endpoint_agentless(ddog_CharSlice site, ddog_CharSlice
39
37
  * * `tags` - Tags to include with every profile reported by this exporter. It's also possible to include
40
38
  * profile-specific tags, see `additional_tags` on `profile_exporter_build`.
41
39
  * * `endpoint` - Configuration for reporting data
40
+ * # Safety
41
+ * All pointers must refer to valid objects of the correct types.
42
42
  */
43
43
  DDOG_CHECK_RETURN
44
44
  struct ddog_prof_Exporter_NewResult ddog_prof_Exporter_new(ddog_CharSlice profiling_library_name,
@@ -47,41 +47,64 @@ struct ddog_prof_Exporter_NewResult ddog_prof_Exporter_new(ddog_CharSlice profil
47
47
  const struct ddog_Vec_Tag *tags,
48
48
  struct ddog_Endpoint endpoint);
49
49
 
50
+ /**
51
+ * # Safety
52
+ * The `exporter` may be null, but if non-null the pointer must point to a
53
+ * valid `ddog_prof_Exporter_Request` object made by the Rust Global
54
+ * allocator that has not already been dropped.
55
+ */
50
56
  void ddog_prof_Exporter_drop(struct ddog_prof_Exporter *exporter);
51
57
 
52
58
  /**
53
- * Builds a Request object based on the profile data supplied.
59
+ * If successful, builds a `ddog_prof_Exporter_Request` object based on the
60
+ * profile data supplied. If unsuccessful, it returns an error message.
61
+ *
62
+ * For details on the `optional_internal_metadata_json`, please reference the Datadog-internal
63
+ * "RFC: Attaching internal metadata to pprof profiles".
64
+ * If you use this parameter, please update the RFC with your use-case, so we can keep track of how this
65
+ * is getting used.
54
66
  *
55
67
  * # Safety
56
- * The `exporter` and the files inside of the `files` slice need to have been
57
- * created by this module.
68
+ * The `exporter`, `optional_additional_stats`, and `optional_endpoint_stats` args should be
69
+ * valid objects created by this module.
70
+ * NULL is allowed for `optional_additional_tags`, `optional_endpoints_stats` and
71
+ * `optional_internal_metadata_json`.
58
72
  */
59
73
  DDOG_CHECK_RETURN
60
- struct ddog_prof_Exporter_Request *ddog_prof_Exporter_Request_build(struct ddog_prof_Exporter *exporter,
61
- struct ddog_Timespec start,
62
- struct ddog_Timespec end,
63
- struct ddog_prof_Exporter_Slice_File files,
64
- const struct ddog_Vec_Tag *additional_tags,
65
- const struct ddog_prof_ProfiledEndpointsStats *endpoints_stats,
66
- uint64_t timeout_ms);
74
+ struct ddog_prof_Exporter_Request_BuildResult ddog_prof_Exporter_Request_build(struct ddog_prof_Exporter *exporter,
75
+ struct ddog_Timespec start,
76
+ struct ddog_Timespec end,
77
+ struct ddog_prof_Exporter_Slice_File files,
78
+ const struct ddog_Vec_Tag *optional_additional_tags,
79
+ const struct ddog_prof_ProfiledEndpointsStats *optional_endpoints_stats,
80
+ const ddog_CharSlice *optional_internal_metadata_json,
81
+ uint64_t timeout_ms);
82
+
83
+ /**
84
+ * # Safety
85
+ * Each pointer of `request` may be null, but if non-null the inner-most
86
+ * pointer must point to a valid `ddog_prof_Exporter_Request` object made by
87
+ * the Rust Global allocator.
88
+ */
89
+ void ddog_prof_Exporter_Request_drop(struct ddog_prof_Exporter_Request **request);
67
90
 
68
91
  /**
69
92
  * Sends the request, returning the HttpStatus.
70
93
  *
71
94
  * # Arguments
72
- * * `exporter` - borrows the exporter for sending the request
73
- * * `request` - takes ownership of the request
74
- * * `cancel` - borrows the cancel, if any
95
+ * * `exporter` - Borrows the exporter for sending the request.
96
+ * * `request` - Takes ownership of the request, replacing it with a null
97
+ * pointer. This is why it takes a double-pointer, rather than
98
+ * a single one.
99
+ * * `cancel` - Borrows the cancel, if any.
75
100
  *
76
101
  * # Safety
77
102
  * All non-null arguments MUST have been created by created by apis in this module.
78
103
  */
79
104
  DDOG_CHECK_RETURN
80
105
  struct ddog_prof_Exporter_SendResult ddog_prof_Exporter_send(struct ddog_prof_Exporter *exporter,
81
- struct ddog_prof_Exporter_Request *request,
82
- struct ddog_CancellationToken *cancel);
83
-
84
- void ddog_prof_Exporter_Request_drop(struct ddog_prof_Exporter_Request *_request);
106
+ struct ddog_prof_Exporter_Request **request,
107
+ const struct ddog_CancellationToken *cancel);
85
108
 
86
109
  /**
87
110
  * Can be passed as an argument to send and then be used to asynchronously cancel it from a different thread.
@@ -111,20 +134,26 @@ struct ddog_CancellationToken *ddog_CancellationToken_new(void);
111
134
  * Without clone, both t1 and t2 would need to synchronize to make sure neither was using the cancel
112
135
  * before it could be dropped. With clone, there is no need for such synchronization, both threads
113
136
  * have their own cancel and should drop that cancel after they are done with it.
137
+ *
138
+ * # Safety
139
+ * If the `token` is non-null, it must point to a valid object.
114
140
  */
115
141
  DDOG_CHECK_RETURN
116
- struct ddog_CancellationToken *ddog_CancellationToken_clone(struct ddog_CancellationToken *cancel);
142
+ struct ddog_CancellationToken *ddog_CancellationToken_clone(const struct ddog_CancellationToken *token);
117
143
 
118
144
  /**
119
145
  * Cancel send that is being called in another thread with the given token.
120
146
  * Note that cancellation is a terminal state; cancelling a token more than once does nothing.
121
147
  * Returns `true` if token was successfully cancelled.
122
148
  */
123
- bool ddog_CancellationToken_cancel(struct ddog_CancellationToken *cancel);
124
-
125
- void ddog_CancellationToken_drop(struct ddog_CancellationToken *_cancel);
149
+ bool ddog_CancellationToken_cancel(const struct ddog_CancellationToken *cancel);
126
150
 
127
- void ddog_prof_Exporter_SendResult_drop(struct ddog_prof_Exporter_SendResult result);
151
+ /**
152
+ * # Safety
153
+ * The `token` can be null, but non-null values must be created by the Rust
154
+ * Global allocator and must have not been dropped already.
155
+ */
156
+ void ddog_CancellationToken_drop(struct ddog_CancellationToken *token);
128
157
 
129
158
  /**
130
159
  * Create a new profile with the given sample types. Must call
@@ -147,19 +176,28 @@ struct ddog_prof_Profile *ddog_prof_Profile_new(struct ddog_prof_Slice_ValueType
147
176
 
148
177
  /**
149
178
  * # Safety
150
- * The `profile` must point to an object created by another FFI routine in this
151
- * module, such as `ddog_Profile_with_sample_types`.
179
+ * The `profile` can be null, but if non-null it must point to a valid object
180
+ * created by the Rust Global allocator.
152
181
  */
153
- void ddog_prof_Profile_drop(struct ddog_prof_Profile *_profile);
182
+ void ddog_prof_Profile_drop(struct ddog_prof_Profile *profile);
154
183
 
155
184
  /**
156
185
  * # Safety
157
186
  * The `profile` ptr must point to a valid Profile object created by this
158
187
  * module. All pointers inside the `sample` need to be valid for the duration
159
188
  * of this call.
189
+ *
190
+ * If successful, it returns the internal id of the sample (> 0) in the Ok
191
+ * variant. On error, it holds an error message in the error variant.
192
+ *
193
+ * # Safety
194
+ * The `profile` ptr must point to a valid Profile object created by this
195
+ * module.
160
196
  * This call is _NOT_ thread-safe.
161
197
  */
162
- uint64_t ddog_prof_Profile_add(struct ddog_prof_Profile *profile, struct ddog_prof_Sample sample);
198
+ DDOG_CHECK_RETURN
199
+ struct ddog_prof_Profile_AddResult ddog_prof_Profile_add(struct ddog_prof_Profile *profile,
200
+ struct ddog_prof_Sample sample);
163
201
 
164
202
  /**
165
203
  * Associate an endpoint to a given local root span id.
@@ -171,7 +209,7 @@ uint64_t ddog_prof_Profile_add(struct ddog_prof_Profile *profile, struct ddog_pr
171
209
  *
172
210
  * # Arguments
173
211
  * * `profile` - a reference to the profile that will contain the samples.
174
- * * `local_root_span_id` - the value of the local root span id label to look for.
212
+ * * `local_root_span_id`
175
213
  * * `endpoint` - the value of the endpoint label to add for matching samples.
176
214
  *
177
215
  * # Safety
@@ -180,7 +218,7 @@ uint64_t ddog_prof_Profile_add(struct ddog_prof_Profile *profile, struct ddog_pr
180
218
  * This call is _NOT_ thread-safe.
181
219
  */
182
220
  void ddog_prof_Profile_set_endpoint(struct ddog_prof_Profile *profile,
183
- ddog_CharSlice local_root_span_id,
221
+ uint64_t local_root_span_id,
184
222
  ddog_CharSlice endpoint);
185
223
 
186
224
  /**
@@ -200,8 +238,72 @@ void ddog_prof_Profile_add_endpoint_count(struct ddog_prof_Profile *profile,
200
238
  int64_t value);
201
239
 
202
240
  /**
203
- * Serialize the aggregated profile. Don't forget to clean up the result by
204
- * calling ddog_prof_Profile_SerializeResult_drop.
241
+ * Add a poisson-based upscaling rule which will be use to adjust values and make them
242
+ * closer to reality.
243
+ *
244
+ * # Arguments
245
+ * * `profile` - a reference to the profile that will contain the samples.
246
+ * * `offset_values` - offset of the values
247
+ * * `label_name` - name of the label used to identify sample(s)
248
+ * * `label_value` - value of the label used to identify sample(s)
249
+ * * `sum_value_offset` - offset of the value used as a sum (compute the average with `count_value_offset`)
250
+ * * `count_value_offset` - offset of the value used as a count (compute the average with `sum_value_offset`)
251
+ * * `sampling_distance` - this is the threshold for this sampling window. This value must not be equal to 0
252
+ *
253
+ * # Safety
254
+ * This function must be called before serialize and must not be called after.
255
+ * The `profile` ptr must point to a valid Profile object created by this
256
+ * module.
257
+ * This call is _NOT_ thread-safe.
258
+ */
259
+ DDOG_CHECK_RETURN
260
+ struct ddog_prof_Profile_UpscalingRuleAddResult ddog_prof_Profile_add_upscaling_rule_poisson(struct ddog_prof_Profile *profile,
261
+ struct ddog_prof_Slice_Usize offset_values,
262
+ ddog_CharSlice label_name,
263
+ ddog_CharSlice label_value,
264
+ uintptr_t sum_value_offset,
265
+ uintptr_t count_value_offset,
266
+ uint64_t sampling_distance);
267
+
268
+ /**
269
+ * Add a proportional-based upscaling rule which will be use to adjust values and make them
270
+ * closer to reality.
271
+ *
272
+ * # Arguments
273
+ * * `profile` - a reference to the profile that will contain the samples.
274
+ * * `offset_values` - offset of the values
275
+ * * `label_name` - name of the label used to identify sample(s)
276
+ * * `label_value` - value of the label used to identify sample(s)
277
+ * * `total_sampled` - number of sampled event (found in the pprof). This value must not be equal to 0
278
+ * * `total_real` - number of events the profiler actually witnessed. This value must not be equal to 0
279
+ *
280
+ * # Safety
281
+ * This function must be called before serialize and must not be called after.
282
+ * The `profile` ptr must point to a valid Profile object created by this
283
+ * module.
284
+ * This call is _NOT_ thread-safe.
285
+ */
286
+ DDOG_CHECK_RETURN
287
+ struct ddog_prof_Profile_UpscalingRuleAddResult ddog_prof_Profile_add_upscaling_rule_proportional(struct ddog_prof_Profile *profile,
288
+ struct ddog_prof_Slice_Usize offset_values,
289
+ ddog_CharSlice label_name,
290
+ ddog_CharSlice label_value,
291
+ uint64_t total_sampled,
292
+ uint64_t total_real);
293
+
294
+ /**
295
+ * # Safety
296
+ * Only pass a reference to a valid `ddog_prof_EncodedProfile`, or null. A
297
+ * valid reference also means that it hasn't already been dropped (do not
298
+ * call this twice on the same object).
299
+ */
300
+ void ddog_prof_EncodedProfile_drop(struct ddog_prof_EncodedProfile *profile);
301
+
302
+ /**
303
+ * Serialize the aggregated profile.
304
+ *
305
+ * Don't forget to clean up the ok with `ddog_prof_EncodedProfile_drop` or
306
+ * the error variant with `ddog_Error_drop` when you are done with them.
205
307
  *
206
308
  * # Arguments
207
309
  * * `profile` - a reference to the profile being serialized.
@@ -218,13 +320,12 @@ void ddog_prof_Profile_add_endpoint_count(struct ddog_prof_Profile *profile,
218
320
  * The `end_time` must be null or otherwise point to a valid TimeSpec object.
219
321
  * The `duration_nanos` must be null or otherwise point to a valid i64.
220
322
  */
323
+ DDOG_CHECK_RETURN
221
324
  struct ddog_prof_Profile_SerializeResult ddog_prof_Profile_serialize(const struct ddog_prof_Profile *profile,
222
325
  const struct ddog_Timespec *end_time,
223
326
  const int64_t *duration_nanos);
224
327
 
225
- void ddog_prof_Profile_SerializeResult_drop(struct ddog_prof_Profile_SerializeResult _result);
226
-
227
- DDOG_CHECK_RETURN struct ddog_Slice_U8 ddog_Vec_U8_as_slice(const struct ddog_prof_Vec_U8 *vec);
328
+ DDOG_CHECK_RETURN struct ddog_Slice_U8 ddog_Vec_U8_as_slice(const struct ddog_Vec_U8 *vec);
228
329
 
229
330
  /**
230
331
  * Resets all data in `profile` except the sample types and period. Returns
@@ -10,7 +10,7 @@ includedir=${prefix}/include
10
10
 
11
11
  Name: datadog_profiling
12
12
  Description: Contains common code used to implement Datadog's Continuous Profilers. (Dynamic linking variant, sets rpath)
13
- Version: 1.0.1
13
+ Version: 3.0.0
14
14
  Requires:
15
15
  Libs: -L${libdir} -ldatadog_profiling -Wl,-rpath,${libdir}
16
16
  Libs.private: