Fixed and refactored profiler options handling
- extracted profiler options in a separate class
- switched from system property reading to command line arguments
- added profile based compilation options to CompilerOptions
- removed no longer used kProfile compilation filter
- optimize dex files only if the profiler is enabled
- clean up unused arguments
Bug: 12877748
Bug: 15275634
Change-Id: I37ff68e7694370950ce8db2360562e9058ecebb7
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 261429e..be07828 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -34,6 +34,7 @@
#include "instrumentation.h"
#include "jobject_comparator.h"
#include "object_callbacks.h"
+#include "profiler_options.h"
#include "quick/quick_method_frame_info.h"
#include "runtime_stats.h"
#include "safe_map.h"
@@ -114,6 +115,10 @@
return image_compiler_options_;
}
+ const ProfilerOptions& GetProfilerOptions() const {
+ return profiler_options_;
+ }
+
// Starts a runtime, which may cause threads to be started and code to run.
bool Start() UNLOCK_FUNCTION(Locks::mutator_lock_);
@@ -386,7 +391,7 @@
const std::vector<const DexFile*>& GetCompileTimeClassPath(jobject class_loader);
void SetCompileTimeClassPath(jobject class_loader, std::vector<const DexFile*>& class_path);
- void StartProfiler(const char* appDir, const char* procName);
+ void StartProfiler(const char* profile_output_filename);
void UpdateProfilerState(int state);
// Transaction support.
@@ -551,15 +556,9 @@
const bool running_on_valgrind_;
- // Runtime profile support.
- bool profile_;
std::string profile_output_filename_;
- uint32_t profile_period_s_; // Generate profile every n seconds.
- uint32_t profile_duration_s_; // Run profile for n seconds.
- uint32_t profile_interval_us_; // Microseconds between samples.
- double profile_backoff_coefficient_; // Coefficient to exponential backoff.
- bool profile_start_immediately_; // Whether the profile should start upon app
- // startup or be delayed by some random offset.
+ ProfilerOptions profiler_options_;
+ bool profiler_started_;
bool method_trace_;
std::string method_trace_file_;