@@ -105,8 +105,8 @@ public void withDebug1() throws Exception {
105
105
final String className = "com.datadog.debugger.CodeOrigin02" ;
106
106
installProbes ();
107
107
final Class <?> testClass = compileAndLoadClass (className );
108
- codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("entry" ), true );
109
- codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("exit" ), false );
108
+ codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("entry" ), true , true );
109
+ codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("exit" ), false , true );
110
110
checkResults (testClass , "fullTrace" , 0 );
111
111
checkResults (testClass , "debug_1" , 2 );
112
112
}
@@ -117,8 +117,8 @@ public void withLogProbe() throws Exception {
117
117
installProbes (
118
118
createProbeBuilder (PROBE_ID , CLASS_NAME , "entry" , "()" ).captureSnapshot (true ).build ());
119
119
final Class <?> testClass = compileAndLoadClass (CLASS_NAME );
120
- codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("entry" ), true );
121
- codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("exit" ), false );
120
+ codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("entry" ), true , true );
121
+ codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("exit" ), false , true );
122
122
checkResults (testClass , "debug_1" , 3 );
123
123
}
124
124
@@ -127,10 +127,13 @@ public void doubleEntry() throws IOException, URISyntaxException {
127
127
final String className = "com.datadog.debugger.CodeOrigin05" ;
128
128
129
129
installProbes (
130
- new CodeOriginProbe (CODE_ORIGIN_ID1 , true , Where .of (className , "entry" , "()" , "53" )),
131
- new CodeOriginProbe (CODE_ORIGIN_ID2 , false , Where .of (className , "exit" , "()" , "62" )),
130
+ new CodeOriginProbe (CODE_ORIGIN_ID1 , true , Where .of (className , "entry" , "()" , "53" ), true ),
131
+ new CodeOriginProbe (CODE_ORIGIN_ID2 , false , Where .of (className , "exit" , "()" , "62" ), true ),
132
132
new CodeOriginProbe (
133
- CODE_ORIGIN_DOUBLE_ENTRY_ID , true , Where .of (className , "doubleEntry" , "()" , "66" )));
133
+ CODE_ORIGIN_DOUBLE_ENTRY_ID ,
134
+ true ,
135
+ Where .of (className , "doubleEntry" , "()" , "66" ),
136
+ true ));
134
137
final Class <?> testClass = compileAndLoadClass (className );
135
138
checkResults (testClass , "fullTrace" , 0 );
136
139
List <? extends MutableSpan > trace = traceInterceptor .getTrace ();
@@ -143,7 +146,7 @@ public void doubleEntry() throws IOException, URISyntaxException {
143
146
public void stackDepth () throws IOException , URISyntaxException {
144
147
final String CLASS_NAME = "com.datadog.debugger.CodeOrigin04" ;
145
148
installProbes (
146
- new CodeOriginProbe (CODE_ORIGIN_ID1 , true , Where .of (CLASS_NAME , "exit" , "()" , "39" )));
149
+ new CodeOriginProbe (CODE_ORIGIN_ID1 , true , Where .of (CLASS_NAME , "exit" , "()" , "39" ), true ));
147
150
148
151
Class <?> testClass = compileAndLoadClass ("com.datadog.debugger.CodeOrigin04" );
149
152
countFrames (testClass , 10 );
@@ -187,7 +190,8 @@ public void testCaptureCodeOriginWithExplicitInfo()
187
190
installProbes ();
188
191
CodeOriginProbe probe =
189
192
codeOriginRecorder .getProbe (
190
- codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("main" , int .class ), true ));
193
+ codeOriginRecorder .captureCodeOrigin (
194
+ testClass .getMethod ("main" , int .class ), true , true ));
191
195
assertNotNull (probe , "The probe should have been created." );
192
196
assertTrue (probe .entrySpanProbe (), "Should be an entry probe." );
193
197
}
@@ -199,18 +203,18 @@ public void testDuplicateInstrumentations()
199
203
final Class <?> testClass = compileAndLoadClass (CLASS_NAME );
200
204
installProbes ();
201
205
String probe1 =
202
- codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("main" , int .class ), true );
206
+ codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("main" , int .class ), true , true );
203
207
String probe2 =
204
- codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("main" , int .class ), true );
208
+ codeOriginRecorder .captureCodeOrigin (testClass .getMethod ("main" , int .class ), true , true );
205
209
assertEquals (probe1 , probe2 );
206
210
}
207
211
208
212
@ NotNull
209
213
private CodeOriginProbe [] codeOriginProbes (String type ) {
210
214
CodeOriginProbe entry =
211
- new CodeOriginProbe (CODE_ORIGIN_ID1 , true , Where .of (type , "entry" , "()" , "53" ));
215
+ new CodeOriginProbe (CODE_ORIGIN_ID1 , true , Where .of (type , "entry" , "()" , "53" ), true );
212
216
CodeOriginProbe exit =
213
- new CodeOriginProbe (CODE_ORIGIN_ID2 , false , Where .of (type , "exit" , "()" , "60" ));
217
+ new CodeOriginProbe (CODE_ORIGIN_ID2 , false , Where .of (type , "exit" , "()" , "60" ), true );
214
218
return new CodeOriginProbe [] {entry , exit };
215
219
}
216
220
0 commit comments