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

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

Issue 2608463002: Added isolate + thread high watermark tracking to Observatory (Closed)
Patch Set: Added tracking of memory usage inside of threads. In addition, the max memory usage is kept track o… Created 3 years, 11 months 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/thread.h ('k') | runtime/vm/thread_registry.h » ('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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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/thread.h" 5 #include "vm/thread.h"
6 6
7 #include "vm/compiler_stats.h" 7 #include "vm/compiler_stats.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 isolate_(NULL), 67 isolate_(NULL),
68 heap_(NULL), 68 heap_(NULL),
69 top_exit_frame_info_(0), 69 top_exit_frame_info_(0),
70 store_buffer_block_(NULL), 70 store_buffer_block_(NULL),
71 vm_tag_(0), 71 vm_tag_(0),
72 task_kind_(kUnknownTask), 72 task_kind_(kUnknownTask),
73 dart_stream_(NULL), 73 dart_stream_(NULL),
74 os_thread_(NULL), 74 os_thread_(NULL),
75 thread_lock_(new Monitor()), 75 thread_lock_(new Monitor()),
76 zone_(NULL), 76 zone_(NULL),
77 current_thread_memory_(0),
78 thread_memory_high_watermark_(0),
77 api_reusable_scope_(NULL), 79 api_reusable_scope_(NULL),
78 api_top_scope_(NULL), 80 api_top_scope_(NULL),
79 top_resource_(NULL), 81 top_resource_(NULL),
80 long_jump_base_(NULL), 82 long_jump_base_(NULL),
81 no_callback_scope_depth_(0), 83 no_callback_scope_depth_(0),
82 #if defined(DEBUG) 84 #if defined(DEBUG)
83 top_handle_scope_(NULL), 85 top_handle_scope_(NULL),
84 no_handle_scope_depth_(0), 86 no_handle_scope_depth_(0),
85 no_safepoint_scope_depth_(0), 87 no_safepoint_scope_depth_(0),
86 #endif 88 #endif
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 208
207 209
208 #ifndef PRODUCT 210 #ifndef PRODUCT
209 // Collect information about each individual zone associated with this thread. 211 // Collect information about each individual zone associated with this thread.
210 void Thread::PrintJSON(JSONStream* stream) const { 212 void Thread::PrintJSON(JSONStream* stream) const {
211 JSONObject jsobj(stream); 213 JSONObject jsobj(stream);
212 jsobj.AddProperty("type", "_Thread"); 214 jsobj.AddProperty("type", "_Thread");
213 jsobj.AddPropertyF("id", "threads/%" Pd "", 215 jsobj.AddPropertyF("id", "threads/%" Pd "",
214 OSThread::ThreadIdToIntPtr(os_thread()->trace_id())); 216 OSThread::ThreadIdToIntPtr(os_thread()->trace_id()));
215 jsobj.AddProperty("kind", TaskKindToCString(task_kind())); 217 jsobj.AddProperty("kind", TaskKindToCString(task_kind()));
218 jsobj.AddProperty("threadMemoryHighWatermark", thread_memory_high_watermark_);
216 Zone* zone = zone_; 219 Zone* zone = zone_;
217 { 220 {
218 JSONArray zone_info_array(&jsobj, "zones"); 221 JSONArray zone_info_array(&jsobj, "zones");
219 zone = zone_; 222 zone = zone_;
220 while (zone != NULL) { 223 while (zone != NULL) {
221 zone_info_array.AddValue(zone); 224 zone_info_array.AddValue(zone);
222 zone = zone->previous(); 225 zone = zone->previous();
223 } 226 }
224 } 227 }
225 } 228 }
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 818
816 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { 819 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() {
817 if (thread() != NULL) { 820 if (thread() != NULL) {
818 OSThread* os_thread = thread()->os_thread(); 821 OSThread* os_thread = thread()->os_thread();
819 ASSERT(os_thread != NULL); 822 ASSERT(os_thread != NULL);
820 os_thread->EnableThreadInterrupts(); 823 os_thread->EnableThreadInterrupts();
821 } 824 }
822 } 825 }
823 826
824 } // namespace dart 827 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/thread_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698