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

Unified Diff: runtime/vm/thread_registry.cc

Issue 2609253002: Added isolate + thread high watermark tracking to Observatory (Closed)
Patch Set: Merge branch 'master' of github.com:dart-lang/sdk into resubmit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/thread_registry.h ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_registry.cc
diff --git a/runtime/vm/thread_registry.cc b/runtime/vm/thread_registry.cc
index 4694cc06a8771c7590f5e378d8bb171aefb851f3..1483b131ec656200fca367f46a2028489d1b0baa 100644
--- a/runtime/vm/thread_registry.cc
+++ b/runtime/vm/thread_registry.cc
@@ -170,6 +170,7 @@ Thread* ThreadRegistry::GetFromFreelistLocked(Isolate* isolate) {
return thread;
}
+
void ThreadRegistry::ReturnToFreelistLocked(Thread* thread) {
ASSERT(thread != NULL);
ASSERT(thread->os_thread_ == NULL);
@@ -181,4 +182,16 @@ void ThreadRegistry::ReturnToFreelistLocked(Thread* thread) {
free_list_ = thread;
}
+
+uint ThreadRegistry::ThreadHighWatermarksTotalLocked() const {
+ ASSERT(threads_lock()->IsOwnedByCurrentThread());
+ uint memory_high_watermarks_total = 0;
+ Thread* current = active_list_;
+ while (current != NULL) {
+ memory_high_watermarks_total += current->memory_high_watermark();
+ current = current->next_;
+ }
+ return memory_high_watermarks_total;
siva 2017/01/21 00:30:51 Why is it necessary to sum up the high water marks
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/thread_registry.h ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698