Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05c92d2b authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Gerrit Code Review
Browse files

Merge "liblog: Add BM_is_loggable benchmark"

parents a5669861 1ac79cbd
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -266,3 +266,17 @@ static void BM_log_delay(int iters) {
    android_logger_list_free(logger_list);
    android_logger_list_free(logger_list);
}
}
BENCHMARK(BM_log_delay);
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);