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

Unified Diff: runtime/bin/main.cc

Issue 2994223002: Restore "Add current rss and embedder name to Observatory" (Closed)
Patch Set: 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') | no next file with comments »
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 28d64117c9295c7ff2598bd977dada3777cdb1c1..ffbc2e738135cdef6550cf493f225e9792d5d9a9 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -1359,6 +1359,16 @@ static bool FileModifiedCallback(const char* url, int64_t since) {
return modified;
}
+static void EmbedderInformationCallback(Dart_EmbedderInformation* info) {
+ int64_t max_rss = Process::MaxRSS();
+ int64_t current_rss = Process::CurrentRSS();
+
+ info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION;
+ info->name = "Dart VM";
+ info->max_rss = max_rss >= 0 ? max_rss : 0;
+ info->current_rss = current_rss >= 0 ? current_rss : 0;
+}
+
static void GenerateAppAOTSnapshot() {
if (use_blobs) {
Snapshot::GenerateAppAOTAsBlobs(snapshot_filename);
@@ -1808,6 +1818,7 @@ void main(int argc, char** argv) {
Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback,
&ServiceStreamCancelCallback);
Dart_SetFileModifiedCallback(&FileModifiedCallback);
+ Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback);
// 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698