Skip to content

Commit fd88411

Browse files
authored
Merge pull request #2489 from DataDog/ivoanjo/prof-6559-cpu-profiling-2-beta
[PROF-6559] Mark Ruby CPU Profiling 2.0 as being in beta
2 parents 7d2cd8b + 91cc4c5 commit fd88411

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,10 @@ static void handle_sampling_signal(DDTRACE_UNUSED int _signal, DDTRACE_UNUSED si
395395

396396
state->stats.signal_handler_enqueued_sample++;
397397

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

402404
// The actual sampling trigger loop always runs **without** the global vm lock.
@@ -628,6 +630,9 @@ static void on_gc_event(VALUE tracepoint_data, DDTRACE_UNUSED void *unused) {
628630
cpu_and_wall_time_collector_on_gc_finish(state->cpu_and_wall_time_collector_instance);
629631
// We use rb_postponed_job_register_one to ask Ruby to run cpu_and_wall_time_collector_sample_after_gc after if
630632
// fully finishes the garbage collection, so that one is allowed to do allocations and throw exceptions as usual.
633+
//
634+
// Note: If we ever want to get rid of rb_postponed_job_register_one, remember not to clobber Ruby exceptions, as
635+
// this function does this helpful job for us now -- https://github.com/ruby/ruby/commit/a98e343d39c4d7bf1e2190b076720f32d9f298b3.
631636
rb_postponed_job_register_one(0, after_gc_from_postponed_job, NULL);
632637
}
633638
}

lib/datadog/core/configuration/components.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,18 @@ def should_enable_gc_profiling?(settings)
351351
def print_new_profiler_warnings
352352
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
353353
Datadog.logger.warn(
354-
'New Ruby profiler has been force-enabled. This feature is in alpha state. Please report any issues ' \
355-
'you run into via <https://github.com/datadog/dd-trace-rb/issues/new>!'
354+
'New Ruby profiler has been force-enabled. This feature is in beta state. We do not yet recommend ' \
355+
'running it in production environments. Please report any issues ' \
356+
'you run into to Datadog support or via <https://github.com/datadog/dd-trace-rb/issues/new>!'
356357
)
357358
else
358359
# For more details on the issue, see the "BIG Issue" comment on `gvl_owner` function in
359360
# `private_vm_api_access.c`.
360361
Datadog.logger.warn(
361362
'New Ruby profiler has been force-enabled on a legacy Ruby version (< 2.6). This is not recommended in ' \
362363
'production environments, as due to limitations in Ruby APIs, we suspect it may lead to crashes in very ' \
363-
'rare situations. Please report any issues you run into via <https://github.com/datadog/dd-trace-rb/issues/new>!'
364+
'rare situations. Please report any issues you run into to Datadog support or ' \
365+
'via <https://github.com/datadog/dd-trace-rb/issues/new>!'
364366
)
365367
end
366368
end

spec/datadog/core/configuration/components_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@
10431043

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

10491049
build_profiler

0 commit comments

Comments
 (0)