Dump profile logs after the last save

The DumpInfo statement did not capture the last profile save.

Also, update -Xps-min-methods-to-save and -Xps-min-classes-to-save in
the art script. A value of 0 will attempt to write the profile even if
no method has been profiles and that's useless.

Test: ./out/host/linux-x86/bin/art --profile --64 -Ximage:$PWD/out/host/linux-x86/framework/core.art -Xusejit:true -Xcompiler-option --compiler-filter=speed-profile -Xcompiler-option --compiler-backend=Optimizing -verbose:oat -Djava.library.path=$PWD/out/x86_64/host/linux-x86/lib64 -cp $PWD/generated/benchmarks.dex benchmarks.ExoPlayerBench.java.ExoPlayerBench

Change-Id: I5927ab87d7c134c271fbc252e62fdc03ab02a255
diff --git a/runtime/jit/profile_saver.cc b/runtime/jit/profile_saver.cc
index e2bd1cb..9d6cd95 100644
--- a/runtime/jit/profile_saver.cc
+++ b/runtime/jit/profile_saver.cc
@@ -451,9 +451,6 @@
       return;
     }
     instance_->shutting_down_ = true;
-    if (dump_info) {
-      instance_->DumpInfo(LOG_STREAM(INFO));
-    }
   }
 
   {
@@ -470,6 +467,9 @@
 
   {
     MutexLock profiler_mutex(Thread::Current(), *Locks::profiler_lock_);
+    if (dump_info) {
+      instance_->DumpInfo(LOG_STREAM(INFO));
+    }
     instance_ = nullptr;
     profiler_pthread_ = 0U;
   }
diff --git a/tools/art b/tools/art
index 6e62ad1..933ad7a 100644
--- a/tools/art
+++ b/tools/art
@@ -230,8 +230,8 @@
   replace_compiler_filter_with_interepret_only "$@"
 
   run_art -Xjitsaveprofilinginfo               \
-          -Xps-min-methods-to-save:0           \
-          -Xps-min-classes-to-save:0           \
+          -Xps-min-methods-to-save:1           \
+          -Xps-min-classes-to-save:1           \
           -Xps-min-notification-before-wake:10 \
           -Xps-profile-path:$PROFILE_PATH      \
           -Xusejit:true                        \