Sha256: 5b179f9c10751eb8ab8ceef69778f817997e763d7abaf5a3a2c8e0660021938c

Contents?: true

Size: 1.15 KB

Versions: 14

Compression:

Stored size: 1.15 KB

Contents

# typed: ignore

# This file is used to load the profiling native extension. It works in two steps:
#
# 1. Load the ddtrace_profiling_loader extension. This extension will be used to load the actual extension, but in
#    a special way that avoids exposing native-level code symbols. See `ddtrace_profiling_loader.c` for more details.
#
# 2. Use the Datadog::Profiling::Loader exposed by the ddtrace_profiling_loader extension to load the actual
#    profiling native extension.
#
# All code on this file is on-purpose at the top-level; this makes it so this file is executed only once,
# the first time it gets required, to avoid any issues with the native extension being initialized more than once.

require "ddtrace_profiling_loader.#{RUBY_VERSION}_#{RUBY_PLATFORM}"

extension_name = "ddtrace_profiling_native_extension.#{RUBY_VERSION}_#{RUBY_PLATFORM}"
full_file_path = "#{__dir__}/../../#{extension_name}.#{RbConfig::CONFIG['DLEXT']}"
init_function_name = "Init_#{extension_name.split('.').first}"

status, result = Datadog::Profiling::Loader._native_load(full_file_path, init_function_name)

raise "Failure to load #{extension_name} due to #{result}" if status == :error

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.8.0 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.7.0 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.6.1 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.6.0 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.5.2 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.5.1 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.5.0 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.4.2 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.4.1 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.4.0 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.3.0 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.2.0 lib/datadog/profiling/load_native_extension.rb
ddtrace-1.1.0 lib/datadog/profiling/load_native_extension.rb