Skip to content

Commit fcce34d

Browse files
bkonyiathomas
authored andcommitted
[ Service ] Disable CPU sample block streaming
See #46825 TEST=vm/cc/Profiler_* and service tests Change-Id: I98faa1953a3bf3c28828dabaa0be6b033ada63fb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209260 Commit-Queue: Siva Annamalai <[email protected]> Reviewed-by: Siva Annamalai <[email protected]>
1 parent 63c1548 commit fcce34d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

pkg/vm_service/test/cpu_samples_stream_test.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import 'dart:async';
66

7-
import 'package:test/test.dart';
7+
// TODO(bkonyi): re-import after sample streaming is fixed.
8+
// import 'package:test/test.dart';
89
import 'package:vm_service/vm_service.dart';
910

1011
import 'common/service_test_common.dart';
@@ -31,7 +32,9 @@ late StreamSubscription sub;
3132

3233
var tests = <IsolateTest>[
3334
(VmService service, IsolateRef isolate) async {
34-
final completer = Completer<void>();
35+
// TODO(bkonyi): re-enable after sample streaming is fixed.
36+
// See https://github.com/dart-lang/sdk/issues/46825
37+
/*final completer = Completer<void>();
3538
int count = 0;
3639
int previousOrigin = 0;
3740
sub = service.onProfilerEvent.listen((event) async {
@@ -56,6 +59,7 @@ var tests = <IsolateTest>[
5659
5760
await completer.future;
5861
await service.streamCancel(EventStreams.kProfiler);
62+
*/
5963
},
6064
];
6165

runtime/vm/profiler.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@ Sample* SampleBlockBuffer::ReserveSampleImpl(Isolate* isolate,
306306
Sample* sample = nullptr;
307307
if (block != nullptr) {
308308
sample = block->ReserveSample();
309+
if (sample != nullptr && block->is_full()) {
310+
// TODO(bkonyi): remove once streaming is re-enabled.
311+
// https://github.com/dart-lang/sdk/issues/46825
312+
block->evictable_ = true;
313+
FreeBlock(block);
314+
}
309315
}
310316
if (sample != nullptr) {
311317
return sample;
@@ -330,8 +336,11 @@ Sample* SampleBlockBuffer::ReserveSampleImpl(Isolate* isolate,
330336
isolate->set_current_sample_block(next);
331337
}
332338
next->set_is_allocation_block(allocation_sample);
339+
333340
can_process_block_.store(true);
334-
isolate->mutator_thread()->ScheduleInterrupts(Thread::kVMInterrupt);
341+
// TODO(bkonyi): re-enable after block streaming is fixed.
342+
// See https://github.com/dart-lang/sdk/issues/46825
343+
// isolate->mutator_thread()->ScheduleInterrupts(Thread::kVMInterrupt);
335344
return ReserveSampleImpl(isolate, allocation_sample);
336345
}
337346

0 commit comments

Comments
 (0)