Add a new type of profile data in ART profiler

This CL allows the ART profiler to collect bounded stack information
that contains only method signature and dex pc on the current stack
frames to a bounded depth. The type of the profile data is by
default disabled, and can be enabled by setting the option
"-Xprofile-type:stack". The bound is controlled by the option
"-Xprofile-max-stack-depth:integervalue".

Change-Id: Ieab789951018b2263c4d140b40b6c73bffc6a549
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index 7cdd8f5..e1e133f 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -567,8 +567,12 @@
       }
     } else if (option == "-Xprofile-type:method") {
       profiler_options_.profile_type_ = kProfilerMethod;
-    } else if (option == "-Xprofile-type:dexpc") {
-      profiler_options_.profile_type_ = kProfilerMethodAndDexPC;
+    } else if (option == "-Xprofile-type:stack") {
+      profiler_options_.profile_type_ = kProfilerBoundedStack;
+    } else if (StartsWith(option, "-Xprofile-max-stack-depth:")) {
+      if (!ParseUnsignedInteger(option, ':', &profiler_options_.max_stack_depth_)) {
+        return false;
+      }
     } else if (StartsWith(option, "-implicit-checks:")) {
       std::string checks;
       if (!ParseStringAfterChar(option, ':', &checks)) {
@@ -812,7 +816,8 @@
   UsageMessage(stream, "  -Xprofile-start-immediately\n");
   UsageMessage(stream, "  -Xprofile-top-k-threshold:doublevalue\n");
   UsageMessage(stream, "  -Xprofile-top-k-change-threshold:doublevalue\n");
-  UsageMessage(stream, "  -Xprofile-type:{method,dexpc}\n");
+  UsageMessage(stream, "  -Xprofile-type:{method,stack}\n");
+  UsageMessage(stream, "  -Xprofile-max-stack-depth:integervalue\n");
   UsageMessage(stream, "  -Xcompiler:filename\n");
   UsageMessage(stream, "  -Xcompiler-option dex2oat-option\n");
   UsageMessage(stream, "  -Ximage-compiler-option dex2oat-option\n");