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

Unified Diff: runtime/bin/main.cc

Issue 2996803002: Add current rss and embedder name to Observatory (Closed)
Patch Set: Managing null currentRSS in graph tooltip Created 3 years, 4 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 | « no previous file | runtime/bin/process_android.cc » ('j') | runtime/bin/process_android.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index a430f8d1f5185e299cf76eb85f6ab822e6397667..2533fa3a8ee361e854e0e705aed806162d2e579f 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -1356,6 +1356,22 @@ static bool FileModifiedCallback(const char* url, int64_t since) {
return modified;
}
+static const Dart_EmbedderInformation* GetEmbedderInformationCallback() {
+ static Dart_EmbedderInformation information = {
zra 2017/08/10 22:19:50 The VM could pass in a pointer to a Dart_EmbedderI
cbernaschina 2017/08/10 22:40:28 That was the first idea, the main problem is relat
zra 2017/08/10 22:49:46 I'm not sure this simple call is the right API for
cbernaschina 2017/08/12 00:29:41 Done.
+ "Dart VM", // name
+ 0, // current_rss
+ 0 // max_rss
+ };
+
+ int64_t max_rss = Process::MaxRSS();
+ int64_t current_rss = Process::CurrentRSS();
+
+ information.max_rss = max_rss >= 0 ? max_rss : 0;
+ information.current_rss = current_rss >= 0 ? current_rss : 0;
+
+ return &information;
+}
+
static void GenerateAppAOTSnapshot() {
if (use_blobs) {
Snapshot::GenerateAppAOTAsBlobs(snapshot_filename);
@@ -1864,6 +1880,7 @@ void main(int argc, char** argv) {
Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback,
&ServiceStreamCancelCallback);
Dart_SetFileModifiedCallback(&FileModifiedCallback);
+ Dart_SetGetEmbedderInformationCallback(&GetEmbedderInformationCallback);
// Run the main isolate until we aren't told to restart.
while (RunMainIsolate(script_name, &dart_options)) {
« no previous file with comments | « no previous file | runtime/bin/process_android.cc » ('j') | runtime/bin/process_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698