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

Unified Diff: runtime/vm/profiler.cc

Issue 118673002: Add flag to control profiler rate (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | tools/tracesummary.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler.cc
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index 694d18a30ddbcc17b98d41e5604698cd0d02d5ee..a4e12927e3fd6818125d05c8f046e3070742c807 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -37,12 +37,15 @@ namespace dart {
DEFINE_FLAG(bool, trace_profiled_isolates, false, "Trace profiled isolates.");
DEFINE_FLAG(charp, profile_dir, NULL,
"Enable writing profile data into specified directory.");
+DEFINE_FLAG(int, profile_period, 1000,
+ "Time between profiler samples in microseconds. Minimum 250.");
bool Profiler::initialized_ = false;
Monitor* Profiler::monitor_ = NULL;
SampleBuffer* Profiler::sample_buffer_ = NULL;
void Profiler::InitOnce() {
+ const int kMinimumProfilePeriod = 250;
if (!FLAG_profile) {
return;
}
@@ -52,6 +55,10 @@ void Profiler::InitOnce() {
sample_buffer_ = new SampleBuffer();
NativeSymbolResolver::InitOnce();
ThreadInterrupter::InitOnce();
+ if (FLAG_profile_period < kMinimumProfilePeriod) {
+ FLAG_profile_period = kMinimumProfilePeriod;
+ }
+ ThreadInterrupter::SetInterruptPeriod(FLAG_profile_period);
}
« no previous file with comments | « no previous file | tools/tracesummary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698