Separate merge from dump and call merge periodically

Every time merge is called by the thread loop,
the data is also processed and written to
PerformanceAnalysis. A call to dump retrieves
the FIFO of processed data in PerformanceAnalysis
instead of the unprocessed Reader FIFO, and prints
the result to the console.

Test: dumpsys media.log

Change-Id: Ic479f48e9e4fdf4523a8f15db514dbdd85b70434
diff --git a/media/libnbaio/PerformanceAnalysis.cpp b/media/libnbaio/PerformanceAnalysis.cpp
index fb3bddc..d44dd45 100644
--- a/media/libnbaio/PerformanceAnalysis.cpp
+++ b/media/libnbaio/PerformanceAnalysis.cpp
@@ -271,7 +271,6 @@
         ALOGD("reportPerformance: mRecentHists is empty");
         return;
     }
-    ALOGD("reportPerformance: hists size %d", static_cast<int>(mRecentHists.size()));
     // TODO: more elaborate data analysis
     std::map<int, int> buckets;
     for (const auto &shortHist: mRecentHists) {
@@ -306,6 +305,7 @@
         scalingFactor = (height + maxHeight) / maxHeight;
         height /= scalingFactor;
     }
+    // TODO: print reader (author) ID
     body->appendFormat("\n%*s", leftPadding + 11, "Occurrences");
     // write histogram label line with bucket values
     body->appendFormat("\n%s", " ");