blob: fd3324887dd753e2b5c5b026561a4471e8d42929 [file] [log] [blame]
Calin Juravle4d77b6a2015-12-01 18:38:09 +00001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "profile_saver.h"
18
Calin Juravle86a9ebe2016-02-24 10:13:09 +000019#include <sys/types.h>
20#include <sys/stat.h>
21#include <fcntl.h>
22
Calin Juravle4d77b6a2015-12-01 18:38:09 +000023#include "art_method-inl.h"
Mathieu Chartierdabdc0f2016-03-04 14:58:03 -080024#include "base/systrace.h"
Calin Juravle4d77b6a2015-12-01 18:38:09 +000025#include "scoped_thread_state_change.h"
26#include "oat_file_manager.h"
27
28namespace art {
29
Calin Juravle932a0512016-01-19 14:32:26 -080030// An arbitrary value to throttle save requests. Set to 2s for now.
Calin Juravle4d77b6a2015-12-01 18:38:09 +000031static constexpr const uint64_t kMilisecondsToNano = 1000000;
Calin Juravle932a0512016-01-19 14:32:26 -080032static constexpr const uint64_t kMinimumTimeBetweenCodeCacheUpdatesNs = 2000 * kMilisecondsToNano;
Calin Juravle4d77b6a2015-12-01 18:38:09 +000033
34// TODO: read the constants from ProfileOptions,
35// Add a random delay each time we go to sleep so that we don't hammer the CPU
36// with all profile savers running at the same time.
Calin Juravle815759a2016-03-14 17:32:49 +000037static constexpr const uint64_t kRandomDelayMaxMs = 40 * 1000; // 40 seconds
Calin Juravle932a0512016-01-19 14:32:26 -080038static constexpr const uint64_t kMaxBackoffMs = 5 * 60 * 1000; // 5 minutes
Calin Juravle815759a2016-03-14 17:32:49 +000039static constexpr const uint64_t kSavePeriodMs = 40 * 1000; // 40 seconds
Mathieu Chartier8913fc12015-12-09 16:38:30 -080040static constexpr const uint64_t kInitialDelayMs = 2 * 1000; // 2 seconds
Calin Juravle4d77b6a2015-12-01 18:38:09 +000041static constexpr const double kBackoffCoef = 1.5;
42
43static constexpr const uint32_t kMinimumNrOrMethodsToSave = 10;
44
45ProfileSaver* ProfileSaver::instance_ = nullptr;
46pthread_t ProfileSaver::profiler_pthread_ = 0U;
47
48ProfileSaver::ProfileSaver(const std::string& output_filename,
49 jit::JitCodeCache* jit_code_cache,
Calin Juravle86a9ebe2016-02-24 10:13:09 +000050 const std::vector<std::string>& code_paths,
51 const std::string& foreign_dex_profile_path,
52 const std::string& app_data_dir)
Calin Juravleb4eddd22016-01-13 15:52:33 -080053 : jit_code_cache_(jit_code_cache),
Calin Juravle86a9ebe2016-02-24 10:13:09 +000054 foreign_dex_profile_path_(foreign_dex_profile_path),
Calin Juravle4d77b6a2015-12-01 18:38:09 +000055 code_cache_last_update_time_ns_(0),
56 shutting_down_(false),
Mathieu Chartier8913fc12015-12-09 16:38:30 -080057 first_profile_(true),
Calin Juravle4d77b6a2015-12-01 18:38:09 +000058 wait_lock_("ProfileSaver wait lock"),
Calin Juravlec19c1c22016-03-09 15:37:48 +000059 period_condition_("ProfileSaver period condition", wait_lock_),
60 total_bytes_written_(0),
61 total_number_of_writes_(0),
62 total_number_of_code_cache_queries_(0),
63 total_number_of_skipped_writes_(0),
64 total_number_of_failed_writes_(0),
65 total_ns_of_sleep_(0),
66 total_ns_of_work_(0),
67 total_number_of_foreign_dex_marks_(0) {
Calin Juravleb4eddd22016-01-13 15:52:33 -080068 AddTrackedLocations(output_filename, code_paths);
Calin Juravle86a9ebe2016-02-24 10:13:09 +000069 app_data_dir_ = "";
70 if (!app_data_dir.empty()) {
71 // The application directory is used to determine which dex files are owned by app.
72 // Since it could be a symlink (e.g. /data/data instead of /data/user/0), and we
73 // don't have control over how the dex files are actually loaded (symlink or canonical path),
74 // store it's canonical form to be sure we use the same base when comparing.
75 UniqueCPtr<const char[]> app_data_dir_real_path(realpath(app_data_dir.c_str(), nullptr));
76 if (app_data_dir_real_path != nullptr) {
77 app_data_dir_.assign(app_data_dir_real_path.get());
78 } else {
79 LOG(WARNING) << "Failed to get the real path for app dir: " << app_data_dir_
80 << ". The app dir will not be used to determine which dex files belong to the app";
81 }
82 }
Calin Juravle4d77b6a2015-12-01 18:38:09 +000083}
84
85void ProfileSaver::Run() {
86 srand(MicroTime() * getpid());
87 Thread* self = Thread::Current();
88
89 uint64_t save_period_ms = kSavePeriodMs;
90 VLOG(profiler) << "Save profiling information every " << save_period_ms << " ms";
Calin Juravle4d77b6a2015-12-01 18:38:09 +000091
Mathieu Chartier8913fc12015-12-09 16:38:30 -080092 bool first_iteration = true;
93 while (!ShuttingDown(self)) {
94 uint64_t sleep_time_ms;
95 if (first_iteration) {
96 // Sleep less long for the first iteration since we want to record loaded classes shortly
97 // after app launch.
98 sleep_time_ms = kInitialDelayMs;
99 } else {
100 const uint64_t random_sleep_delay_ms = rand() % kRandomDelayMaxMs;
101 sleep_time_ms = save_period_ms + random_sleep_delay_ms;
102 }
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000103 {
104 MutexLock mu(self, wait_lock_);
105 period_condition_.TimedWait(self, sleep_time_ms, 0);
106 }
Calin Juravlec19c1c22016-03-09 15:37:48 +0000107 total_ns_of_sleep_ += sleep_time_ms;
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000108 if (ShuttingDown(self)) {
109 break;
110 }
111
Calin Juravlec19c1c22016-03-09 15:37:48 +0000112 uint64_t start = NanoTime();
113
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000114 if (!ProcessProfilingInfo() && save_period_ms < kMaxBackoffMs) {
115 // If we don't need to save now it is less likely that we will need to do
116 // so in the future. Increase the time between saves according to the
117 // kBackoffCoef, but make it no larger than kMaxBackoffMs.
118 save_period_ms = static_cast<uint64_t>(kBackoffCoef * save_period_ms);
119 } else {
120 // Reset the period to the initial value as it's highly likely to JIT again.
121 save_period_ms = kSavePeriodMs;
122 }
Mathieu Chartier8913fc12015-12-09 16:38:30 -0800123 first_iteration = false;
Calin Juravlec19c1c22016-03-09 15:37:48 +0000124
125 total_ns_of_work_ += (NanoTime() - start);
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000126 }
127}
128
129bool ProfileSaver::ProcessProfilingInfo() {
Mathieu Chartierdabdc0f2016-03-04 14:58:03 -0800130 ScopedTrace trace(__PRETTY_FUNCTION__);
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000131 uint64_t last_update_time_ns = jit_code_cache_->GetLastUpdateTimeNs();
Mathieu Chartier8913fc12015-12-09 16:38:30 -0800132 if (!first_profile_ && last_update_time_ns - code_cache_last_update_time_ns_
133 < kMinimumTimeBetweenCodeCacheUpdatesNs) {
Calin Juravle877fd962016-01-05 14:29:29 +0000134 VLOG(profiler) << "Not enough time has passed since the last code cache update."
135 << "Last update: " << last_update_time_ns
136 << " Last save: " << code_cache_last_update_time_ns_;
Calin Juravlec19c1c22016-03-09 15:37:48 +0000137 total_number_of_skipped_writes_++;
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000138 return false;
139 }
140
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000141 code_cache_last_update_time_ns_ = last_update_time_ns;
Calin Juravleb4eddd22016-01-13 15:52:33 -0800142 SafeMap<std::string, std::set<std::string>> tracked_locations;
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000143 {
Calin Juravleb4eddd22016-01-13 15:52:33 -0800144 // Make a copy so that we don't hold the lock while doing I/O.
145 MutexLock mu(Thread::Current(), *Locks::profiler_lock_);
146 tracked_locations = tracked_dex_base_locations_;
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000147 }
Calin Juravleb4eddd22016-01-13 15:52:33 -0800148 for (const auto& it : tracked_locations) {
149 if (ShuttingDown(Thread::Current())) {
150 return true;
151 }
152 const std::string& filename = it.first;
153 const std::set<std::string>& locations = it.second;
154 std::vector<ArtMethod*> methods;
155 {
156 ScopedObjectAccess soa(Thread::Current());
157 jit_code_cache_->GetCompiledArtMethods(locations, methods);
Calin Juravlec19c1c22016-03-09 15:37:48 +0000158 total_number_of_code_cache_queries_++;
Calin Juravleb4eddd22016-01-13 15:52:33 -0800159 }
Mathieu Chartier8913fc12015-12-09 16:38:30 -0800160 // Always save for the first one for loaded classes profile.
161 if (methods.size() < kMinimumNrOrMethodsToSave && !first_profile_) {
Calin Juravleb4eddd22016-01-13 15:52:33 -0800162 VLOG(profiler) << "Not enough information to save to: " << filename
163 <<" Nr of methods: " << methods.size();
Calin Juravlec19c1c22016-03-09 15:37:48 +0000164 total_number_of_skipped_writes_++;
Calin Juravleb4eddd22016-01-13 15:52:33 -0800165 return false;
166 }
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000167
Mathieu Chartier8913fc12015-12-09 16:38:30 -0800168 std::set<DexCacheResolvedClasses> resolved_classes;
169 if (first_profile_) {
170 ClassLinker* const class_linker = Runtime::Current()->GetClassLinker();
171 resolved_classes = class_linker->GetResolvedClasses(/*ignore boot classes*/true);
172 }
173
Calin Juravlec19c1c22016-03-09 15:37:48 +0000174 uint64_t bytes_written;
175 if (!ProfileCompilationInfo::SaveProfilingInfo(filename, methods,
176 resolved_classes,
177 &bytes_written)) {
Calin Juravleb4eddd22016-01-13 15:52:33 -0800178 LOG(WARNING) << "Could not save profiling info to " << filename;
Calin Juravlec19c1c22016-03-09 15:37:48 +0000179 total_number_of_failed_writes_++;
Calin Juravleb4eddd22016-01-13 15:52:33 -0800180 return false;
Calin Juravlec19c1c22016-03-09 15:37:48 +0000181 } else {
182 if (bytes_written > 0) {
183 total_number_of_writes_++;
184 total_bytes_written_ += bytes_written;
185 }
Calin Juravleb4eddd22016-01-13 15:52:33 -0800186 }
Calin Juravleb4eddd22016-01-13 15:52:33 -0800187 }
Mathieu Chartier8913fc12015-12-09 16:38:30 -0800188 first_profile_ = false;
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000189 return true;
190}
191
192void* ProfileSaver::RunProfileSaverThread(void* arg) {
193 Runtime* runtime = Runtime::Current();
194 ProfileSaver* profile_saver = reinterpret_cast<ProfileSaver*>(arg);
195
196 CHECK(runtime->AttachCurrentThread("Profile Saver",
197 /*as_daemon*/true,
198 runtime->GetSystemThreadGroup(),
199 /*create_peer*/true));
200 profile_saver->Run();
201
202 runtime->DetachCurrentThread();
203 VLOG(profiler) << "Profile saver shutdown";
204 return nullptr;
205}
206
207void ProfileSaver::Start(const std::string& output_filename,
208 jit::JitCodeCache* jit_code_cache,
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000209 const std::vector<std::string>& code_paths,
210 const std::string& foreign_dex_profile_path,
211 const std::string& app_data_dir) {
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000212 DCHECK(Runtime::Current()->UseJit());
213 DCHECK(!output_filename.empty());
214 DCHECK(jit_code_cache != nullptr);
215
216 MutexLock mu(Thread::Current(), *Locks::profiler_lock_);
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000217 if (instance_ != nullptr) {
Calin Juravleb4eddd22016-01-13 15:52:33 -0800218 // If we already have an instance, make sure it uses the same jit_code_cache.
219 // This may be called multiple times via Runtime::registerAppInfo (e.g. for
220 // apps which share the same runtime).
221 DCHECK_EQ(instance_->jit_code_cache_, jit_code_cache);
222 // Add the code_paths to the tracked locations.
223 instance_->AddTrackedLocations(output_filename, code_paths);
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000224 return;
225 }
226
227 VLOG(profiler) << "Starting profile saver using output file: " << output_filename
228 << ". Tracking: " << Join(code_paths, ':');
229
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000230 instance_ = new ProfileSaver(output_filename,
231 jit_code_cache,
232 code_paths,
233 foreign_dex_profile_path,
234 app_data_dir);
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000235
236 // Create a new thread which does the saving.
237 CHECK_PTHREAD_CALL(
238 pthread_create,
239 (&profiler_pthread_, nullptr, &RunProfileSaverThread, reinterpret_cast<void*>(instance_)),
240 "Profile saver thread");
241}
242
Calin Juravlec19c1c22016-03-09 15:37:48 +0000243void ProfileSaver::Stop(bool dump_info) {
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000244 ProfileSaver* profile_saver = nullptr;
245 pthread_t profiler_pthread = 0U;
246
247 {
248 MutexLock profiler_mutex(Thread::Current(), *Locks::profiler_lock_);
Calin Juravleb4eddd22016-01-13 15:52:33 -0800249 VLOG(profiler) << "Stopping profile saver thread";
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000250 profile_saver = instance_;
251 profiler_pthread = profiler_pthread_;
252 if (instance_ == nullptr) {
253 DCHECK(false) << "Tried to stop a profile saver which was not started";
254 return;
255 }
256 if (instance_->shutting_down_) {
257 DCHECK(false) << "Tried to stop the profile saver twice";
258 return;
259 }
260 instance_->shutting_down_ = true;
Calin Juravlec19c1c22016-03-09 15:37:48 +0000261 if (dump_info) {
262 instance_->DumpInfo(LOG(INFO));
263 }
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000264 }
265
266 {
267 // Wake up the saver thread if it is sleeping to allow for a clean exit.
268 MutexLock wait_mutex(Thread::Current(), profile_saver->wait_lock_);
269 profile_saver->period_condition_.Signal(Thread::Current());
270 }
271
272 // Wait for the saver thread to stop.
273 CHECK_PTHREAD_CALL(pthread_join, (profiler_pthread, nullptr), "profile saver thread shutdown");
274
275 {
276 MutexLock profiler_mutex(Thread::Current(), *Locks::profiler_lock_);
277 instance_ = nullptr;
278 profiler_pthread_ = 0U;
279 }
280 delete profile_saver;
281}
282
283bool ProfileSaver::ShuttingDown(Thread* self) {
284 MutexLock mu(self, *Locks::profiler_lock_);
285 return shutting_down_;
286}
287
288bool ProfileSaver::IsStarted() {
289 MutexLock mu(Thread::Current(), *Locks::profiler_lock_);
290 return instance_ != nullptr;
291}
292
Calin Juravleb4eddd22016-01-13 15:52:33 -0800293void ProfileSaver::AddTrackedLocations(const std::string& output_filename,
294 const std::vector<std::string>& code_paths) {
295 auto it = tracked_dex_base_locations_.find(output_filename);
296 if (it == tracked_dex_base_locations_.end()) {
297 tracked_dex_base_locations_.Put(output_filename,
298 std::set<std::string>(code_paths.begin(), code_paths.end()));
299 } else {
300 it->second.insert(code_paths.begin(), code_paths.end());
301 }
302}
303
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000304void ProfileSaver::NotifyDexUse(const std::string& dex_location) {
305 std::set<std::string> app_code_paths;
306 std::string foreign_dex_profile_path;
307 std::string app_data_dir;
308 {
309 MutexLock mu(Thread::Current(), *Locks::profiler_lock_);
Calin Juravlec19c1c22016-03-09 15:37:48 +0000310 if (instance_ == nullptr) {
311 return;
312 }
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000313 // Make a copy so that we don't hold the lock while doing I/O.
314 for (const auto& it : instance_->tracked_dex_base_locations_) {
315 app_code_paths.insert(it.second.begin(), it.second.end());
316 }
317 foreign_dex_profile_path = instance_->foreign_dex_profile_path_;
318 app_data_dir = instance_->app_data_dir_;
319 }
320
Calin Juravlec19c1c22016-03-09 15:37:48 +0000321 bool mark_created = MaybeRecordDexUseInternal(dex_location,
322 app_code_paths,
323 foreign_dex_profile_path,
324 app_data_dir);
325 if (mark_created) {
326 MutexLock mu(Thread::Current(), *Locks::profiler_lock_);
327 if (instance_ != nullptr) {
328 instance_->total_number_of_foreign_dex_marks_++;
329 }
330 }
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000331}
332
Calin Juravlec19c1c22016-03-09 15:37:48 +0000333bool ProfileSaver::MaybeRecordDexUseInternal(
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000334 const std::string& dex_location,
335 const std::set<std::string>& app_code_paths,
336 const std::string& foreign_dex_profile_path,
337 const std::string& app_data_dir) {
Calin Juravle1fae45f2016-03-08 12:52:52 +0000338 if (dex_location.empty()) {
339 LOG(WARNING) << "Asked to record foreign dex use with an empty dex location.";
Calin Juravlec19c1c22016-03-09 15:37:48 +0000340 return false;
Calin Juravle1fae45f2016-03-08 12:52:52 +0000341 }
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000342 if (foreign_dex_profile_path.empty()) {
343 LOG(WARNING) << "Asked to record foreign dex use without a valid profile path ";
Calin Juravlec19c1c22016-03-09 15:37:48 +0000344 return false;
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000345 }
346
347 UniqueCPtr<const char[]> dex_location_real_path(realpath(dex_location.c_str(), nullptr));
Calin Juravle1fae45f2016-03-08 12:52:52 +0000348 if (dex_location_real_path == nullptr) {
349 PLOG(WARNING) << "Could not get realpath for " << dex_location;
350 }
351 std::string dex_location_real_path_str((dex_location_real_path == nullptr)
352 ? dex_location.c_str()
353 : dex_location_real_path.get());
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000354
355 if (dex_location_real_path_str.compare(0, app_data_dir.length(), app_data_dir) == 0) {
356 // The dex location is under the application folder. Nothing to record.
Calin Juravlec19c1c22016-03-09 15:37:48 +0000357 return false;
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000358 }
359
360 if (app_code_paths.find(dex_location) != app_code_paths.end()) {
361 // The dex location belongs to the application code paths. Nothing to record.
Calin Juravlec19c1c22016-03-09 15:37:48 +0000362 return false;
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000363 }
364 // Do another round of checks with the real paths.
365 // Note that we could cache all the real locations in the saver (since it's an expensive
366 // operation). However we expect that app_code_paths is small (usually 1 element), and
367 // NotifyDexUse is called just a few times in the app lifetime. So we make the compromise
368 // to save some bytes of memory usage.
369 for (const auto& app_code_location : app_code_paths) {
370 UniqueCPtr<const char[]> real_app_code_location(realpath(app_code_location.c_str(), nullptr));
Calin Juravle1fae45f2016-03-08 12:52:52 +0000371 if (real_app_code_location == nullptr) {
372 PLOG(WARNING) << "Could not get realpath for " << app_code_location;
373 }
374 std::string real_app_code_location_str((real_app_code_location == nullptr)
375 ? app_code_location.c_str()
376 : real_app_code_location.get());
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000377 if (real_app_code_location_str == dex_location_real_path_str) {
378 // The dex location belongs to the application code paths. Nothing to record.
Calin Juravlec19c1c22016-03-09 15:37:48 +0000379 return false;
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000380 }
381 }
382
383 // For foreign dex files we record a flag on disk. PackageManager will (potentially) take this
384 // into account when deciding how to optimize the loaded dex file.
385 // The expected flag name is the canonical path of the apk where '/' is substituted to '@'.
386 // (it needs to be kept in sync with
387 // frameworks/base/services/core/java/com/android/server/pm/PackageDexOptimizer.java)
388 std::replace(dex_location_real_path_str.begin(), dex_location_real_path_str.end(), '/', '@');
389 std::string flag_path = foreign_dex_profile_path + "/" + dex_location_real_path_str;
390 // No need to give any sort of access to flag_path. The system has enough permissions
391 // to test for its existence.
392 int fd = TEMP_FAILURE_RETRY(open(flag_path.c_str(), O_CREAT | O_EXCL, 0));
393 if (fd != -1) {
394 if (close(fd) != 0) {
395 PLOG(WARNING) << "Could not close file after flagging foreign dex use " << flag_path;
396 }
Calin Juravlec19c1c22016-03-09 15:37:48 +0000397 return true;
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000398 } else {
399 if (errno != EEXIST) {
400 // Another app could have already created the file.
401 PLOG(WARNING) << "Could not create foreign dex use mark " << flag_path;
Calin Juravlec19c1c22016-03-09 15:37:48 +0000402 return false;
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000403 }
Calin Juravlec19c1c22016-03-09 15:37:48 +0000404 return true;
Calin Juravle86a9ebe2016-02-24 10:13:09 +0000405 }
406}
407
Calin Juravlec19c1c22016-03-09 15:37:48 +0000408void ProfileSaver::DumpInstanceInfo(std::ostream& os) {
409 MutexLock mu(Thread::Current(), *Locks::profiler_lock_);
410 if (instance_ != nullptr) {
411 instance_->DumpInfo(os);
412 }
413}
414
415void ProfileSaver::DumpInfo(std::ostream& os) {
416 os << "ProfileSaver total_bytes_written=" << total_bytes_written_ << '\n'
417 << "ProfileSaver total_number_of_writes=" << total_number_of_writes_ << '\n'
418 << "ProfileSaver total_number_of_code_cache_queries=" << total_number_of_code_cache_queries_ << '\n'
419 << "ProfileSaver total_number_of_skipped_writes=" << total_number_of_skipped_writes_ << '\n'
420 << "ProfileSaver total_number_of_failed_writes=" << total_number_of_failed_writes_ << '\n'
421 << "ProfileSaver total_ms_of_sleep=" << (total_ns_of_sleep_ / kMilisecondsToNano) << '\n'
422 << "ProfileSaver total_ms_of_work=" << (total_ns_of_work_ / kMilisecondsToNano) << '\n'
423 << "ProfileSaver total_number_of_foreign_dex_marks=" << total_number_of_foreign_dex_marks_ << '\n';
424}
425
Calin Juravle4d77b6a2015-12-01 18:38:09 +0000426} // namespace art