libdatadog 35.0.0.1.0 → 37.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 (98) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/tasks/build.rake +27 -1
  4. data/tasks/gem.rake +0 -4
  5. data/tasks/release.rake +28 -0
  6. data/tasks/spec.rake +11 -0
  7. data/vendor/{libdatadog-35.0.0/aarch64-linux-musl → libdatadog-37.0.0/aarch64-linux}/LICENSE-3rdparty.csv +2 -0
  8. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/bin/libdatadog-crashtracking-receiver +0 -0
  9. data/vendor/{libdatadog-35.0.0/x86_64-linux-musl → libdatadog-37.0.0/aarch64-linux}/include/datadog/common.h +52 -12
  10. data/vendor/{libdatadog-35.0.0/arm64-darwin → libdatadog-37.0.0/aarch64-linux}/include/datadog/crashtracker.h +19 -0
  11. data/vendor/{libdatadog-35.0.0/aarch64-linux-musl → libdatadog-37.0.0/aarch64-linux}/include/datadog/data-pipeline.h +83 -7
  12. data/vendor/{libdatadog-35.0.0/aarch64-linux-musl → libdatadog-37.0.0/aarch64-linux}/include/datadog/profiling.h +18 -0
  13. data/vendor/libdatadog-37.0.0/aarch64-linux/include/datadog/shared-runtime.h +91 -0
  14. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/lib/libdatadog_profiling.so +0 -0
  15. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  16. data/vendor/{libdatadog-35.0.0/aarch64-linux → libdatadog-37.0.0/aarch64-linux-musl}/LICENSE-3rdparty.csv +2 -0
  17. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  18. data/vendor/{libdatadog-35.0.0/arm64-darwin → libdatadog-37.0.0/aarch64-linux-musl}/include/datadog/common.h +52 -12
  19. data/vendor/{libdatadog-35.0.0/aarch64-linux → libdatadog-37.0.0/aarch64-linux-musl}/include/datadog/crashtracker.h +19 -0
  20. data/vendor/{libdatadog-35.0.0/aarch64-linux → libdatadog-37.0.0/aarch64-linux-musl}/include/datadog/data-pipeline.h +83 -7
  21. data/vendor/{libdatadog-35.0.0/arm64-darwin → libdatadog-37.0.0/aarch64-linux-musl}/include/datadog/profiling.h +18 -0
  22. data/vendor/libdatadog-37.0.0/aarch64-linux-musl/include/datadog/shared-runtime.h +91 -0
  23. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/lib/libdatadog_profiling.so +0 -0
  24. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  25. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/LICENSE-3rdparty.csv +2 -0
  26. data/vendor/{libdatadog-35.0.0/aarch64-linux-musl → libdatadog-37.0.0/arm64-darwin}/include/datadog/common.h +52 -12
  27. data/vendor/{libdatadog-35.0.0/aarch64-linux-musl → libdatadog-37.0.0/arm64-darwin}/include/datadog/crashtracker.h +19 -0
  28. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/data-pipeline.h +83 -7
  29. data/vendor/{libdatadog-35.0.0/aarch64-linux → libdatadog-37.0.0/arm64-darwin}/include/datadog/profiling.h +18 -0
  30. data/vendor/libdatadog-37.0.0/arm64-darwin/include/datadog/shared-runtime.h +91 -0
  31. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/lib/libdatadog_profiling.dylib +0 -0
  32. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  33. data/vendor/libdatadog-37.0.0/x86_64-linux/LICENSE-3rdparty.csv +552 -0
  34. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/bin/libdatadog-crashtracking-receiver +0 -0
  35. data/vendor/libdatadog-37.0.0/x86_64-linux/include/datadog/common.h +2940 -0
  36. data/vendor/libdatadog-37.0.0/x86_64-linux/include/datadog/crashtracker.h +1026 -0
  37. data/vendor/libdatadog-37.0.0/x86_64-linux/include/datadog/data-pipeline.h +425 -0
  38. data/vendor/libdatadog-37.0.0/x86_64-linux/include/datadog/profiling.h +1148 -0
  39. data/vendor/libdatadog-37.0.0/x86_64-linux/include/datadog/shared-runtime.h +91 -0
  40. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/lib/libdatadog_profiling.so +0 -0
  41. data/vendor/libdatadog-37.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +15 -0
  42. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/LICENSE-3rdparty.csv +2 -0
  43. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  44. data/vendor/{libdatadog-35.0.0/aarch64-linux → libdatadog-37.0.0/x86_64-linux-musl}/include/datadog/common.h +52 -12
  45. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/crashtracker.h +19 -0
  46. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/data-pipeline.h +83 -7
  47. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/profiling.h +18 -0
  48. data/vendor/libdatadog-37.0.0/x86_64-linux-musl/include/datadog/shared-runtime.h +91 -0
  49. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/lib/libdatadog_profiling.so +0 -0
  50. data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  51. metadata +88 -81
  52. data/vendor/libdatadog-35.0.0/x86_64-linux/LICENSE-3rdparty.csv +0 -550
  53. data/vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/common.h +0 -2900
  54. data/vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/crashtracker.h +0 -1007
  55. data/vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/data-pipeline.h +0 -349
  56. data/vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/profiling.h +0 -1130
  57. data/vendor/libdatadog-35.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +0 -15
  58. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/LICENSE +0 -0
  59. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/NOTICE +0 -0
  60. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/blazesym.h +0 -0
  61. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/ddsketch.h +0 -0
  62. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/ffe.h +0 -0
  63. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/library-config.h +0 -0
  64. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/log.h +0 -0
  65. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/telemetry.h +0 -0
  66. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/LICENSE +0 -0
  67. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/NOTICE +0 -0
  68. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/blazesym.h +0 -0
  69. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/ddsketch.h +0 -0
  70. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/ffe.h +0 -0
  71. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/library-config.h +0 -0
  72. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/log.h +0 -0
  73. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/telemetry.h +0 -0
  74. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/LICENSE +0 -0
  75. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/NOTICE +0 -0
  76. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/bin/libdatadog-crashtracking-receiver +0 -0
  77. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/blazesym.h +0 -0
  78. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/ddsketch.h +0 -0
  79. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/ffe.h +0 -0
  80. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/library-config.h +0 -0
  81. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/log.h +0 -0
  82. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/telemetry.h +0 -0
  83. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/LICENSE +0 -0
  84. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/NOTICE +0 -0
  85. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/blazesym.h +0 -0
  86. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/ddsketch.h +0 -0
  87. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/ffe.h +0 -0
  88. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/library-config.h +0 -0
  89. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/log.h +0 -0
  90. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/telemetry.h +0 -0
  91. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/LICENSE +0 -0
  92. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/NOTICE +0 -0
  93. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/blazesym.h +0 -0
  94. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/ddsketch.h +0 -0
  95. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/ffe.h +0 -0
  96. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/library-config.h +0 -0
  97. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/log.h +0 -0
  98. /data/vendor/{libdatadog-35.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/telemetry.h +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab0a20f1852ac415e905e178e09208b0986f3119d936a3f8f8326df8e0f778a1
4
- data.tar.gz: aadd3917949f04607ba2be0ea20dff98349b5a14844b87b6dcd7508b40ec1fcf
3
+ metadata.gz: 1d2caf139a67b432139f30d9d681b3424eb67869848eec2ea844775a67b0b5cf
4
+ data.tar.gz: b7d172117d328f5dab3be10fdcae6c42dbe8029899a8229318360fa158bff45a
5
5
  SHA512:
6
- metadata.gz: 538303506ea439d8a62e885f65ca62df32d62d4482bd61984c261d47652d814517a7e379038876c57e4bf0e78c5da40981b666f37f83eec2bb9cb40303b029f0
7
- data.tar.gz: 7859de5265189b8b2e5faaf8c7ec6c91a6fbd2d0bc482dec4de443f5362a8458f2ae15390c7d6947d78785b12dd6c0a09d3c70c3aca9e865d8e464534dc4f92c
6
+ metadata.gz: 16371759dc1728b47790494fb7c9ae5ac9270f916e58eb31560c9adef9bd30f6524db35776603e97405d691361a387f0eca0af3e82cbbeabc0f4f0920d5680c1
7
+ data.tar.gz: a28575cef31af7fbe63b6ef832f770ef3ff8fe8afb4fc97dae1da95842ceafcb74c6e72c3740c09e12065910236576289667dfd8ffa35627019cade41bacba94
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Libdatadog
4
4
  # Current libdatadog version
5
- LIB_VERSION = "35.0.0"
5
+ LIB_VERSION = "37.0.0"
6
6
 
7
7
  GEM_MAJOR_VERSION = "1"
8
8
  GEM_MINOR_VERSION = "0"
data/tasks/build.rake CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "etc"
4
+ require "fileutils"
4
5
  require "pathname"
5
6
 
6
7
  module BuildFromSource
@@ -80,6 +81,31 @@ module BuildFromSource
80
81
  end
81
82
  end
82
83
 
84
+ module Permissions
85
+ # Files that must be executable (0755) in the gem; everything else 0644.
86
+ # Note: .so for Linux, .dylib for macOS.
87
+ EXECUTABLE_FILES = %w[
88
+ libdatadog-crashtracking-receiver
89
+ libdatadog_profiling.so
90
+ libdatadog_profiling.dylib
91
+ ].freeze
92
+
93
+ # Normalise file permissions of the built artifacts before packaging.
94
+ def self.fix(directory)
95
+ Dir.glob("#{directory}/**/*").each do |path|
96
+ next unless File.file?(path)
97
+
98
+ filename = File.basename(path)
99
+ current = File.stat(path).mode & 0o777
100
+ expected = EXECUTABLE_FILES.include?(filename) ? 0o755 : 0o644
101
+ next if current == expected
102
+
103
+ puts "Fixing permissions for #{filename}: #{current.to_s(8)} -> #{expected.to_s(8)}"
104
+ FileUtils.chmod(expected, path)
105
+ end
106
+ end
107
+ end
108
+
83
109
  module Builder
84
110
  class << self
85
111
  # Build the cargo install command for the builder crate's `release` binary.
@@ -160,7 +186,7 @@ namespace :libdatadog do
160
186
  system(env, paths.builder_bin.to_s, "--out", target_dir.to_s) || raise("Builder failed")
161
187
 
162
188
  # Fix file permissions to match expected values for packaging
163
- Helpers.fix_file_permissions(target_dir.to_s)
189
+ BuildFromSource::Permissions.fix(target_dir)
164
190
 
165
191
  puts "Done! Artifacts in #{target_dir}"
166
192
  end
data/tasks/gem.rake CHANGED
@@ -7,10 +7,6 @@ require "zlib"
7
7
  require "stringio"
8
8
 
9
9
  # Builds .gem packages from vendored libdatadog artifacts.
10
- #
11
- # Intentionally duplicates some Rakefile logic so both can coexist during
12
- # the migration; the Rakefile originals will be removed once the new tasks
13
- # are fully adopted.
14
10
  module GemPackaging
15
11
  module Platform
16
12
  # Mapping from gem platform names to the vendor platform directories
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # `rake build` (from bundler/gem_tasks) would build a binary-less gem straight
4
+ # from the gemspec. Real gems bundle the platform-specific libdatadog artifacts
5
+ # and are built via `rake gem:package`, so disable the default to avoid mistakes.
6
+ Rake::Task["build"].clear
7
+ task(:build) { raise "Build task is disabled, use gem:package instead" }
8
+
9
+ # `rake release` (from bundler/gem_tasks) tags and pushes; here releasing just
10
+ # pushes the already-built platform gems from pkg/ (the version tag lives in the
11
+ # libdatadog-rb repo, the binaries are built and packaged by CI).
12
+ Rake::Task["release"].clear
13
+ task(:release) { Rake::Task["push_to_rubygems"].invoke }
14
+
15
+ desc "Push all built gems in pkg/ to RubyGems.org"
16
+ task push_to_rubygems: [
17
+ :"release:guard_clean"
18
+ ] do
19
+ [
20
+ "gem push pkg/libdatadog-#{Libdatadog::VERSION}.gem",
21
+ "gem push pkg/libdatadog-#{Libdatadog::VERSION}-x86_64-linux.gem",
22
+ "gem push pkg/libdatadog-#{Libdatadog::VERSION}-aarch64-linux.gem",
23
+ "gem push pkg/libdatadog-#{Libdatadog::VERSION}-arm64-darwin.gem"
24
+ ].each do |command|
25
+ puts "Running: #{command}"
26
+ abort unless system(command)
27
+ end
28
+ end
data/tasks/spec.rake ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rspec/core/rake_task"
4
+ require "standard/rake" unless RUBY_VERSION < "2.6"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: [
9
+ :spec,
10
+ (:standard unless RUBY_VERSION < "2.6")
11
+ ].compact
@@ -125,6 +125,7 @@ dispatch2,https://github.com/madsmtm/objc2,Zlib OR Apache-2.0 OR MIT,"Mads Marqu
125
125
  displaydoc,https://github.com/yaahc/displaydoc,MIT OR Apache-2.0,Jane Lusby <jlusby@yaah.dev>
126
126
  dyn-clone,https://github.com/dtolnay/dyn-clone,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
127
127
  either,https://github.com/rayon-rs/either,MIT OR Apache-2.0,bluss
128
+ elf,https://github.com/cole14/rust-elf,MIT OR Apache-2.0,Christopher Cole <chris.cole.09@gmail.com>
128
129
  encoding_rs,https://github.com/hsivonen/encoding_rs,(Apache-2.0 OR MIT) AND BSD-3-Clause,Henri Sivonen <hsivonen@hsivonen.fi>
129
130
  enum-as-inner,https://github.com/bluejekyll/enum-as-inner,MIT OR Apache-2.0,Benjamin Fry <benjaminfry@me.com>
130
131
  equivalent,https://github.com/cuviper/equivalent,Apache-2.0 OR MIT,The equivalent Authors
@@ -429,6 +430,7 @@ target-triple,https://github.com/dtolnay/target-triple,MIT OR Apache-2.0,David T
429
430
  tempfile,https://github.com/Stebalien/tempfile,MIT OR Apache-2.0,"Steven Allen <steven@stebalien.com>, The Rust Project Developers, Ashley Mannix <ashleymannix@live.com.au>, Jason White <me@jasonwhite.io>"
430
431
  termcolor,https://github.com/BurntSushi/termcolor,Unlicense OR MIT,Andrew Gallant <jamslam@gmail.com>
431
432
  test-case-macros,https://github.com/frondeus/test-case,MIT,"Marcin Sas-Szymanski <marcin.sas-szymanski@anixe.pl>, Wojciech Polak <frondeus@gmail.com>, Łukasz Biel <lukasz.p.biel@gmail.com>"
433
+ thin-vec,https://github.com/mozilla/thin-vec,MIT OR Apache-2.0,Aria Beingessner <a.beingessner@gmail.com>
432
434
  thiserror,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
433
435
  thiserror-impl,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
434
436
  thread_local,https://github.com/Amanieu/thread_local-rs,MIT OR Apache-2.0,Amanieu d'Antras <amanieu@gmail.com>
@@ -1626,6 +1626,7 @@ typedef struct ddog_ContextKey {
1626
1626
  typedef struct ddog_TraceExporter ddog_TraceExporter;
1627
1627
  typedef struct ddog_TracerSpan ddog_TracerSpan;
1628
1628
  typedef struct ddog_TracerTraceChunks ddog_TracerTraceChunks;
1629
+ typedef struct ddog_TraceExporterCancelToken ddog_TraceExporterCancelToken;
1629
1630
 
1630
1631
 
1631
1632
  /**
@@ -1669,20 +1670,13 @@ typedef enum ddog_TraceExporterErrorCode {
1669
1670
  typedef struct ddog_TraceExporterResponse ddog_TraceExporterResponse;
1670
1671
 
1671
1672
  /**
1672
- * A shared runtime that manages PausableWorkers and provides fork safety hooks.
1673
+ * Owns a tokio runtime and manages [`PausableWorker`]s on it.
1673
1674
  *
1674
- * The SharedRuntime owns a tokio runtime (on native) and tracks PausableWorkers
1675
- * spawned on it. It provides methods to safely pause workers before forking and
1676
- * restart them after fork in both parent and child processes.
1677
- *
1678
- * On wasm32, no tokio runtime is created. Workers are spawned via `spawn_local`
1679
- * on the JS event loop.
1680
- *
1681
- * # Mutex lock order
1682
- * When locking both [Self::runtime] and [Self::workers], the mutex must be locked in the order of
1683
- * the fields in the struct. When possible avoid holding both locks simultaneously.
1675
+ * Supports the full fork protocol ([`before_fork`](Self::before_fork) /
1676
+ * [`after_fork_parent`](Self::after_fork_parent) /
1677
+ * [`after_fork_child`](Self::after_fork_child)) and synchronous [`shutdown`](Self::shutdown).
1684
1678
  */
1685
- typedef struct ddog_SharedRuntime ddog_SharedRuntime;
1679
+ typedef struct ddog_ForkSafeRuntime ddog_ForkSafeRuntime;
1686
1680
 
1687
1681
  /**
1688
1682
  * The TraceExporterConfig object will hold the configuration properties for the TraceExporter.
@@ -2232,6 +2226,52 @@ typedef struct ddog_ffe_AttributePair {
2232
2226
  struct ddog_ffe_AttributeValue value;
2233
2227
  } ddog_ffe_AttributePair;
2234
2228
 
2229
+ /**
2230
+ * Error codes for ForkSafeRuntime FFI operations.
2231
+ */
2232
+ typedef enum ddog_SharedRuntimeErrorCode {
2233
+ /**
2234
+ * Invalid argument provided (e.g. null handle).
2235
+ */
2236
+ DDOG_SHARED_RUNTIME_ERROR_CODE_INVALID_ARGUMENT,
2237
+ /**
2238
+ * The runtime is not available or in an invalid state.
2239
+ */
2240
+ DDOG_SHARED_RUNTIME_ERROR_CODE_RUNTIME_UNAVAILABLE,
2241
+ /**
2242
+ * Failed to acquire a lock on internal state.
2243
+ */
2244
+ DDOG_SHARED_RUNTIME_ERROR_CODE_LOCK_FAILED,
2245
+ /**
2246
+ * A worker operation failed.
2247
+ */
2248
+ DDOG_SHARED_RUNTIME_ERROR_CODE_WORKER_ERROR,
2249
+ /**
2250
+ * Failed to create the tokio runtime.
2251
+ */
2252
+ DDOG_SHARED_RUNTIME_ERROR_CODE_RUNTIME_CREATION,
2253
+ /**
2254
+ * Shutdown timed out.
2255
+ */
2256
+ DDOG_SHARED_RUNTIME_ERROR_CODE_SHUTDOWN_TIMED_OUT,
2257
+ /**
2258
+ * An unexpected panic occurred inside the FFI call.
2259
+ */
2260
+ DDOG_SHARED_RUNTIME_ERROR_CODE_PANIC,
2261
+ } ddog_SharedRuntimeErrorCode;
2262
+
2263
+ /**
2264
+ * Error returned by ForkSafeRuntime FFI functions.
2265
+ */
2266
+ typedef struct ddog_SharedRuntimeFFIError {
2267
+ enum ddog_SharedRuntimeErrorCode code;
2268
+ /**
2269
+ * The error message is always defined when the error is returned by a ddog_shared_runtime
2270
+ * ffi.
2271
+ */
2272
+ char *msg;
2273
+ } ddog_SharedRuntimeFFIError;
2274
+
2235
2275
  typedef enum ddog_crasht_BuildIdType {
2236
2276
  DDOG_CRASHT_BUILD_ID_TYPE_GNU,
2237
2277
  DDOG_CRASHT_BUILD_ID_TYPE_GO,
@@ -170,6 +170,25 @@ struct ddog_VoidResult ddog_crasht_report_unhandled_exception(ddog_CharSlice err
170
170
  ddog_CharSlice error_message,
171
171
  struct ddog_crasht_Handle_StackTrace *runtime_stack);
172
172
 
173
+ /**
174
+ * Register the expected PID of the socket-based crash receiver
175
+ *
176
+ * When `collect_all_threads` is enabled and the receiver is reached via a Unix
177
+ * socket, the crash handler will only grant ptrace permission if the socket
178
+ * peer's PID matches this registered value.
179
+ *
180
+ * Call this after establishing a trusted connection to the sidecar
181
+ *
182
+ * # Safety
183
+ * This function is safe to call from any thread at any time.
184
+ */
185
+ void ddog_crasht_set_expected_receiver_pid(int32_t pid);
186
+
187
+ /**
188
+ * Returns the currently registered expected receiver PID, or 0 if unset.
189
+ */
190
+ int32_t ddog_crasht_get_expected_receiver_pid(void);
191
+
173
192
  /**
174
193
  * Removes all existing additional tags
175
194
  * Expected to be used after a fork, to reset the additional tags on the child
@@ -156,7 +156,7 @@ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_connection_timeou
156
156
  * [`ddog_shared_runtime_free`].
157
157
  */
158
158
  struct ddog_TraceExporterError *ddog_trace_exporter_config_set_shared_runtime(struct ddog_TraceExporterConfig *config,
159
- struct ddog_SharedRuntime *handle);
159
+ struct ddog_ForkSafeRuntime *handle);
160
160
 
161
161
  /**
162
162
  * Enables OTLP HTTP/JSON export and sets the endpoint URL.
@@ -168,13 +168,47 @@ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_shared_runtime(st
168
168
  struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_endpoint(struct ddog_TraceExporterConfig *config,
169
169
  ddog_CharSlice url);
170
170
 
171
+ /**
172
+ * Sets the OTLP export protocol. Accepts the OTel-standard values `http/json` (default) or
173
+ * `http/protobuf`; `grpc` is rejected as not yet supported. The host language resolves the value
174
+ * (e.g. from `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`).
175
+ *
176
+ * Has no effect unless an OTLP endpoint is also configured via
177
+ * `ddog_trace_exporter_config_set_otlp_endpoint`; without one, traces are sent to the
178
+ * Datadog agent and this protocol selection is ignored.
179
+ *
180
+ * Returns `None` on success, `ErrorCode::InvalidArgument` for a null config or an unaccepted
181
+ * value, and `ErrorCode::InvalidInput` for a non-UTF-8 string.
182
+ */
183
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_protocol(struct ddog_TraceExporterConfig *config,
184
+ ddog_CharSlice protocol);
185
+
186
+ /**
187
+ * Configure the exporter to write traces as newline-delimited JSON to stdout (the Datadog
188
+ * Forwarder "log exporter" path) instead of sending them to a Datadog agent. Used in serverless
189
+ * environments (e.g. AWS Lambda) when no agent is reachable.
190
+ *
191
+ * `max_line_size` overrides the per-line byte cap; pass `0` to use the default (256 KiB, the AWS
192
+ * CloudWatch Logs limit). When enabled, agent-specific behavior (agent-info polling, client-side
193
+ * stats, V1 negotiation) is bypassed.
194
+ *
195
+ * In this mode each span's `meta` is serialized to process stdout (and thus captured by CloudWatch
196
+ * Logs in Lambda); `meta_struct` is excluded because it holds raw msgpack the log intake cannot
197
+ * interpret.
198
+ *
199
+ * Writes are synchronous/blocking on stdout, so this mode targets single-threaded / current-thread
200
+ * serverless runtimes (e.g. AWS Lambda) where a blocking write won't stall a shared async reactor.
201
+ */
202
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_output_to_log(struct ddog_TraceExporterConfig *config,
203
+ uintptr_t max_line_size);
204
+
171
205
  /**
172
206
  * Create a new TraceExporter instance.
173
207
  *
174
- * When an OTLP endpoint is configured via `TraceExporterConfig`, the exporter sends traces in
175
- * OTLP HTTP/JSON to that endpoint instead of the Datadog agent. The same payload (e.g.
176
- * MessagePack) is passed to `ddog_trace_exporter_send`; the library decodes and converts to
177
- * OTLP when OTLP is enabled.
208
+ * When an OTLP endpoint is configured via `TraceExporterConfig`, the exporter sends traces to
209
+ * that endpoint in OTLP over HTTP JSON or protobuf per the configured protocol instead of
210
+ * to the Datadog agent. The same payload (e.g. MessagePack) is passed to
211
+ * `ddog_trace_exporter_send`; the library decodes and converts it to OTLP when OTLP is enabled.
178
212
  *
179
213
  * # Arguments
180
214
  *
@@ -320,6 +354,38 @@ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_begin_chunk(ddog_Tracer
320
354
  struct ddog_TraceExporterError *ddog_tracer_trace_chunks_push_span(ddog_TracerTraceChunks *handle,
321
355
  ddog_TracerSpan *span);
322
356
 
357
+ /**
358
+ * Create a new cancellation token.
359
+ *
360
+ * The returned token must be freed with
361
+ * [`ddog_trace_exporter_cancel_token_drop`].
362
+ */
363
+ ddog_TraceExporterCancelToken *ddog_trace_exporter_cancel_token_new(void);
364
+
365
+ /**
366
+ * Cancel a cancellation token.
367
+ *
368
+ * All clones of the same token observe the cancellation. If a
369
+ * [`ddog_trace_exporter_send_trace_chunks`] call is using this token at the
370
+ * time of cancellation, that send stops waiting for the agent at its next
371
+ * await point and returns an error; the trace chunks it was sending may be
372
+ * lost.
373
+ *
374
+ * Cancellation only affects a send that is in progress. If no send is using
375
+ * the token, cancelling it has no immediate effect: a send started afterwards
376
+ * with an already-cancelled token returns an error without contacting the
377
+ * agent, and a token cancelled after its send has already finished does
378
+ * nothing.
379
+ */
380
+ void ddog_trace_exporter_cancel_token_cancel(const ddog_TraceExporterCancelToken *token);
381
+
382
+ /**
383
+ * Free a cancellation token.
384
+ *
385
+ * After this call the token is invalid and must not be reused.
386
+ */
387
+ void ddog_trace_exporter_cancel_token_drop(ddog_TraceExporterCancelToken *token);
388
+
323
389
  /**
324
390
  * Send trace chunks through a [`TraceExporter`], consuming the chunks.
325
391
  *
@@ -327,20 +393,30 @@ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_push_span(ddog_TracerTr
327
393
  * serializes in the configured output format, and sends to the agent
328
394
  * with retry logic.
329
395
  *
396
+ * When `cancel` is non-null, cancelling that token (via
397
+ * [`ddog_trace_exporter_cancel_token_cancel`]) while the send is in progress
398
+ * aborts the in-flight request and returns an error with code
399
+ * [`ExporterErrorCode::IoError`]. Cancellation is cooperative: it only takes
400
+ * effect while a request is actually in flight. A token that is already
401
+ * cancelled when the send starts makes this function return that error
402
+ * immediately, and cancelling after the send has finished has no effect.
403
+ * Cancelling an in-flight send may cause the trace chunks being sent to be
404
+ * lost.
405
+ *
330
406
  * On success, if `response_out` is non-null, a heap-allocated
331
407
  * [`ExporterResponse`] is written there. The caller owns it and must
332
408
  * free it with `ddog_trace_exporter_response_free`.
333
409
  *
334
410
  * # Safety
335
411
  *
336
- * * `exporter` must be a valid `TraceExporter` pointer.
337
412
  * * `chunks` is consumed and must not be used after this call.
338
413
  * * If `response_out` is non-null it must point to valid writable memory for a
339
414
  * `Box<ExporterResponse>`.
340
415
  */
341
416
  struct ddog_TraceExporterError *ddog_trace_exporter_send_trace_chunks(const ddog_TraceExporter *exporter,
342
417
  ddog_TracerTraceChunks *chunks,
343
- struct ddog_TraceExporterResponse **response_out);
418
+ struct ddog_TraceExporterResponse **response_out,
419
+ const ddog_TraceExporterCancelToken *cancel);
344
420
 
345
421
  #ifdef __cplusplus
346
422
  } // extern "C"
@@ -488,6 +488,24 @@ struct ddog_prof_Profile_Result ddog_prof_Profile_add_endpoint_count(struct ddog
488
488
  ddog_CharSlice endpoint,
489
489
  int64_t value);
490
490
 
491
+ /**
492
+ * Set whether "local root span id" labels should be omitted when serializing.
493
+ *
494
+ * This is an experimental setting and defaults to false.
495
+ *
496
+ * # Arguments
497
+ * * `profile` - a reference to the profile being configured.
498
+ * * `omit` - true to omit the label from serialized pprof samples.
499
+ *
500
+ * # Safety
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_set_omit_local_root_span_id_when_serializing(struct ddog_prof_Profile *profile,
507
+ bool omit);
508
+
491
509
  /**
492
510
  * Add a poisson-based upscaling rule which will be use to adjust values and make them
493
511
  * closer to reality.
@@ -0,0 +1,91 @@
1
+ // Copyright 2025-Present Datadog, Inc. https://www.datadoghq.com/
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+
5
+ #ifndef DDOG_SHARED_RUNTIME_H
6
+ #define DDOG_SHARED_RUNTIME_H
7
+
8
+ #include <stdarg.h>
9
+ #include <stdbool.h>
10
+ #include <stdint.h>
11
+ #include <stdlib.h>
12
+
13
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif // __cplusplus
16
+
17
+ /**
18
+ * Frees a `SharedRuntimeFFIError`. After this call the pointer is invalid.
19
+ */
20
+ void ddog_shared_runtime_error_free(struct ddog_SharedRuntimeFFIError *error);
21
+
22
+ /**
23
+ * Create a new `ForkSafeRuntime`.
24
+ *
25
+ * On success writes a raw handle into `*out_handle` and returns `None`.
26
+ * On failure leaves `*out_handle` unchanged and returns an error.
27
+ *
28
+ * The caller owns the handle and must eventually pass it to
29
+ * [`ddog_shared_runtime_free`] (or another consumer that takes ownership).
30
+ */
31
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_new(const struct ddog_ForkSafeRuntime **out_handle);
32
+
33
+ /**
34
+ * Free a handle, decrementing the `Arc` strong count.
35
+ *
36
+ * The underlying runtime may not be dropped if other components are still using it.
37
+ * Use [`ddog_shared_runtime_shutdown`] to cleanly stop workers.
38
+ */
39
+ void ddog_shared_runtime_free(const struct ddog_ForkSafeRuntime *handle);
40
+
41
+ /**
42
+ * Must be called in the parent process before `fork()`.
43
+ *
44
+ * Pauses all workers so that no background threads are running during the
45
+ * fork, preventing deadlocks in the child process.
46
+ *
47
+ * Returns an error if `handle` is null.
48
+ * The handle must have been initialized with `ddog_shared_runtime_new`.
49
+ */
50
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_before_fork(const struct ddog_ForkSafeRuntime *handle);
51
+
52
+ /**
53
+ * Must be called in the parent process after `fork()`.
54
+ *
55
+ * Restarts all workers that were paused by [`ddog_shared_runtime_before_fork`].
56
+ *
57
+ * Returns `None` on success, or an error if workers could not be restarted.
58
+ * The handle must have been initialized with `ddog_shared_runtime_new`.
59
+ */
60
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_after_fork_parent(const struct ddog_ForkSafeRuntime *handle);
61
+
62
+ /**
63
+ * Must be called in the child process after `fork()`.
64
+ *
65
+ * Creates a fresh tokio runtime and restarts all workers. The original
66
+ * runtime cannot be safely reused after a fork.
67
+ *
68
+ * Returns `None` on success, or an error if the runtime could not be
69
+ * reinitialized.
70
+ * The handle must have been initialized with `ddog_shared_runtime_new`.
71
+ */
72
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_after_fork_child(const struct ddog_ForkSafeRuntime *handle);
73
+
74
+ /**
75
+ * Shut down the `ForkSafeRuntime`, stopping all workers.
76
+ *
77
+ * `timeout_ms` is the maximum time to wait for workers to stop, in
78
+ * milliseconds. Pass `0` for no timeout.
79
+ *
80
+ * Returns `None` on success, or `SharedRuntimeErrorCode::ShutdownTimedOut`
81
+ * if the timeout was reached.
82
+ * The handle must have been initialized with `ddog_shared_runtime_new`.
83
+ */
84
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_shutdown(const struct ddog_ForkSafeRuntime *handle,
85
+ uint64_t timeout_ms);
86
+
87
+ #ifdef __cplusplus
88
+ } // extern "C"
89
+ #endif // __cplusplus
90
+
91
+ #endif /* DDOG_SHARED_RUNTIME_H */
@@ -8,7 +8,7 @@ includedir=${prefix}/include
8
8
 
9
9
  Name: datadog_profiling
10
10
  Description: Contains common code used to implement Datadog's Continuous Profilers. (Dynamic linking variant, sets rpath)
11
- Version: 35.0.0
11
+ Version: 37.0.0
12
12
  Requires:
13
13
  Libs: -L${libdir} -ldatadog_profiling -Wl,-rpath,${libdir}
14
14
  Libs.private:
@@ -125,6 +125,7 @@ dispatch2,https://github.com/madsmtm/objc2,Zlib OR Apache-2.0 OR MIT,"Mads Marqu
125
125
  displaydoc,https://github.com/yaahc/displaydoc,MIT OR Apache-2.0,Jane Lusby <jlusby@yaah.dev>
126
126
  dyn-clone,https://github.com/dtolnay/dyn-clone,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
127
127
  either,https://github.com/rayon-rs/either,MIT OR Apache-2.0,bluss
128
+ elf,https://github.com/cole14/rust-elf,MIT OR Apache-2.0,Christopher Cole <chris.cole.09@gmail.com>
128
129
  encoding_rs,https://github.com/hsivonen/encoding_rs,(Apache-2.0 OR MIT) AND BSD-3-Clause,Henri Sivonen <hsivonen@hsivonen.fi>
129
130
  enum-as-inner,https://github.com/bluejekyll/enum-as-inner,MIT OR Apache-2.0,Benjamin Fry <benjaminfry@me.com>
130
131
  equivalent,https://github.com/cuviper/equivalent,Apache-2.0 OR MIT,The equivalent Authors
@@ -429,6 +430,7 @@ target-triple,https://github.com/dtolnay/target-triple,MIT OR Apache-2.0,David T
429
430
  tempfile,https://github.com/Stebalien/tempfile,MIT OR Apache-2.0,"Steven Allen <steven@stebalien.com>, The Rust Project Developers, Ashley Mannix <ashleymannix@live.com.au>, Jason White <me@jasonwhite.io>"
430
431
  termcolor,https://github.com/BurntSushi/termcolor,Unlicense OR MIT,Andrew Gallant <jamslam@gmail.com>
431
432
  test-case-macros,https://github.com/frondeus/test-case,MIT,"Marcin Sas-Szymanski <marcin.sas-szymanski@anixe.pl>, Wojciech Polak <frondeus@gmail.com>, Łukasz Biel <lukasz.p.biel@gmail.com>"
433
+ thin-vec,https://github.com/mozilla/thin-vec,MIT OR Apache-2.0,Aria Beingessner <a.beingessner@gmail.com>
432
434
  thiserror,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
433
435
  thiserror-impl,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
434
436
  thread_local,https://github.com/Amanieu/thread_local-rs,MIT OR Apache-2.0,Amanieu d'Antras <amanieu@gmail.com>
@@ -1626,6 +1626,7 @@ typedef struct ddog_ContextKey {
1626
1626
  typedef struct ddog_TraceExporter ddog_TraceExporter;
1627
1627
  typedef struct ddog_TracerSpan ddog_TracerSpan;
1628
1628
  typedef struct ddog_TracerTraceChunks ddog_TracerTraceChunks;
1629
+ typedef struct ddog_TraceExporterCancelToken ddog_TraceExporterCancelToken;
1629
1630
 
1630
1631
 
1631
1632
  /**
@@ -1669,20 +1670,13 @@ typedef enum ddog_TraceExporterErrorCode {
1669
1670
  typedef struct ddog_TraceExporterResponse ddog_TraceExporterResponse;
1670
1671
 
1671
1672
  /**
1672
- * A shared runtime that manages PausableWorkers and provides fork safety hooks.
1673
+ * Owns a tokio runtime and manages [`PausableWorker`]s on it.
1673
1674
  *
1674
- * The SharedRuntime owns a tokio runtime (on native) and tracks PausableWorkers
1675
- * spawned on it. It provides methods to safely pause workers before forking and
1676
- * restart them after fork in both parent and child processes.
1677
- *
1678
- * On wasm32, no tokio runtime is created. Workers are spawned via `spawn_local`
1679
- * on the JS event loop.
1680
- *
1681
- * # Mutex lock order
1682
- * When locking both [Self::runtime] and [Self::workers], the mutex must be locked in the order of
1683
- * the fields in the struct. When possible avoid holding both locks simultaneously.
1675
+ * Supports the full fork protocol ([`before_fork`](Self::before_fork) /
1676
+ * [`after_fork_parent`](Self::after_fork_parent) /
1677
+ * [`after_fork_child`](Self::after_fork_child)) and synchronous [`shutdown`](Self::shutdown).
1684
1678
  */
1685
- typedef struct ddog_SharedRuntime ddog_SharedRuntime;
1679
+ typedef struct ddog_ForkSafeRuntime ddog_ForkSafeRuntime;
1686
1680
 
1687
1681
  /**
1688
1682
  * The TraceExporterConfig object will hold the configuration properties for the TraceExporter.
@@ -2232,6 +2226,52 @@ typedef struct ddog_ffe_AttributePair {
2232
2226
  struct ddog_ffe_AttributeValue value;
2233
2227
  } ddog_ffe_AttributePair;
2234
2228
 
2229
+ /**
2230
+ * Error codes for ForkSafeRuntime FFI operations.
2231
+ */
2232
+ typedef enum ddog_SharedRuntimeErrorCode {
2233
+ /**
2234
+ * Invalid argument provided (e.g. null handle).
2235
+ */
2236
+ DDOG_SHARED_RUNTIME_ERROR_CODE_INVALID_ARGUMENT,
2237
+ /**
2238
+ * The runtime is not available or in an invalid state.
2239
+ */
2240
+ DDOG_SHARED_RUNTIME_ERROR_CODE_RUNTIME_UNAVAILABLE,
2241
+ /**
2242
+ * Failed to acquire a lock on internal state.
2243
+ */
2244
+ DDOG_SHARED_RUNTIME_ERROR_CODE_LOCK_FAILED,
2245
+ /**
2246
+ * A worker operation failed.
2247
+ */
2248
+ DDOG_SHARED_RUNTIME_ERROR_CODE_WORKER_ERROR,
2249
+ /**
2250
+ * Failed to create the tokio runtime.
2251
+ */
2252
+ DDOG_SHARED_RUNTIME_ERROR_CODE_RUNTIME_CREATION,
2253
+ /**
2254
+ * Shutdown timed out.
2255
+ */
2256
+ DDOG_SHARED_RUNTIME_ERROR_CODE_SHUTDOWN_TIMED_OUT,
2257
+ /**
2258
+ * An unexpected panic occurred inside the FFI call.
2259
+ */
2260
+ DDOG_SHARED_RUNTIME_ERROR_CODE_PANIC,
2261
+ } ddog_SharedRuntimeErrorCode;
2262
+
2263
+ /**
2264
+ * Error returned by ForkSafeRuntime FFI functions.
2265
+ */
2266
+ typedef struct ddog_SharedRuntimeFFIError {
2267
+ enum ddog_SharedRuntimeErrorCode code;
2268
+ /**
2269
+ * The error message is always defined when the error is returned by a ddog_shared_runtime
2270
+ * ffi.
2271
+ */
2272
+ char *msg;
2273
+ } ddog_SharedRuntimeFFIError;
2274
+
2235
2275
  typedef enum ddog_crasht_BuildIdType {
2236
2276
  DDOG_CRASHT_BUILD_ID_TYPE_GNU,
2237
2277
  DDOG_CRASHT_BUILD_ID_TYPE_GO,
@@ -170,6 +170,25 @@ struct ddog_VoidResult ddog_crasht_report_unhandled_exception(ddog_CharSlice err
170
170
  ddog_CharSlice error_message,
171
171
  struct ddog_crasht_Handle_StackTrace *runtime_stack);
172
172
 
173
+ /**
174
+ * Register the expected PID of the socket-based crash receiver
175
+ *
176
+ * When `collect_all_threads` is enabled and the receiver is reached via a Unix
177
+ * socket, the crash handler will only grant ptrace permission if the socket
178
+ * peer's PID matches this registered value.
179
+ *
180
+ * Call this after establishing a trusted connection to the sidecar
181
+ *
182
+ * # Safety
183
+ * This function is safe to call from any thread at any time.
184
+ */
185
+ void ddog_crasht_set_expected_receiver_pid(int32_t pid);
186
+
187
+ /**
188
+ * Returns the currently registered expected receiver PID, or 0 if unset.
189
+ */
190
+ int32_t ddog_crasht_get_expected_receiver_pid(void);
191
+
173
192
  /**
174
193
  * Removes all existing additional tags
175
194
  * Expected to be used after a fork, to reset the additional tags on the child