Skip to content

Commit

Permalink
Merge pull request #4409 from DataDog/ivoanjo/prof-11394-revert-heap-…
Browse files Browse the repository at this point in the history
…profiling

[PROF-11394] Revert changes to heap profiling in PRs #4401, #4376, #4331
  • Loading branch information
ivoanjo authored Feb 19, 2025
2 parents 6fa4413 + ded9fcb commit 30f6e21
Show file tree
Hide file tree
Showing 17 changed files with 541 additions and 420 deletions.
4 changes: 2 additions & 2 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
1. Use one of the following prefixes:

- `library_`
- `profiler_`
- `profiling_`
- `tracing_`

2. Add the new file to `run_all.sh` in this directory.
Expand All @@ -14,7 +14,7 @@
`validate_benchmarks_spec.rb` as follows:

- `library_` prefix: `spec/validate_benchmarks_spec.rb`
- `profiler_` prefix: `./spec/datadog/profiling/validate_benchmarks_spec.rb`
- `profiling_` prefix: `./spec/datadog/profiling/validate_benchmarks_spec.rb`
- `tracing_` prefix: `./spec/datadog/tracing/validate_benchmarks_spec.rb`

## Adding Benchmarks For a New Product
Expand Down
61 changes: 0 additions & 61 deletions benchmarks/profiler_string_storage_intern.rb

This file was deleted.

1 change: 0 additions & 1 deletion benchmarks/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ for file in \
`dirname "$0"`/profiler_sample_loop_v2.rb \
`dirname "$0"`/profiler_sample_serialize.rb \
`dirname "$0"`/profiler_sample_gvl.rb \
`dirname "$0"`/profiler_string_storage_intern.rb \
`dirname "$0"`/tracing_trace.rb;
do
bundle exec ruby "$file"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ static per_thread_context *get_or_create_context_for(VALUE thread, thread_contex
if (st_lookup(state->hash_map_per_thread_context, (st_data_t) thread, &value_context)) {
thread_context = (per_thread_context*) value_context;
} else {
thread_context = calloc(1, sizeof(per_thread_context)); // See "note on calloc vs ruby_xcalloc use" in heap_recorder.c
thread_context = ruby_xcalloc(1, sizeof(per_thread_context));
initialize_context(thread, thread_context, state);
st_insert(state->hash_map_per_thread_context, (st_data_t) thread, (st_data_t) thread_context);
}
Expand Down Expand Up @@ -1123,7 +1123,7 @@ static void initialize_context(VALUE thread, per_thread_context *thread_context,

static void free_context(per_thread_context* thread_context) {
sampling_buffer_free(thread_context->sampling_buffer);
free(thread_context); // See "note on calloc vs ruby_xcalloc use" in heap_recorder.c
ruby_xfree(thread_context);
}

static VALUE _native_inspect(DDTRACE_UNUSED VALUE _self, VALUE collector_instance) {
Expand Down
Loading

0 comments on commit 30f6e21

Please sign in to comment.