| Index: runtime/vm/profiler.cc
|
| diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
|
| index bf119f5dca02f3eee4432c03e9b18711201a8d7e..d57160340dc102db266ad05a6775b4efcaae73b2 100644
|
| --- a/runtime/vm/profiler.cc
|
| +++ b/runtime/vm/profiler.cc
|
| @@ -31,8 +31,6 @@ namespace dart {
|
| #endif
|
| DEFINE_FLAG(bool, trace_profiled_isolates, false, "Trace profiled isolates.");
|
| DEFINE_FLAG(bool, trace_profiler, false, "Trace profiler.");
|
| -DEFINE_FLAG(charp, profile_dir, NULL,
|
| - "Enable writing profile data into specified directory.");
|
| DEFINE_FLAG(int, profile_period, 1000,
|
| "Time between profiler samples in microseconds. Minimum 50.");
|
| DEFINE_FLAG(int, profile_depth, 8,
|
| @@ -1543,47 +1541,6 @@ void Profiler::PrintJSON(Isolate* isolate, JSONStream* stream,
|
| }
|
|
|
|
|
| -void Profiler::WriteProfile(Isolate* isolate) {
|
| - if (isolate == NULL) {
|
| - return;
|
| - }
|
| - if (!FLAG_profile) {
|
| - return;
|
| - }
|
| - ASSERT(initialized_);
|
| - if (FLAG_profile_dir == NULL) {
|
| - return;
|
| - }
|
| - Dart_FileOpenCallback file_open = Isolate::file_open_callback();
|
| - Dart_FileCloseCallback file_close = Isolate::file_close_callback();
|
| - Dart_FileWriteCallback file_write = Isolate::file_write_callback();
|
| - if ((file_open == NULL) || (file_close == NULL) || (file_write == NULL)) {
|
| - // Embedder has not provided necessary callbacks.
|
| - return;
|
| - }
|
| - // We will be looking up code objects within the isolate.
|
| - ASSERT(Isolate::Current() == isolate);
|
| - JSONStream stream(10 * MB);
|
| - intptr_t pid = OS::ProcessId();
|
| - PrintJSON(isolate, &stream, true, Profiler::kNoTags);
|
| - const char* format = "%s/dart-profile-%" Pd "-%" Pd ".json";
|
| - intptr_t len = OS::SNPrint(NULL, 0, format,
|
| - FLAG_profile_dir, pid, isolate->main_port());
|
| - char* filename = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
|
| - OS::SNPrint(filename, len + 1, format,
|
| - FLAG_profile_dir, pid, isolate->main_port());
|
| - void* f = file_open(filename, true);
|
| - if (f == NULL) {
|
| - // Cannot write.
|
| - return;
|
| - }
|
| - TextBuffer* buffer = stream.buffer();
|
| - ASSERT(buffer != NULL);
|
| - file_write(buffer->buf(), buffer->length(), f);
|
| - file_close(f);
|
| -}
|
| -
|
| -
|
| IsolateProfilerData::IsolateProfilerData(SampleBuffer* sample_buffer,
|
| bool own_sample_buffer) {
|
| ASSERT(sample_buffer != NULL);
|
|
|