am 2bca03cd: am a76d2bb4: am 05c92d2b: Merge "liblog: Add BM_is_loggable benchmark"

* commit '2bca03cd0c8ad7f0d55b1d7f6acc03257077f854':
  liblog: Add BM_is_loggable benchmark
This commit is contained in:
Mark Salyzyn 2015-04-24 22:24:04 +00:00 committed by Android Git Automerger
commit 8b47d3ee65
1 changed files with 14 additions and 0 deletions

View File

@ -266,3 +266,17 @@ static void BM_log_delay(int iters) {
android_logger_list_free(logger_list);
}
BENCHMARK(BM_log_delay);
/*
* Measure the time it takes for __android_log_is_loggable.
*/
static void BM_is_loggable(int iters) {
StartBenchmarkTiming();
for (int i = 0; i < iters; ++i) {
__android_log_is_loggable(ANDROID_LOG_WARN, "logd", ANDROID_LOG_VERBOSE);
}
StopBenchmarkTiming();
}
BENCHMARK(BM_is_loggable);