Clean up the sampling profiler
- rename variables/fields names to match the code style (use
_underscore_names_)
- extract common property parsing in utils.cc
- fail to load profile file if any line is malformed
- added ProfileFile to manage the profile data generate in the previous
runs (replaces ProfileHelper and nests ProfileData)
Bug: 12877748
Change-Id: Ie7bda30bfdeb7e78534c986615b0649eac12a97b
diff --git a/runtime/utils.h b/runtime/utils.h
index 4a9236a..0f9b22b 100644
--- a/runtime/utils.h
+++ b/runtime/utils.h
@@ -28,6 +28,10 @@
#include "instruction_set.h"
#include "primitive.h"
+#ifdef HAVE_ANDROID_OS
+#include "cutils/properties.h"
+#endif
+
namespace art {
class DexFile;
@@ -439,6 +443,10 @@
}
};
+// Returns the given property as a double or its default_value if the property string is not valid
+// or the parsed value is outside the interval [min_value, max_value].
+double GetDoubleProperty(const char* property, double min_value, double max_value, double default_value);
+
} // namespace art
#endif // ART_RUNTIME_UTILS_H_