Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: runtime/vm/service.cc

Issue 2583663002: Internally measure isolate uptime with monotonic time. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/scavenger.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
(...skipping 3767 matching lines...) Expand 10 before | Expand all | Expand 10 after
3778 }; 3778 };
3779 3779
3780 3780
3781 void Service::PrintJSONForVM(JSONStream* js, bool ref) { 3781 void Service::PrintJSONForVM(JSONStream* js, bool ref) {
3782 JSONObject jsobj(js); 3782 JSONObject jsobj(js);
3783 jsobj.AddProperty("type", (ref ? "@VM" : "VM")); 3783 jsobj.AddProperty("type", (ref ? "@VM" : "VM"));
3784 jsobj.AddProperty("name", GetVMName()); 3784 jsobj.AddProperty("name", GetVMName());
3785 if (ref) { 3785 if (ref) {
3786 return; 3786 return;
3787 } 3787 }
3788 Isolate* vm_isolate = Dart::vm_isolate();
3789 jsobj.AddProperty("architectureBits", static_cast<intptr_t>(kBitsPerWord)); 3788 jsobj.AddProperty("architectureBits", static_cast<intptr_t>(kBitsPerWord));
3790 jsobj.AddProperty("targetCPU", CPU::Id()); 3789 jsobj.AddProperty("targetCPU", CPU::Id());
3791 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); 3790 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware());
3792 jsobj.AddProperty("version", Version::String()); 3791 jsobj.AddProperty("version", Version::String());
3793 jsobj.AddProperty("_profilerMode", FLAG_profile_vm ? "VM" : "Dart"); 3792 jsobj.AddProperty("_profilerMode", FLAG_profile_vm ? "VM" : "Dart");
3794 jsobj.AddProperty64("pid", OS::ProcessId()); 3793 jsobj.AddProperty64("pid", OS::ProcessId());
3795 jsobj.AddProperty64("_maxRSS", OS::MaxRSS()); 3794 jsobj.AddProperty64("_maxRSS", OS::MaxRSS());
3796 int64_t start_time_millis = 3795 jsobj.AddPropertyTimeMillis(
3797 (vm_isolate->start_time() / kMicrosecondsPerMillisecond); 3796 "startTime", OS::GetCurrentTimeMillis() - Dart::UptimeMillis());
3798 jsobj.AddPropertyTimeMillis("startTime", start_time_millis);
3799 // Construct the isolate list. 3797 // Construct the isolate list.
3800 { 3798 {
3801 JSONArray jsarr(&jsobj, "isolates"); 3799 JSONArray jsarr(&jsobj, "isolates");
3802 ServiceIsolateVisitor visitor(&jsarr); 3800 ServiceIsolateVisitor visitor(&jsarr);
3803 Isolate::VisitIsolates(&visitor); 3801 Isolate::VisitIsolates(&visitor);
3804 } 3802 }
3805 } 3803 }
3806 3804
3807 3805
3808 static bool GetVM(Thread* thread, JSONStream* js) { 3806 static bool GetVM(Thread* thread, JSONStream* js) {
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
4124 if (strcmp(method_name, method.name) == 0) { 4122 if (strcmp(method_name, method.name) == 0) {
4125 return &method; 4123 return &method;
4126 } 4124 }
4127 } 4125 }
4128 return NULL; 4126 return NULL;
4129 } 4127 }
4130 4128
4131 #endif // !PRODUCT 4129 #endif // !PRODUCT
4132 4130
4133 } // namespace dart 4131 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/scavenger.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698