Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROF-6559] Mark Ruby CPU Profiling 2.0 as being in beta #2489

Merged
merged 2 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,10 @@ static void handle_sampling_signal(DDTRACE_UNUSED int _signal, DDTRACE_UNUSED si

state->stats.signal_handler_enqueued_sample++;

// TODO: Do something with result (potentially update tracking counters?)
// Note: If we ever want to get rid of rb_postponed_job_register_one, remember not to clobber Ruby exceptions, as
// this function does this helpful job for us now -- https://github.com/ruby/ruby/commit/a98e343d39c4d7bf1e2190b076720f32d9f298b3.
/*int result =*/ rb_postponed_job_register_one(0, sample_from_postponed_job, NULL);
// TODO: Do something with result (potentially update tracking counters?)
}

// The actual sampling trigger loop always runs **without** the global vm lock.
Expand Down Expand Up @@ -628,6 +630,9 @@ static void on_gc_event(VALUE tracepoint_data, DDTRACE_UNUSED void *unused) {
cpu_and_wall_time_collector_on_gc_finish(state->cpu_and_wall_time_collector_instance);
// We use rb_postponed_job_register_one to ask Ruby to run cpu_and_wall_time_collector_sample_after_gc after if
// fully finishes the garbage collection, so that one is allowed to do allocations and throw exceptions as usual.
//
// Note: If we ever want to get rid of rb_postponed_job_register_one, remember not to clobber Ruby exceptions, as
// this function does this helpful job for us now -- https://github.com/ruby/ruby/commit/a98e343d39c4d7bf1e2190b076720f32d9f298b3.
rb_postponed_job_register_one(0, after_gc_from_postponed_job, NULL);
}
}
Expand Down
8 changes: 5 additions & 3 deletions lib/datadog/core/configuration/components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,18 @@ def should_enable_gc_profiling?(settings)
def print_new_profiler_warnings
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
Datadog.logger.warn(
'New Ruby profiler has been force-enabled. This feature is in alpha state. Please report any issues ' \
'you run into via <https://github.com/datadog/dd-trace-rb/issues/new>!'
'New Ruby profiler has been force-enabled. This feature is in beta state. We do not yet recommend ' \
'running it in production environments. Please report any issues ' \
'you run into to Datadog support or via <https://github.com/datadog/dd-trace-rb/issues/new>!'
)
else
# For more details on the issue, see the "BIG Issue" comment on `gvl_owner` function in
# `private_vm_api_access.c`.
Datadog.logger.warn(
'New Ruby profiler has been force-enabled on a legacy Ruby version (< 2.6). This is not recommended in ' \
'production environments, as due to limitations in Ruby APIs, we suspect it may lead to crashes in very ' \
'rare situations. Please report any issues you run into via <https://github.com/datadog/dd-trace-rb/issues/new>!'
'rare situations. Please report any issues you run into to Datadog support or ' \
'via <https://github.com/datadog/dd-trace-rb/issues/new>!'
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/datadog/core/configuration/components_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@

it 'logs a warning message mentioning that profiler has been force-enabled' do
expect(Datadog.logger).to receive(:warn).with(
/New Ruby profiler has been force-enabled. This feature is in alpha state/
/New Ruby profiler has been force-enabled. This feature is in beta state/
)

build_profiler
Expand Down