libdatadog 29.0.0.1.0 → 33.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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/tasks/build.rake +175 -0
  4. data/vendor/libdatadog-33.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE-3rdparty.csv +548 -0
  5. data/vendor/{libdatadog-29.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-33.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/common.h +109 -20
  6. data/vendor/{libdatadog-29.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-33.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/data-pipeline.h +32 -4
  7. data/vendor/{libdatadog-29.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-33.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/ffe.h +7 -3
  8. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/profiling.h +79 -6
  9. data/vendor/{libdatadog-29.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-33.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/telemetry.h +21 -0
  10. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  11. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  12. data/vendor/libdatadog-33.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE-3rdparty.csv +548 -0
  13. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  14. data/vendor/{libdatadog-29.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-33.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/common.h +109 -20
  15. data/vendor/{libdatadog-29.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-33.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/data-pipeline.h +32 -4
  16. data/vendor/{libdatadog-29.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-33.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/ffe.h +7 -3
  17. data/vendor/{libdatadog-29.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-33.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/profiling.h +79 -6
  18. data/vendor/{libdatadog-29.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin → libdatadog-33.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/telemetry.h +21 -0
  19. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  20. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  21. data/vendor/libdatadog-33.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin/LICENSE-3rdparty.csv +548 -0
  22. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/bin/libdatadog-crashtracking-receiver +0 -0
  23. data/vendor/{libdatadog-29.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-33.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/common.h +109 -20
  24. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/include/datadog/data-pipeline.h +32 -4
  25. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/include/datadog/ffe.h +7 -3
  26. data/vendor/{libdatadog-29.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-33.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/profiling.h +79 -6
  27. data/vendor/{libdatadog-29.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-33.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin}/include/datadog/telemetry.h +21 -0
  28. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/lib/libdatadog_profiling.dylib +0 -0
  29. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  30. data/vendor/libdatadog-33.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.csv +548 -0
  31. data/vendor/libdatadog-33.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/common.h +2875 -0
  32. data/vendor/libdatadog-33.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/data-pipeline.h +216 -0
  33. data/vendor/libdatadog-33.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/ffe.h +179 -0
  34. data/vendor/libdatadog-33.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/profiling.h +1130 -0
  35. data/vendor/libdatadog-33.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/telemetry.h +307 -0
  36. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  37. data/vendor/libdatadog-33.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +15 -0
  38. data/vendor/libdatadog-33.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.csv +548 -0
  39. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  40. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/common.h +109 -20
  41. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/data-pipeline.h +32 -4
  42. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/ffe.h +7 -3
  43. data/vendor/{libdatadog-29.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-33.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/profiling.h +79 -6
  44. data/vendor/{libdatadog-29.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-33.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/telemetry.h +21 -0
  45. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  46. data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  47. metadata +83 -82
  48. data/vendor/libdatadog-29.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE-3rdparty.yml +0 -55788
  49. data/vendor/libdatadog-29.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE-3rdparty.yml +0 -55788
  50. data/vendor/libdatadog-29.0.0/arm64-darwin/libdatadog-aarch64-apple-darwin/LICENSE-3rdparty.yml +0 -55788
  51. data/vendor/libdatadog-29.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +0 -55788
  52. data/vendor/libdatadog-29.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/common.h +0 -2786
  53. data/vendor/libdatadog-29.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/data-pipeline.h +0 -188
  54. data/vendor/libdatadog-29.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/ffe.h +0 -175
  55. data/vendor/libdatadog-29.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/profiling.h +0 -1057
  56. data/vendor/libdatadog-29.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/telemetry.h +0 -286
  57. data/vendor/libdatadog-29.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +0 -15
  58. data/vendor/libdatadog-29.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +0 -55788
  59. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE +0 -0
  60. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/NOTICE +0 -0
  61. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
  62. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/blazesym.h +0 -0
  63. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/crashtracker.h +0 -0
  64. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/ddsketch.h +0 -0
  65. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/library-config.h +0 -0
  66. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/log.h +0 -0
  67. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE +0 -0
  68. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/NOTICE +0 -0
  69. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/blazesym.h +0 -0
  70. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/crashtracker.h +0 -0
  71. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/ddsketch.h +0 -0
  72. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/library-config.h +0 -0
  73. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/log.h +0 -0
  74. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/LICENSE +0 -0
  75. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/NOTICE +0 -0
  76. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/include/datadog/blazesym.h +0 -0
  77. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/include/datadog/crashtracker.h +0 -0
  78. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/include/datadog/ddsketch.h +0 -0
  79. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/include/datadog/library-config.h +0 -0
  80. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/arm64-darwin/libdatadog-aarch64-apple-darwin/include/datadog/log.h +0 -0
  81. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE +0 -0
  82. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/NOTICE +0 -0
  83. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
  84. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/blazesym.h +0 -0
  85. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/crashtracker.h +0 -0
  86. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/ddsketch.h +0 -0
  87. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/library-config.h +0 -0
  88. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/log.h +0 -0
  89. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE +0 -0
  90. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/NOTICE +0 -0
  91. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/blazesym.h +0 -0
  92. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/crashtracker.h +0 -0
  93. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/ddsketch.h +0 -0
  94. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/library-config.h +0 -0
  95. /data/vendor/{libdatadog-29.0.0 → libdatadog-33.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/log.h +0 -0
@@ -1,1057 +0,0 @@
1
- // Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
-
5
- #ifndef DDOG_PROFILING_H
6
- #define DDOG_PROFILING_H
7
-
8
- #pragma once
9
-
10
- #include <stdbool.h>
11
- #include <stddef.h>
12
- #include <stdint.h>
13
- // Forward declarations for types used in common.h to avoid circular dependencies
14
- #include "common.h"
15
- struct TokioCancellationToken;
16
-
17
-
18
- #ifdef __cplusplus
19
- extern "C" {
20
- #endif // __cplusplus
21
-
22
- extern const ddog_prof_StringId ddog_INTERNED_EMPTY_STRING;
23
-
24
- /**
25
- * A StringId that represents the empty string.
26
- * This is always available in every string set and can be used without
27
- * needing to insert it into a string set.
28
- */
29
- extern const ddog_prof_StringId2 DDOG_PROF_STRINGID2_EMPTY;
30
-
31
- /**
32
- * A StringId that represents the string "end_timestamp_ns".
33
- * This is always available in every string set and can be used without
34
- * needing to insert it into a string set.
35
- */
36
- extern const ddog_prof_StringId2 DDOG_PROF_STRINGID2_END_TIMESTAMP_NS;
37
-
38
- /**
39
- * A StringId that represents the string "local root span id".
40
- * This is always available in every string set and can be used without
41
- * needing to insert it into a string set.
42
- */
43
- extern const ddog_prof_StringId2 DDOG_PROF_STRINGID2_LOCAL_ROOT_SPAN_ID;
44
-
45
- /**
46
- * A StringId that represents the string "trace endpoint".
47
- * This is always available in every string set and can be used without
48
- * needing to insert it into a string set.
49
- */
50
- extern const ddog_prof_StringId2 DDOG_PROF_STRINGID2_TRACE_ENDPOINT;
51
-
52
- /**
53
- * A StringId that represents the string "span id".
54
- * This is always available in every string set and can be used without
55
- * needing to insert it into a string set.
56
- */
57
- extern const ddog_prof_StringId2 DDOG_PROF_STRINGID2_SPAN_ID;
58
-
59
- DDOG_CHECK_RETURN struct ddog_prof_Exporter_Slice_File ddog_prof_Exporter_Slice_File_empty(void);
60
-
61
- /**
62
- * Creates an endpoint that uses the agent.
63
- * # Arguments
64
- * * `base_url` - Contains a URL with scheme, host, and port e.g. "https://agent:8126/".
65
- * * `timeout_ms` - Timeout in milliseconds. Use 0 for default timeout (3000ms).
66
- * * `use_system_resolver` - If true, use the system DNS resolver (less fork-safe). If false, the
67
- * default in-process resolver is used (fork-safe).
68
- */
69
- struct ddog_prof_Endpoint ddog_prof_Endpoint_agent(ddog_CharSlice base_url,
70
- uint64_t timeout_ms,
71
- bool use_system_resolver);
72
-
73
- /**
74
- * Creates an endpoint that uses the Datadog intake directly aka agentless.
75
- * # Arguments
76
- * * `site` - Contains a host and port e.g. "datadoghq.com".
77
- * * `api_key` - Contains the Datadog API key.
78
- * * `timeout_ms` - Timeout in milliseconds. Use 0 for default timeout (3000ms).
79
- * * `use_system_resolver` - If true, use the system DNS resolver (less fork-safe). If false, the
80
- * default in-process resolver is used (fork-safe).
81
- */
82
- struct ddog_prof_Endpoint ddog_prof_Endpoint_agentless(ddog_CharSlice site,
83
- ddog_CharSlice api_key,
84
- uint64_t timeout_ms,
85
- bool use_system_resolver);
86
-
87
- /**
88
- * Creates an endpoint that writes to a file.
89
- * Useful for local debugging.
90
- * Currently only supported by the crashtracker.
91
- * # Arguments
92
- * * `filename` - Path to the output file "/tmp/file.txt".
93
- */
94
- struct ddog_prof_Endpoint ddog_Endpoint_file(ddog_CharSlice filename);
95
-
96
- /**
97
- * Creates a new exporter to be used to report profiling data.
98
- * # Arguments
99
- * * `profiling_library_name` - Profiling library name, usually dd-trace-something, e.g.
100
- * "dd-trace-rb". See
101
- * https://datadoghq.atlassian.net/wiki/spaces/PROF/pages/1538884229/Client#Header-values
102
- * (Datadog internal link)
103
- * for a list of common values.
104
- * * `profliling_library_version` - Version used when publishing the profiling library to a package
105
- * manager
106
- * * `family` - Profile family, e.g. "ruby"
107
- * * `tags` - Tags to include with every profile reported by this exporter. It's also possible to
108
- * include profile-specific tags, see `additional_tags` on `profile_exporter_build`.
109
- * * `endpoint` - Configuration for reporting data (includes use_system_resolver for
110
- * Agent/Agentless).
111
- * # Safety
112
- * All pointers must refer to valid objects of the correct types.
113
- */
114
- DDOG_CHECK_RETURN
115
- struct ddog_prof_ProfileExporter_Result ddog_prof_Exporter_new(ddog_CharSlice profiling_library_name,
116
- ddog_CharSlice profiling_library_version,
117
- ddog_CharSlice family,
118
- const struct ddog_Vec_Tag *tags,
119
- struct ddog_prof_Endpoint endpoint);
120
-
121
- /**
122
- * # Safety
123
- * The `exporter` may be null, but if non-null the pointer must point to a
124
- * valid `ddog_prof_Exporter_Request` object made by the Rust Global
125
- * allocator that has not already been dropped.
126
- */
127
- void ddog_prof_Exporter_drop(struct ddog_prof_ProfileExporter *exporter);
128
-
129
- /**
130
- * Builds a request and sends it, returning the HttpStatus.
131
- *
132
- * # Arguments
133
- * * `exporter` - Borrows the exporter.
134
- * * `profile` - Takes ownership of the profile.
135
- * * `files_to_compress_and_export` - Files to compress and attach to the profile.
136
- * * `optional_additional_tags` - Additional tags to include with this profile.
137
- * * `optional_process_tags` - Process-level tags as a comma-separated string.
138
- * * `optional_internal_metadata_json` - Internal metadata as a JSON string.
139
- * * `optional_info_json` - System info as a JSON string.
140
- * * `cancel` - Optional cancellation token.
141
- *
142
- * # Safety
143
- * All non-null arguments MUST have been created by APIs in this module.
144
- */
145
- DDOG_CHECK_RETURN
146
- struct ddog_prof_Result_HttpStatus ddog_prof_Exporter_send_blocking(struct ddog_prof_ProfileExporter *exporter,
147
- struct ddog_prof_EncodedProfile *profile,
148
- struct ddog_prof_Exporter_Slice_File files_to_compress_and_export,
149
- const struct ddog_Vec_Tag *optional_additional_tags,
150
- const ddog_CharSlice *optional_process_tags,
151
- const ddog_CharSlice *optional_internal_metadata_json,
152
- const ddog_CharSlice *optional_info_json,
153
- struct ddog_CancellationToken *cancel);
154
-
155
- /**
156
- * Can be passed as an argument to send and then be used to asynchronously cancel it from a
157
- * different thread.
158
- */
159
- DDOG_CHECK_RETURN struct ddog_CancellationToken ddog_CancellationToken_new(void);
160
-
161
- /**
162
- * A cloned TokioCancellationToken is connected to the TokioCancellationToken it was created from.
163
- * Either the cloned or the original token can be used to cancel or provided as arguments to send.
164
- * The useful part is that they have independent lifetimes and can be dropped separately.
165
- *
166
- * Thus, it's possible to do something like:
167
- * ```c
168
- * cancel_t1 = ddog_CancellationToken_new();
169
- * cancel_t2 = ddog_CancellationToken_clone(cancel_t1);
170
- *
171
- * // On thread t1:
172
- * ddog_prof_Exporter_send(..., cancel_t1);
173
- * ddog_CancellationToken_drop(cancel_t1);
174
- *
175
- * // On thread t2:
176
- * ddog_CancellationToken_cancel(cancel_t2);
177
- * ddog_CancellationToken_drop(cancel_t2);
178
- * ```
179
- *
180
- * Without clone, both t1 and t2 would need to synchronize to make sure neither was using the
181
- * cancel before it could be dropped. With clone, there is no need for such synchronization, both
182
- * threads have their own cancel and should drop that cancel after they are done with it.
183
- *
184
- * # Safety
185
- * If the `token` is non-null, it must point to a valid object.
186
- */
187
- DDOG_CHECK_RETURN
188
- struct ddog_CancellationToken ddog_CancellationToken_clone(struct ddog_CancellationToken *token);
189
-
190
- /**
191
- * Cancel send that is being called in another thread with the given token.
192
- * Note that cancellation is a terminal state; cancelling a token more than once does nothing.
193
- * Returns `true` if token was successfully cancelled.
194
- */
195
- bool ddog_CancellationToken_cancel(struct ddog_CancellationToken *cancel);
196
-
197
- /**
198
- * # Safety
199
- * The `token` can be null, but non-null values must be created by the Rust
200
- * Global allocator and must have not been dropped already.
201
- */
202
- void ddog_CancellationToken_drop(struct ddog_CancellationToken *token);
203
-
204
- /**
205
- * Creates a new ExporterManager with a background worker thread.
206
- *
207
- * The ExporterManager provides asynchronous profle export capabilities through a
208
- * background worker thread and bounded channel.
209
- *
210
- * # Arguments
211
- * * `exporter` - Takes ownership of the ProfileExporter to use for sending profiles.
212
- *
213
- * # Safety
214
- * The `exporter` must point to a valid ProfileExporter that has not been dropped.
215
- */
216
- DDOG_CHECK_RETURN
217
- struct ddog_prof_Result_HandleExporterManager ddog_prof_ExporterManager_new(struct ddog_prof_ProfileExporter *exporter);
218
-
219
- /**
220
- * Queues a profile to be sent asynchronously by the background worker thread.
221
- *
222
- * **Important**: This function resets the profile and queues the *previous* profile data.
223
- * After calling this, the profile will be empty and ready for new samples.
224
- *
225
- * # Arguments
226
- * * `manager` - Borrows the ExporterManager.
227
- * * `profile` - Takes ownership of the profile to send.
228
- * * `files_to_compress_and_export` - Files to compress and attach to the profile.
229
- * * `optional_additional_tags` - Additional tags to include with this profile.
230
- * * `optional_process_tags` - Process-level tags as a comma-separated string.
231
- * * `optional_internal_metadata_json` - Internal metadata as a JSON string.
232
- * * `optional_info_json` - System info as a JSON string.
233
- *
234
- * # Safety
235
- * All non-null arguments MUST have been created by APIs in this module.
236
- */
237
- DDOG_CHECK_RETURN
238
- struct ddog_VoidResult ddog_prof_ExporterManager_queue(struct ddog_prof_Handle_ExporterManager *manager,
239
- struct ddog_prof_EncodedProfile *profile,
240
- struct ddog_prof_Exporter_Slice_File files_to_compress_and_export,
241
- const struct ddog_Vec_Tag *optional_additional_tags,
242
- const ddog_CharSlice *optional_process_tags,
243
- const ddog_CharSlice *optional_internal_metadata_json,
244
- const ddog_CharSlice *optional_info_json);
245
-
246
- /**
247
- * Aborts the manager, stopping the worker thread and returning inflight requests.
248
- *
249
- * **Note**: This consumes the manager - it cannot be used after calling abort.
250
- *
251
- * # Arguments
252
- * * `manager` - Takes ownership of the ExporterManager.
253
- *
254
- * # Safety
255
- * The `manager` must point to a valid ExporterManager that has not been dropped.
256
- */
257
- DDOG_CHECK_RETURN
258
- struct ddog_VoidResult ddog_prof_ExporterManager_abort(struct ddog_prof_Handle_ExporterManager *manager);
259
-
260
- /**
261
- * Suspends the manager before forking (prefork).
262
- *
263
- * **Note**: This consumes the manager - it cannot be used after calling prefork.
264
- *
265
- * # Arguments
266
- * * `manager` - Takes ownership of the ExporterManager.
267
- *
268
- * # Safety
269
- * The `manager` must point to a valid ExporterManager that has not been dropped.
270
- */
271
- DDOG_CHECK_RETURN
272
- struct ddog_VoidResult ddog_prof_ExporterManager_prefork(struct ddog_prof_Handle_ExporterManager *manager);
273
-
274
- /**
275
- * Creates a new manager in the child process after forking (postfork_child).
276
- *
277
- * Inflight requests from the parent are discarded in the child.
278
- *
279
- * # Arguments
280
- * * `suspended` - Takes ownership of the suspended ExporterManager.
281
- *
282
- * # Safety
283
- * The `suspended` must point to a valid suspended ExporterManager that has not been dropped.
284
- */
285
- DDOG_CHECK_RETURN
286
- struct ddog_VoidResult ddog_prof_ExporterManager_postfork_child(struct ddog_prof_Handle_ExporterManager *suspended);
287
-
288
- /**
289
- * Creates a new manager in the parent process after forking (postfork_parent).
290
- *
291
- * Inflight requests from before the fork are re-queued in the new manager.
292
- *
293
- * # Arguments
294
- * * `suspended` - Takes ownership of the suspended ExporterManager.
295
- *
296
- * # Safety
297
- * The `suspended` must point to a valid suspended ExporterManager that has not been dropped.
298
- */
299
- DDOG_CHECK_RETURN
300
- struct ddog_VoidResult ddog_prof_ExporterManager_postfork_parent(struct ddog_prof_Handle_ExporterManager *suspended);
301
-
302
- /**
303
- * # Safety
304
- * The `manager` may be null, but if non-null the pointer must point to a
305
- * valid `ExporterManager` object made by the Rust Global allocator that
306
- * has not already been dropped.
307
- */
308
- void ddog_prof_ExporterManager_drop(struct ddog_prof_Handle_ExporterManager *manager);
309
-
310
- /**
311
- * Frees any error associated with the status, and replaces it with an OK.
312
- *
313
- * # Safety
314
- *
315
- * The pointer should point at a valid Status object, if it's not null.
316
- */
317
- void ddog_prof_Status_drop(struct ddog_prof_Status *status);
318
-
319
- /**
320
- * Create a new profile with the given sample types. Must call
321
- * `ddog_prof_Profile_drop` when you are done with the profile.
322
- *
323
- * # Arguments
324
- * * `sample_types` - A slice of SampleType enums
325
- * * `period` - Optional period of the profile. Passing None/null translates to zero values.
326
- * * `start_time` - Optional time the profile started at. Passing None/null will use the current
327
- * time.
328
- *
329
- * # Safety
330
- * All slices must be have pointers that are suitably aligned for their type
331
- * and must have the correct number of elements for the slice.
332
- */
333
- DDOG_CHECK_RETURN
334
- struct ddog_prof_Profile_NewResult ddog_prof_Profile_new(struct ddog_prof_Slice_SampleType sample_types,
335
- const struct ddog_prof_Period *period);
336
-
337
- /**
338
- * Create a new profile with the given sample types. Must call
339
- * `ddog_prof_Profile_drop` when you are done with the profile.
340
- *
341
- * # Arguments
342
- * * `out` - a non-null pointer to an uninitialized Profile.
343
- * * `dict`: a valid reference to a ProfilesDictionary handle.
344
- * * `sample_types` - A slice of SampleType enums
345
- * * `period` - Optional period of the profile. Passing None/null translates to zero values.
346
- *
347
- * # Safety
348
- * All slices must have pointers that are suitably aligned for their type
349
- * and must have the correct number of elements for the slice.
350
- *
351
- * The `dict` reference must be to a valid ProfilesDictionary handle. It may
352
- * be an empty handle, but it must be a valid handle.
353
- *
354
- * The `out` pointer must be non-null and suitable for pointer writes,
355
- * including that it has the correct size and alignment.
356
- */
357
- DDOG_CHECK_RETURN
358
- struct ddog_prof_Status ddog_prof_Profile_with_dictionary(struct ddog_prof_Profile *out,
359
- const ddog_prof_ProfilesDictionaryHandle *dict,
360
- struct ddog_prof_Slice_SampleType sample_types,
361
- const struct ddog_prof_Period *period);
362
-
363
- /**
364
- * Same as `ddog_profile_new` but also configures a `string_storage` for the profile.
365
- * TODO: @ivoanjo Should this take a `*mut ManagedStringStorage` like Profile APIs do?
366
- */
367
- DDOG_CHECK_RETURN
368
- struct ddog_prof_Profile_NewResult ddog_prof_Profile_with_string_storage(struct ddog_prof_Slice_SampleType sample_types,
369
- const struct ddog_prof_Period *period,
370
- struct ddog_prof_ManagedStringStorage string_storage);
371
-
372
- /**
373
- * # Safety
374
- * The `profile` can be null, but if non-null it must point to a Profile
375
- * made by this module, which has not previously been dropped.
376
- */
377
- void ddog_prof_Profile_drop(struct ddog_prof_Profile *profile);
378
-
379
- /**
380
- * # Safety
381
- * The `profile` ptr must point to a valid Profile object created by this
382
- * module. All pointers inside the `sample` need to be valid for the duration
383
- * of this call.
384
- *
385
- * If successful, it returns the Ok variant.
386
- * On error, it holds an error message in the error variant.
387
- *
388
- * # Safety
389
- * The `profile` ptr must point to a valid Profile object created by this
390
- * module.
391
- * This call is _NOT_ thread-safe.
392
- */
393
- DDOG_CHECK_RETURN
394
- struct ddog_prof_Profile_Result ddog_prof_Profile_add(struct ddog_prof_Profile *profile,
395
- struct ddog_prof_Sample sample,
396
- int64_t timestamp);
397
-
398
- /**
399
- * # Safety
400
- * The `profile` ptr must point to a valid Profile object created by this
401
- * module. All pointers inside the `sample` need to be valid for the duration
402
- * of this call.
403
- *
404
- * If successful, it returns the Ok variant.
405
- * On error, it holds an error message in the error variant.
406
- *
407
- * This call is _NOT_ thread-safe.
408
- */
409
- DDOG_CHECK_RETURN
410
- struct ddog_prof_Status ddog_prof_Profile_add2(struct ddog_prof_Profile *profile,
411
- struct ddog_prof_Sample2 sample,
412
- int64_t timestamp);
413
-
414
- /**
415
- * Associate an endpoint to a given local root span id.
416
- * During the serialization of the profile, an endpoint label will be added
417
- * to all samples that contain a matching local root span id label.
418
- *
419
- * Note: calling this API causes the "trace endpoint" and "local root span id" strings
420
- * to be interned, even if no matching sample is found.
421
- *
422
- * # Arguments
423
- * * `profile` - a reference to the profile that will contain the samples.
424
- * * `local_root_span_id`
425
- * * `endpoint` - the value of the endpoint label to add for matching samples.
426
- *
427
- * # Safety
428
- * The `profile` ptr must point to a valid Profile object created by this
429
- * module.
430
- * This call is _NOT_ thread-safe.
431
- */
432
- DDOG_CHECK_RETURN
433
- struct ddog_prof_Profile_Result ddog_prof_Profile_set_endpoint(struct ddog_prof_Profile *profile,
434
- uint64_t local_root_span_id,
435
- ddog_CharSlice endpoint);
436
-
437
- /**
438
- * Count the number of times an endpoint has been seen.
439
- *
440
- * # Arguments
441
- * * `profile` - a reference to the profile that will contain the samples.
442
- * * `endpoint` - the endpoint label for which the count will be incremented
443
- *
444
- * # Safety
445
- * The `profile` ptr must point to a valid Profile object created by this
446
- * module.
447
- * This call is _NOT_ thread-safe.
448
- */
449
- DDOG_CHECK_RETURN
450
- struct ddog_prof_Profile_Result ddog_prof_Profile_add_endpoint_count(struct ddog_prof_Profile *profile,
451
- ddog_CharSlice endpoint,
452
- int64_t value);
453
-
454
- /**
455
- * Add a poisson-based upscaling rule which will be use to adjust values and make them
456
- * closer to reality.
457
- *
458
- * # Arguments
459
- * * `profile` - a reference to the profile that will contain the samples.
460
- * * `offset_values` - offset of the values
461
- * * `label_name` - name of the label used to identify sample(s)
462
- * * `label_value` - value of the label used to identify sample(s)
463
- * * `sum_value_offset` - offset of the value used as a sum (compute the average with
464
- * `count_value_offset`)
465
- * * `count_value_offset` - offset of the value used as a count (compute the average with
466
- * `sum_value_offset`)
467
- * * `sampling_distance` - this is the threshold for this sampling window. This value must not be
468
- * equal to 0
469
- *
470
- * # Safety
471
- * This function must be called before serialize and must not be called after.
472
- * The `profile` ptr must point to a valid Profile object created by this
473
- * module.
474
- * This call is _NOT_ thread-safe.
475
- */
476
- DDOG_CHECK_RETURN
477
- struct ddog_prof_Profile_Result ddog_prof_Profile_add_upscaling_rule_poisson(struct ddog_prof_Profile *profile,
478
- struct ddog_prof_Slice_Usize offset_values,
479
- ddog_CharSlice label_name,
480
- ddog_CharSlice label_value,
481
- uintptr_t sum_value_offset,
482
- uintptr_t count_value_offset,
483
- uint64_t sampling_distance);
484
-
485
- /**
486
- * Add a proportional-based upscaling rule which will be use to adjust values and make them
487
- * closer to reality.
488
- *
489
- * # Arguments
490
- * * `profile` - a reference to the profile that will contain the samples.
491
- * * `offset_values` - offset of the values
492
- * * `label_name` - name of the label used to identify sample(s)
493
- * * `label_value` - value of the label used to identify sample(s)
494
- * * `total_sampled` - number of sampled event (found in the pprof). This value must not be equal
495
- * to 0
496
- * * `total_real` - number of events the profiler actually witnessed. This value must not be equal
497
- * to 0
498
- *
499
- * # Safety
500
- * This function must be called before serialize and must not be called after.
501
- * The `profile` ptr must point to a valid Profile object created by this
502
- * module.
503
- * This call is _NOT_ thread-safe.
504
- */
505
- DDOG_CHECK_RETURN
506
- struct ddog_prof_Profile_Result ddog_prof_Profile_add_upscaling_rule_proportional(struct ddog_prof_Profile *profile,
507
- struct ddog_prof_Slice_Usize offset_values,
508
- ddog_CharSlice label_name,
509
- ddog_CharSlice label_value,
510
- uint64_t total_sampled,
511
- uint64_t total_real);
512
-
513
- /**
514
- * # Safety
515
- * Only pass a reference to a valid `ddog_prof_EncodedProfile`, or null. A
516
- * valid reference also means that it hasn't already been dropped or exported (do not
517
- * call this twice on the same object).
518
- */
519
- void ddog_prof_EncodedProfile_drop(struct ddog_prof_EncodedProfile *profile);
520
-
521
- /**
522
- * Given an EncodedProfile, get a slice representing the bytes in the pprof.
523
- * This slice is valid for use until the encoded_profile is modified in any way (e.g. dropped or
524
- * consumed).
525
- * # Safety
526
- * Only pass a reference to a valid `ddog_prof_EncodedProfile`.
527
- */
528
- DDOG_CHECK_RETURN
529
- struct ddog_prof_Result_ByteSlice ddog_prof_EncodedProfile_bytes(struct ddog_prof_EncodedProfile *encoded_profile);
530
-
531
- /**
532
- * Serialize the aggregated profile.
533
- * Drains the data, and then resets the profile for future use.
534
- *
535
- * Don't forget to clean up the ok with `ddog_prof_EncodedProfile_drop` or
536
- * the error variant with `ddog_Error_drop` when you are done with them.
537
- *
538
- * # Arguments
539
- * * `profile` - a reference to the profile being serialized.
540
- * * `start_time` - optional start time for the serialized profile. If None/null is passed, the
541
- * time of profile creation will be used.
542
- * * `end_time` - optional end time of the profile. If None/null is passed, the current time will
543
- * be used.
544
- *
545
- * # Safety
546
- * The `profile` must point to a valid profile object.
547
- * The `start_time` and `end_time` must be null or otherwise point to a valid TimeSpec object.
548
- */
549
- DDOG_CHECK_RETURN
550
- struct ddog_prof_Profile_SerializeResult ddog_prof_Profile_serialize(struct ddog_prof_Profile *profile,
551
- const struct ddog_Timespec *start_time,
552
- const struct ddog_Timespec *end_time);
553
-
554
- DDOG_CHECK_RETURN struct ddog_Slice_U8 ddog_Vec_U8_as_slice(const struct ddog_Vec_U8 *vec);
555
-
556
- /**
557
- * Resets all data in `profile` except the sample types and period. Returns
558
- * true if it successfully reset the profile and false otherwise. The profile
559
- * remains valid if false is returned.
560
- *
561
- * # Arguments
562
- * * `profile` - A mutable reference to the profile to be reset.
563
- * * `start_time` - The time of the profile (after reset). Pass None/null to use the current time.
564
- *
565
- * # Safety
566
- * The `profile` must meet all the requirements of a mutable reference to the profile. Given this
567
- * can be called across an FFI boundary, the compiler cannot enforce this.
568
- * If `time` is not null, it must point to a valid Timespec object.
569
- */
570
- DDOG_CHECK_RETURN
571
- struct ddog_prof_Profile_Result ddog_prof_Profile_reset(struct ddog_prof_Profile *profile);
572
-
573
- /**
574
- * This function interns its argument into the profiler.
575
- * If successful, it returns an opaque interning ID.
576
- * This ID is valid for use on this profiler, until the profiler is reset.
577
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
578
- * On error, it holds an error message in the error variant.
579
- *
580
- * # Safety
581
- * The `profile` ptr must point to a valid Profile object created by this
582
- * module.
583
- * All other arguments must remain valid for the length of this call.
584
- * This call is _NOT_ thread-safe.
585
- */
586
- DDOG_CHECK_RETURN
587
- struct ddog_prof_FunctionId_Result ddog_prof_Profile_intern_function(struct ddog_prof_Profile *profile,
588
- struct ddog_prof_StringId name,
589
- struct ddog_prof_StringId system_name,
590
- struct ddog_prof_StringId filename);
591
-
592
- /**
593
- * This function interns its argument into the profiler.
594
- * If successful, it returns an opaque interning ID.
595
- * This ID is valid for use on this profiler, until the profiler is reset.
596
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
597
- * On error, it holds an error message in the error variant.
598
- *
599
- * # Safety
600
- * The `profile` ptr must point to a valid Profile object created by this
601
- * module.
602
- * All other arguments must remain valid for the length of this call.
603
- * This call is _NOT_ thread-safe.
604
- */
605
- DDOG_CHECK_RETURN
606
- struct ddog_prof_LabelId_Result ddog_prof_Profile_intern_label_num(struct ddog_prof_Profile *profile,
607
- struct ddog_prof_StringId key,
608
- int64_t val);
609
-
610
- /**
611
- * This function interns its argument into the profiler.
612
- * If successful, it returns an opaque interning ID.
613
- * This ID is valid for use on this profiler, until the profiler is reset.
614
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
615
- * On error, it holds an error message in the error variant.
616
- *
617
- * # Safety
618
- * The `profile` ptr must point to a valid Profile object created by this
619
- * module.
620
- * All other arguments must remain valid for the length of this call.
621
- * This call is _NOT_ thread-safe.
622
- */
623
- DDOG_CHECK_RETURN
624
- struct ddog_prof_LabelId_Result ddog_prof_Profile_intern_label_num_with_unit(struct ddog_prof_Profile *profile,
625
- struct ddog_prof_StringId key,
626
- int64_t val,
627
- struct ddog_prof_StringId unit);
628
-
629
- /**
630
- * This function interns its argument into the profiler.
631
- * If successful, it returns an opaque interning ID.
632
- * This ID is valid for use on this profiler, until the profiler is reset.
633
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
634
- * On error, it holds an error message in the error variant.
635
- *
636
- * # Safety
637
- * The `profile` ptr must point to a valid Profile object created by this
638
- * module.
639
- * All other arguments must remain valid for the length of this call.
640
- * This call is _NOT_ thread-safe.
641
- */
642
- DDOG_CHECK_RETURN
643
- struct ddog_prof_LabelId_Result ddog_prof_Profile_intern_label_str(struct ddog_prof_Profile *profile,
644
- struct ddog_prof_StringId key,
645
- struct ddog_prof_StringId val);
646
-
647
- /**
648
- * This function interns its argument into the profiler.
649
- * If successful, it returns an opaque interning ID.
650
- * This ID is valid for use on this profiler, until the profiler is reset.
651
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
652
- * On error, it holds an error message in the error variant.
653
- *
654
- * # Safety
655
- * The `profile` ptr must point to a valid Profile object created by this
656
- * module.
657
- * All other arguments must remain valid for the length of this call.
658
- * This call is _NOT_ thread-safe.
659
- */
660
- DDOG_CHECK_RETURN
661
- struct ddog_prof_LabelSetId_Result ddog_prof_Profile_intern_labelset(struct ddog_prof_Profile *profile,
662
- struct ddog_prof_Slice_LabelId labels);
663
-
664
- /**
665
- * This function interns its argument into the profiler.
666
- * If successful, it returns an opaque interning ID.
667
- * This ID is valid for use on this profiler, until the profiler is reset.
668
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
669
- * On error, it holds an error message in the error variant.
670
- *
671
- * # Safety
672
- * The `profile` ptr must point to a valid Profile object created by this
673
- * module.
674
- * All other arguments must remain valid for the length of this call.
675
- * This call is _NOT_ thread-safe.
676
- */
677
- DDOG_CHECK_RETURN
678
- struct ddog_prof_LocationId_Result ddog_prof_Profile_intern_location(struct ddog_prof_Profile *profile,
679
- struct ddog_prof_FunctionId function_id,
680
- uint64_t address,
681
- int64_t line);
682
-
683
- /**
684
- * This function interns its argument into the profiler.
685
- * If successful, it returns an opaque interning ID.
686
- * This ID is valid for use on this profiler, until the profiler is reset.
687
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
688
- * On error, it holds an error message in the error variant.
689
- *
690
- * # Safety
691
- * The `profile` ptr must point to a valid Profile object created by this
692
- * module.
693
- * All other arguments must remain valid for the length of this call.
694
- * This call is _NOT_ thread-safe.
695
- */
696
- DDOG_CHECK_RETURN
697
- struct ddog_prof_LocationId_Result ddog_prof_Profile_intern_location_with_mapping_id(struct ddog_prof_Profile *profile,
698
- struct ddog_prof_MappingId mapping_id,
699
- struct ddog_prof_FunctionId function_id,
700
- uint64_t address,
701
- int64_t line);
702
-
703
- /**
704
- * This function interns its argument into the profiler.
705
- * If successful, it returns an opaque interning ID.
706
- * This ID is valid for use on this profiler, until the profiler is reset.
707
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
708
- * On error, it holds an error message in the error variant.
709
- *
710
- * # Safety
711
- * The `profile` ptr must point to a valid Profile object created by this
712
- * module.
713
- * All other arguments must remain valid for the length of this call.
714
- * This call is _NOT_ thread-safe.
715
- */
716
- DDOG_CHECK_RETURN
717
- struct ddog_prof_StringId_Result ddog_prof_Profile_intern_managed_string(struct ddog_prof_Profile *profile,
718
- struct ddog_prof_ManagedStringId s);
719
-
720
- /**
721
- * This function interns its argument into the profiler.
722
- * If successful, it returns an opaque interning ID.
723
- * This ID is valid for use on this profiler, until the profiler is reset.
724
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
725
- * On error, it holds an error message in the error variant.
726
- *
727
- * # Safety
728
- * The `profile` ptr must point to a valid Profile object created by this
729
- * module.
730
- * All other arguments must remain valid for the length of this call.
731
- * This call is _NOT_ thread-safe.
732
- */
733
- DDOG_CHECK_RETURN
734
- struct ddog_VoidResult ddog_prof_Profile_intern_managed_strings(struct ddog_prof_Profile *profile,
735
- struct ddog_prof_Slice_ManagedStringId strings,
736
- struct ddog_prof_MutSlice_GenerationalIdStringId out);
737
-
738
- /**
739
- * This function interns its argument into the profiler.
740
- * If successful, it returns an opaque interning ID.
741
- * This ID is valid for use on this profiler, until the profiler is reset.
742
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
743
- * On error, it holds an error message in the error variant.
744
- *
745
- * # Safety
746
- * The `profile` ptr must point to a valid Profile object created by this
747
- * module.
748
- * All other arguments must remain valid for the length of this call.
749
- * This call is _NOT_ thread-safe.
750
- */
751
- DDOG_CHECK_RETURN
752
- struct ddog_prof_MappingId_Result ddog_prof_Profile_intern_mapping(struct ddog_prof_Profile *profile,
753
- uint64_t memory_start,
754
- uint64_t memory_limit,
755
- uint64_t file_offset,
756
- struct ddog_prof_StringId filename,
757
- struct ddog_prof_StringId build_id);
758
-
759
- /**
760
- * This function interns its argument into the profiler.
761
- * If successful, it returns void.
762
- * This ID is valid for use on this profiler, until the profiler is reset.
763
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
764
- * On error, it holds an error message in the error variant.
765
- *
766
- * # Safety
767
- * The `profile` ptr must point to a valid Profile object created by this
768
- * module.
769
- * All other arguments must remain valid for the length of this call.
770
- * This call is _NOT_ thread-safe.
771
- */
772
- DDOG_CHECK_RETURN
773
- struct ddog_VoidResult ddog_prof_Profile_intern_sample(struct ddog_prof_Profile *profile,
774
- struct ddog_prof_StackTraceId stacktrace,
775
- struct ddog_Slice_I64 values,
776
- struct ddog_prof_LabelSetId labels,
777
- int64_t timestamp);
778
-
779
- /**
780
- * This function interns its argument into the profiler.
781
- * If successful, it returns an opaque interning ID.
782
- * This ID is valid for use on this profiler, until the profiler is reset.
783
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
784
- * On error, it holds an error message in the error variant.
785
- *
786
- * # Safety
787
- * The `profile` ptr must point to a valid Profile object created by this
788
- * module.
789
- * All other arguments must remain valid for the length of this call.
790
- * This call is _NOT_ thread-safe.
791
- */
792
- DDOG_CHECK_RETURN
793
- struct ddog_prof_StackTraceId_Result ddog_prof_Profile_intern_stacktrace(struct ddog_prof_Profile *profile,
794
- struct ddog_prof_Slice_LocationId locations);
795
-
796
- /**
797
- * This function interns its argument into the profiler.
798
- * If successful, it returns an opaque interning ID.
799
- * This ID is valid for use on this profiler, until the profiler is reset.
800
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
801
- * On error, it holds an error message in the error variant.
802
- *
803
- * # Safety
804
- * The `profile` ptr must point to a valid Profile object created by this
805
- * module.
806
- * All other arguments must remain valid for the length of this call.
807
- * This call is _NOT_ thread-safe.
808
- */
809
- DDOG_CHECK_RETURN
810
- struct ddog_prof_StringId_Result ddog_prof_Profile_intern_string(struct ddog_prof_Profile *profile,
811
- ddog_CharSlice s);
812
-
813
- /**
814
- * This functions returns an interned id for an empty string
815
- *
816
- * # Safety
817
- * No preconditions
818
- */
819
- struct ddog_prof_StringId ddog_prof_Profile_interned_empty_string(void);
820
-
821
- /**
822
- * This function interns its argument into the profiler.
823
- * If successful, it returns an opaque interning ID.
824
- * This ID is valid for use on this profiler, until the profiler is reset.
825
- * It is an error to use this id after the profiler has been reset, or on a different profiler.
826
- * On error, it holds an error message in the error variant.
827
- *
828
- * # Safety
829
- * The `profile` ptr must point to a valid Profile object created by this
830
- * module.
831
- * All other arguments must remain valid for the length of this call.
832
- * This call is _NOT_ thread-safe.
833
- */
834
- DDOG_CHECK_RETURN
835
- struct ddog_VoidResult ddog_prof_Profile_intern_strings(struct ddog_prof_Profile *profile,
836
- struct ddog_prof_Slice_CharSlice strings,
837
- struct ddog_prof_MutSlice_GenerationalIdStringId out);
838
-
839
- /**
840
- * This functions returns the current generation of the profiler.
841
- * On error, it holds an error message in the error variant.
842
- *
843
- * # Safety
844
- * The `profile` ptr must point to a valid Profile object created by this
845
- * module.
846
- * This call is _NOT_ thread-safe.
847
- */
848
- DDOG_CHECK_RETURN
849
- struct ddog_prof_Result_Generation ddog_prof_Profile_get_generation(struct ddog_prof_Profile *profile);
850
-
851
- /**
852
- * This functions returns whether the given generations are equal.
853
- *
854
- * # Safety: No safety requirements
855
- */
856
- DDOG_CHECK_RETURN
857
- bool ddog_prof_Profile_generations_are_equal(struct ddog_prof_Generation a,
858
- struct ddog_prof_Generation b);
859
-
860
- /**
861
- * This functions ends the current sample and allows the profiler exporter to continue, if it was
862
- * blocked.
863
- * It must have been paired with exactly one `sample_start`.
864
- *
865
- * # Safety
866
- * The `profile` ptr must point to a valid Profile object created by this
867
- * module.
868
- * This call is probably thread-safe, but I haven't confirmed this.
869
- */
870
- DDOG_CHECK_RETURN
871
- struct ddog_VoidResult ddog_prof_Profile_sample_end(struct ddog_prof_Profile *profile);
872
-
873
- /**
874
- * This functions starts a sample and blocks the exporter from continuing.
875
- *
876
- * # Safety
877
- * The `profile` ptr must point to a valid Profile object created by this
878
- * module.
879
- * This call is probably thread-safe, but I haven't confirmed this.
880
- */
881
- DDOG_CHECK_RETURN
882
- struct ddog_VoidResult ddog_prof_Profile_sample_start(struct ddog_prof_Profile *profile);
883
-
884
- /**
885
- * Allocates a new `ProfilesDictionary` and writes a handle to it in `handle`.
886
- *
887
- * # Safety
888
- *
889
- * - `handle` must be non-null and valid for writes of `ProfilesDictionaryHandle`.
890
- * - The returned handle must eventually drop the resource; see
891
- * [`ddog_prof_ProfilesDictionary_drop`] for more details.
892
- * - If you need a copy, use [`ddog_prof_ProfilesDictionary_try_clone`]; don't just memcpy a new
893
- * handle.
894
- */
895
- struct ddog_prof_Status ddog_prof_ProfilesDictionary_new(ddog_prof_ProfilesDictionaryHandle *handle);
896
-
897
- /**
898
- * Creates a new handle to the same `ProfilesDictionary` by incrementing the
899
- * internal reference count.
900
- *
901
- * # Safety
902
- *
903
- * - `out` must be non-null and valid for writes of `ProfilesDictionaryHandle`.
904
- * - `handle` must point to a live dictionary resource.
905
- * - Do not duplicate handles via memcpy; always use this API to create new handles so the
906
- * reference count is maintained correctly.
907
- */
908
- struct ddog_prof_Status ddog_prof_ProfilesDictionary_try_clone(ddog_prof_ProfilesDictionaryHandle *out,
909
- ddog_prof_ProfilesDictionaryHandle handle);
910
-
911
- /**
912
- * Inserts a `Function` into the dictionary and returns its id.
913
- *
914
- * # Safety
915
- *
916
- * - `function_id` must be non-null and valid for writes of `FunctionId`.
917
- * - `dict` must refer to a live dictionary.
918
- * - `function` must be non-null and point to a valid `Function` for the duration of the call.
919
- */
920
- struct ddog_prof_Status ddog_prof_ProfilesDictionary_insert_function(ddog_prof_FunctionId2 *function_id,
921
- const struct ddog_prof_ProfilesDictionary *dict,
922
- const struct ddog_prof_Function2 *function);
923
-
924
- /**
925
- * Inserts a `Mapping` into the dictionary and returns its id.
926
- *
927
- * # Safety
928
- *
929
- * - `mapping_id` must be non-null and valid for writes of `MappingId`.
930
- * - `dict` must refer to a live dictionary.
931
- * - `mapping` must be non-null and point to a valid `Mapping` for the duration of the call.
932
- */
933
- struct ddog_prof_Status ddog_prof_ProfilesDictionary_insert_mapping(ddog_prof_MappingId2 *mapping_id,
934
- const struct ddog_prof_ProfilesDictionary *dict,
935
- const struct ddog_prof_Mapping2 *mapping);
936
-
937
- /**
938
- * Inserts a UTF-8 string into the dictionary string table.
939
- *
940
- * Copies the string into the internal buffer--strings are arena allocated
941
- * and not individually allocated. On success, the [`StringId2`] written to
942
- * the `string_id` out parameter is valid as long as this dictionary is alive.
943
- * It should only be passed back to the dictionary that created it.
944
- *
945
- * # Safety
946
- *
947
- * - `string_id` must be non-null and valid for writes of `StringId`.
948
- * - `handle` must refer to a live dictionary.
949
- * - The UTF-8 policy indicated by `utf8_option` must be respected by caller for the provided
950
- * `byte_slice`.
951
- */
952
- struct ddog_prof_Status ddog_prof_ProfilesDictionary_insert_str(ddog_prof_StringId2 *string_id,
953
- const struct ddog_prof_ProfilesDictionary *dict,
954
- ddog_CharSlice byte_slice,
955
- enum ddog_prof_Utf8Option utf8_option);
956
-
957
- /**
958
- * Tries to get the string value associated with the string id. Fails if the
959
- * handle has been taken from, or the result param is null.
960
- *
961
- * # Safety
962
- *
963
- * 1. The lifetime of the return slice is tied to the underlying storage of the string set, make
964
- * sure the string set is still alive when using the returned slice.
965
- * 2. The string id should belong to the string set in this dictionary. Well-known strings are an
966
- * exception, as they exist in every set.
967
- * 3. The handle must represent a live profiles dictionary. Remember handles can be copied, and if
968
- * _any_ handle drops the resource, then all handles pointing the resource are now invalid,
969
- * even if though they are unaware of it.
970
- * 4. The result pointer must valid for [`core::ptr::write`].
971
- */
972
- struct ddog_prof_Status ddog_prof_ProfilesDictionary_get_str(ddog_CharSlice *result,
973
- const struct ddog_prof_ProfilesDictionary *dict,
974
- ddog_prof_StringId2 string_id);
975
-
976
- /**
977
- * Drops the `ProfilesDictionary` that the handle owns, leaving a valid but
978
- * useless handle (all operations on it will error). This takes a pointer to
979
- * the handle to be able to modify it to leave behind an empty handle.
980
- *
981
- * # Safety
982
- *
983
- * - If non-null, `handle` must point to a valid `ProfilesDictionaryHandle`.
984
- * - The underlying resource must be dropped exactly once across all copies of the handle. After
985
- * dropping, all other copies become invalid and must not be used; they should be discarded
986
- * without dropping.
987
- */
988
- void ddog_prof_ProfilesDictionary_drop(ddog_prof_ProfilesDictionaryHandle *handle);
989
-
990
- DDOG_CHECK_RETURN
991
- struct ddog_prof_ManagedStringStorageNewResult ddog_prof_ManagedStringStorage_new(void);
992
-
993
- /**
994
- * TODO: @ivoanjo Should this take a `*mut ManagedStringStorage` like Profile APIs do?
995
- */
996
- void ddog_prof_ManagedStringStorage_drop(struct ddog_prof_ManagedStringStorage storage);
997
-
998
- /**
999
- * TODO: @ivoanjo Should this take a `*mut ManagedStringStorage` like Profile APIs do?
1000
- */
1001
- DDOG_CHECK_RETURN
1002
- struct ddog_prof_ManagedStringStorageInternResult ddog_prof_ManagedStringStorage_intern(struct ddog_prof_ManagedStringStorage storage,
1003
- ddog_CharSlice string);
1004
-
1005
- /**
1006
- * Interns all the strings in `strings`, writing the resulting id to the same
1007
- * offset in `output_ids`.
1008
- *
1009
- * This can fail if:
1010
- * 1. The given `output_ids_size` doesn't match the size of the input slice.
1011
- * 2. The internal storage pointer is null.
1012
- * 3. It fails to acquire a lock (e.g. it was poisoned).
1013
- * 4. Defensive checks against bugs fail.
1014
- *
1015
- * If a failure occurs, do not use any of the ids in the output array. After
1016
- * this point, you should only use read-only routines (except for drop) on
1017
- * the managed string storage.
1018
- * TODO: @ivoanjo Should this take a `*mut ManagedStringStorage` like Profile APIs do?
1019
- */
1020
- ddog_prof_MaybeError ddog_prof_ManagedStringStorage_intern_all(struct ddog_prof_ManagedStringStorage storage,
1021
- struct ddog_prof_Slice_CharSlice strings,
1022
- struct ddog_prof_ManagedStringId *output_ids,
1023
- uintptr_t output_ids_size);
1024
-
1025
- /**
1026
- * TODO: @ivoanjo Should this take a `*mut ManagedStringStorage` like Profile APIs do?
1027
- */
1028
- ddog_prof_MaybeError ddog_prof_ManagedStringStorage_unintern(struct ddog_prof_ManagedStringStorage storage,
1029
- struct ddog_prof_ManagedStringId id);
1030
-
1031
- /**
1032
- * TODO: @ivoanjo Should this take a `*mut ManagedStringStorage` like Profile APIs do?
1033
- */
1034
- ddog_prof_MaybeError ddog_prof_ManagedStringStorage_unintern_all(struct ddog_prof_ManagedStringStorage storage,
1035
- struct ddog_prof_Slice_ManagedStringId ids);
1036
-
1037
- /**
1038
- * Returns a string given its id.
1039
- * This API is mostly for testing, overall you should avoid reading back strings from libdatadog
1040
- * once they've been interned and should instead always operate on the id.
1041
- * Remember to `ddog_StringWrapper_drop` the string once you're done with it.
1042
- * TODO: @ivoanjo Should this take a `*mut ManagedStringStorage` like Profile APIs do?
1043
- */
1044
- DDOG_CHECK_RETURN
1045
- struct ddog_StringWrapperResult ddog_prof_ManagedStringStorage_get_string(struct ddog_prof_ManagedStringStorage storage,
1046
- struct ddog_prof_ManagedStringId id);
1047
-
1048
- /**
1049
- * TODO: @ivoanjo Should this take a `*mut ManagedStringStorage` like Profile APIs do?
1050
- */
1051
- ddog_prof_MaybeError ddog_prof_ManagedStringStorage_advance_gen(struct ddog_prof_ManagedStringStorage storage);
1052
-
1053
- #ifdef __cplusplus
1054
- } // extern "C"
1055
- #endif // __cplusplus
1056
-
1057
- #endif /* DDOG_PROFILING_H */