Using histograms for timing statistics.

  Histogram class and test cases added.
  Modified make file to add test cases and class file.
  Added a guard to avoid race condition in Cumulative logger that
  was possible race between Addlogger and Dump() functions.

Change-Id: I060a0d65648c7120963856624e7008c0aa681eb7
diff --git a/src/gc/mark_sweep.cc b/src/gc/mark_sweep.cc
index 81d5e17..8240d11 100644
--- a/src/gc/mark_sweep.cc
+++ b/src/gc/mark_sweep.cc
@@ -25,6 +25,7 @@
 #include "base/logging.h"
 #include "base/macros.h"
 #include "base/mutex-inl.h"
+#include "base/timing_logger.h"
 #include "card_table.h"
 #include "card_table-inl.h"
 #include "heap.h"
@@ -45,7 +46,6 @@
 #include "runtime.h"
 #include "space.h"
 #include "space_bitmap-inl.h"
-#include "timing_logger.h"
 #include "thread.h"
 #include "thread_list.h"
 #include "verifier/method_verifier.h"
@@ -139,7 +139,7 @@
       large_object_lock_("large object lock"),
       mark_stack_expand_lock_("mark stack expand lock"),
       timings_(GetName(), true),
-      cumulative_timings_(GetName(), true),
+      cumulative_timings_(GetName()),
       is_concurrent_(is_concurrent) {
   cumulative_timings_.SetName(GetName());
   ResetCumulativeStatistics();
@@ -829,18 +829,6 @@
   MarkSweep* mark_sweep_;
 };
 
-Barrier& MarkSweep::GetBarrier() {
-  return *gc_barrier_;
-}
-
-const TimingLogger& MarkSweep::GetTimings() const {
-  return timings_;
-}
-
-const CumulativeLogger& MarkSweep::GetCumulativeTimings() const {
-  return cumulative_timings_;
-}
-
 void MarkSweep::ResetCumulativeStatistics() {
   cumulative_timings_.Reset();
   total_time_ = 0;
diff --git a/src/gc/mark_sweep.h b/src/gc/mark_sweep.h
index 0d43bee..859f309 100644
--- a/src/gc/mark_sweep.h
+++ b/src/gc/mark_sweep.h
@@ -20,11 +20,11 @@
 #include "atomic_integer.h"
 #include "base/macros.h"
 #include "base/mutex.h"
+#include "base/timing_logger.h"
 #include "garbage_collector.h"
 #include "gc_type.h"
 #include "offsets.h"
 #include "root_visitor.h"
-#include "timing_logger.h"
 #include "UniquePtr.h"
 
 namespace art {
@@ -233,9 +233,18 @@
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
       EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_);
 
-  Barrier& GetBarrier();
-  const TimingLogger& GetTimings() const;
-  const CumulativeLogger& GetCumulativeTimings() const;
+  Barrier& GetBarrier() {
+    return *gc_barrier_;
+  }
+
+  TimingLogger& GetTimings() {
+    return timings_;
+  }
+
+  CumulativeLogger& GetCumulativeTimings() {
+    return cumulative_timings_;
+  }
+
   void ResetCumulativeStatistics();
 
  protected: