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