Skip to content

Commit 6c77ebc

Browse files
committed
Revert whitespace-only changes (blank lines)
1 parent 962845d commit 6c77ebc

File tree

13 files changed

+0
-52
lines changed

13 files changed

+0
-52
lines changed

ext/datadog_profiling_native_extension/private_vm_api_access.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,13 @@
4646
#else
4747
#define DDTRACE_UNUSED
4848
#endif
49-
5049
extern VALUE eNativeRuntimeError;
5150
extern VALUE eNativeArgumentError;
5251
extern VALUE eNativeTypeError;
53-
5452
// Declare exception class globals from ruby_helpers.h
5553
// (We can't include ruby_helpers.h here as it pulls in public Ruby headers that conflict with private VM headers)
5654
#define raise_error(native_exception_class, fmt, ...) \
5755
_raise_error(native_exception_class, "" fmt, ##__VA_ARGS__)
58-
5956
NORETURN(
6057
void _raise_error(VALUE native_exception_class, const char *fmt, ...)
6158
__attribute__ ((format (printf, 2, 3)));

ext/datadog_profiling_native_extension/profiling.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ void DDTRACE_EXPORT Init_datadog_profiling_native_extension(void) {
5454

5555
rb_define_singleton_method(native_extension_module, "native_working?", native_working_p, 0);
5656
rb_funcall(native_extension_module, rb_intern("private_class_method"), 1, ID2SYM(rb_intern("native_working?")));
57-
5857
// Exception classes defined in Ruby, in the `Datadog::Profiling` namespace
5958
eNativeRuntimeError = rb_const_get(profiling_module, rb_intern("NativeRuntimeError"));
6059
rb_global_variable(&eNativeRuntimeError);

ext/datadog_profiling_native_extension/ruby_helpers.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ static ID _id2ref_id = Qnil;
1212
static ID inspect_id = Qnil;
1313
static ID to_s_id = Qnil;
1414
static ID new_id = 0;
15-
1615
// Global references to Datadog::Profiling exception classes defined in Ruby.
1716
VALUE eNativeRuntimeError = Qnil;
1817
VALUE eNativeArgumentError = Qnil;
@@ -27,7 +26,6 @@ void ruby_helpers_init(void) {
2726
to_s_id = rb_intern("to_s");
2827
new_id = rb_intern("new");
2928
}
30-
3129
// Raises a NativeError exception with seperate telemetry-safe and detailed messages.
3230
void _raise_native_error(VALUE native_exception_class, const char *detailed_message, VALUE static_message) {
3331
#ifdef DD_DEBUG
@@ -38,7 +36,6 @@ void _raise_native_error(VALUE native_exception_class, const char *detailed_mess
3836
"Must be one of eNativeRuntimeError, eNativeArgumentError, or eNativeTypeError, was: %s", rb_class2name(native_exception_class));
3937
}
4038
#endif
41-
4239
VALUE exception = rb_funcall(
4340
native_exception_class,
4441
new_id,
@@ -50,15 +47,13 @@ void _raise_native_error(VALUE native_exception_class, const char *detailed_mess
5047
}
5148

5249
#define MAX_RAISE_MESSAGE_SIZE 256
53-
5450
// Use `raise_error` the macro instead, as it provides additional argument checks.
5551
void _raise_error(VALUE native_exception_class, const char *fmt, ...) {
5652
va_list args;
5753
va_start(args, fmt);
5854
char formatted_msg[MAX_RAISE_MESSAGE_SIZE];
5955
vsnprintf(formatted_msg, MAX_RAISE_MESSAGE_SIZE, fmt, args);
6056
va_end(args);
61-
6257
_raise_native_error(native_exception_class, formatted_msg, rb_str_new_cstr(fmt));
6358
}
6459

@@ -97,11 +92,9 @@ void _grab_gvl_and_raise(VALUE native_exception_class, const char *format_string
9792
"grab_gvl_and_raise called by thread holding the global VM lock: %%s (%s)",
9893
rb_class2name(native_exception_class)
9994
);
100-
10195
// Render the full exception message.
10296
char exception_message[MAX_RAISE_MESSAGE_SIZE];
10397
snprintf(exception_message, MAX_RAISE_MESSAGE_SIZE, telemetry_message, args.exception_message);
104-
10598
_raise_native_error(eNativeRuntimeError, exception_message, rb_str_new_cstr(telemetry_message));
10699
}
107100

ext/datadog_profiling_native_extension/ruby_helpers.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ static inline int check_if_pending_exception(void) {
4444
extern VALUE eNativeRuntimeError;
4545
extern VALUE eNativeArgumentError;
4646
extern VALUE eNativeTypeError;
47-
4847
// Raises an exception of the specified class with the formatted string as its message.
4948
// This macro ensures that the literay string is sent for telemetry, while the formatted
5049
// message is the default `Exception#message`.
@@ -53,7 +52,6 @@ extern VALUE eNativeTypeError;
5352
// the telemetry-safe string: NativeRuntimeError, NativeArgumentError, NativeTypeError.
5453
#define raise_error(native_exception_class, fmt, ...) \
5554
_raise_error(native_exception_class, "" fmt, ##__VA_ARGS__)
56-
5755
NORETURN(
5856
void _raise_error(VALUE native_exception_class, const char *fmt, ...)
5957
__attribute__ ((format (printf, 2, 3)));

lib/datadog/core/telemetry/logging.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,10 @@ def error(description)
7171

7272
log!(event)
7373
end
74-
7574
private
76-
7775
# A constant string representing the exception
7876
def message_for_telemety(exception)
7977
return unless exception.respond_to?(:telemetry_message)
80-
8178
exception.telemetry_message
8279
end
8380
end

lib/datadog/profiling.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,22 @@ def self.wait_until_running(timeout_seconds: 5)
7676
raise 'Profiler not enabled or available'
7777
end
7878
end
79-
8079
# Base error type for exceptions raised by our native extensions.
8180
# These errors have both the original error message and a telemetry-safe message.
8281
# The telemetry-safe message is statically defined and does not possess dynamic data.
8382
module NativeError
8483
attr_reader :telemetry_message
85-
8684
def initialize(message, telemetry_message = nil)
8785
super(message)
8886
@telemetry_message = telemetry_message
8987
end
9088
end
91-
9289
class NativeRuntimeError < RuntimeError
9390
prepend NativeError
9491
end
95-
9692
class NativeArgumentError < ArgumentError
9793
prepend NativeError
9894
end
99-
10095
class NativeTypeError < TypeError
10196
prepend NativeError
10297
end

sig/datadog/core/telemetry/logging.rbs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ module Datadog
1515
def report: (Exception exception, ?level: Symbol, ?description: String?) -> void
1616

1717
def error: (String description) -> void
18-
1918
private
20-
2119
def constant_exception_message: (Exception exception) -> String?
2220
end
2321
end

sig/datadog/profiling.rbs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@ module Datadog
22
module Profiling
33
class NativeError < RuntimeError
44
attr_reader telemetry_message: String?
5-
65
def initialize: (*untyped args, **untyped kwargs) -> void
76
end
8-
97
ProfilingError: singleton(NativeError)
108
ProfilingInternalError: singleton(NativeError)
11-
129
def self.supported?: () -> bool
1310
def self.unsupported_reason: () -> ::String?
1411
def self.start_if_enabled: () -> bool

spec/datadog/core/telemetry/logging_spec.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,27 +82,23 @@ def log!(_event)
8282
end
8383
end
8484
end
85-
8685
context 'with NativeError' do
8786
before do
8887
skip unless defined?(Datadog::Profiling::NativeError)
8988
end
90-
9189
it 'includes the telemetry-safe message in telemetry' do
9290
expect(component).to receive(:log!).with(instance_of(Datadog::Core::Telemetry::Event::Log)) do |event|
9391
expect(event.payload).to include(
9492
logs: [{message: 'Datadog::Profiling::NativeRuntimeError: (This is a safe profiler error)', level: 'ERROR', count: 1,
9593
stack_trace: a_string_including('REDACTED')}]
9694
)
9795
end
98-
9996
begin
10097
raise Datadog::Profiling::NativeRuntimeError.new('This is a safe profiler error', telemetry_message: 'This is a safe profiler error')
10198
rescue => e
10299
component.report(e, level: :error)
103100
end
104101
end
105-
106102
context 'with description' do
107103
it 'includes both description and telemetry message' do
108104
expect(component).to receive(:log!).with(instance_of(Datadog::Core::Telemetry::Event::Log)) do |event|
@@ -111,15 +107,13 @@ def log!(_event)
111107
stack_trace: a_string_including('REDACTED')}]
112108
)
113109
end
114-
115110
begin
116111
raise Datadog::Profiling::NativeRuntimeError.new('Failed to initialize native extension', telemetry_message: 'Failed to initialize native extension')
117112
rescue => e
118113
component.report(e, level: :error, description: 'Profiler failed to start')
119114
end
120115
end
121116
end
122-
123117
context 'without telemetry message' do
124118
it 'omits the dynamic exception message from telemetry' do
125119
expect(component).to receive(:log!).with(instance_of(Datadog::Core::Telemetry::Event::Log)) do |event|
@@ -129,15 +123,13 @@ def log!(_event)
129123
)
130124
expect(event.payload[:logs].map { |log| log[:message] }).not_to include(/Failed to initialize.*0x[0-9a-f]+/)
131125
end
132-
133126
begin
134127
raise Datadog::Profiling::NativeRuntimeError, 'Failed to initialize string storage: Error at address 0xdeadbeef'
135128
rescue => e
136129
component.report(e, level: :error)
137130
end
138131
end
139132
end
140-
141133
context 'with telemetry message and dynamic content' do
142134
it 'includes only the telemetry-safe message' do
143135
expect(component).to receive(:log!).with(instance_of(Datadog::Core::Telemetry::Event::Log)) do |event|
@@ -147,15 +139,13 @@ def log!(_event)
147139
)
148140
expect(event.payload[:logs].map { |log| log[:message] }).not_to include('Dynamic info 0xabc123')
149141
end
150-
151142
begin
152143
raise Datadog::Profiling::NativeRuntimeError.new('Static format string', 'Dynamic info 0xabc123')
153144
rescue => e
154145
component.report(e, level: :error)
155146
end
156147
end
157148
end
158-
159149
context 'with description and dynamic content' do
160150
it 'includes the description but not the dynamic exception message' do
161151
expect(component).to receive(:log!).with(instance_of(Datadog::Core::Telemetry::Event::Log)) do |event|
@@ -165,7 +155,6 @@ def log!(_event)
165155
)
166156
expect(event.payload[:logs].map { |log| log[:message] }).not_to include(/memory address/)
167157
end
168-
169158
begin
170159
raise Datadog::Profiling::NativeRuntimeError, 'Failed to serialize profile: Invalid memory address 0x12345678'
171160
rescue => e

spec/datadog/profiling/collectors/code_provenance_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
platform_fragment = RUBY_PLATFORM
2525
hyphenated_platform_fragment = platform_fragment.sub(/darwin(\d+)/, 'darwin-\1')
26-
2726
expect(generate_result).to include(
2827
{
2928
kind: "standard library",
@@ -56,7 +55,6 @@
5655

5756
it "includes the native extension directory for gems with native extensions" do
5857
refresh
59-
6058
platform_fragment = RUBY_PLATFORM
6159
hyphenated_platform_fragment = platform_fragment.sub(/darwin(\d+)/, 'darwin-\1')
6260

0 commit comments

Comments
 (0)