Merge "Fix format string for new google benchmark" am: a850fb2d1e
am: a6c903cabb
Change-Id: Ib0d88d24aaa6782c62e25ac50727b12435180439
diff --git a/liblog/tests/liblog_benchmark.cpp b/liblog/tests/liblog_benchmark.cpp
index 7d11ccf..21d12a1 100644
--- a/liblog/tests/liblog_benchmark.cpp
+++ b/liblog/tests/liblog_benchmark.cpp
@@ -56,8 +56,8 @@
*/
static void BM_log_maximum_retry(benchmark::State& state) {
while (state.KeepRunning()) {
- LOG_FAILURE_RETRY(__android_log_print(
- ANDROID_LOG_INFO, "BM_log_maximum_retry", "%zu", state.iterations()));
+ LOG_FAILURE_RETRY(__android_log_print(ANDROID_LOG_INFO, "BM_log_maximum_retry", "%" PRIu64,
+ state.iterations()));
}
}
BENCHMARK(BM_log_maximum_retry);
@@ -69,8 +69,7 @@
*/
static void BM_log_maximum(benchmark::State& state) {
while (state.KeepRunning()) {
- __android_log_print(ANDROID_LOG_INFO, "BM_log_maximum", "%zu",
- state.iterations());
+ __android_log_print(ANDROID_LOG_INFO, "BM_log_maximum", "%" PRIu64, state.iterations());
}
}
BENCHMARK(BM_log_maximum);
@@ -286,7 +285,7 @@
memset(buf, 0, sizeof(buf));
struct packet* buffer = (struct packet*)(((uintptr_t)buf + 7) & ~7);
if (((uintptr_t)&buffer->pmsg_header) & 7) {
- fprintf(stderr, "&buffer=0x%p iterations=%zu\n", &buffer->pmsg_header,
+ fprintf(stderr, "&buffer=0x%p iterations=%" PRIu64 "\n", &buffer->pmsg_header,
state.iterations());
}
@@ -361,7 +360,7 @@
memset(buf, 0, sizeof(buf));
struct packet* buffer = (struct packet*)((((uintptr_t)buf + 7) & ~7) + 1);
if ((((uintptr_t)&buffer->pmsg_header) & 7) != 1) {
- fprintf(stderr, "&buffer=0x%p iterations=%zu\n", &buffer->pmsg_header,
+ fprintf(stderr, "&buffer=0x%p iterations=%" PRIu64 "\n", &buffer->pmsg_header,
state.iterations());
}
@@ -436,7 +435,7 @@
memset(buf, 0, sizeof(buf));
struct packet* buffer = (struct packet*)(((uintptr_t)buf + 7) & ~7);
if (((uintptr_t)&buffer->pmsg_header) & 7) {
- fprintf(stderr, "&buffer=0x%p iterations=%zu\n", &buffer->pmsg_header,
+ fprintf(stderr, "&buffer=0x%p iterations=%" PRIu64 "\n", &buffer->pmsg_header,
state.iterations());
}
@@ -509,7 +508,7 @@
memset(buf, 0, sizeof(buf));
struct packet* buffer = (struct packet*)((((uintptr_t)buf + 7) & ~7) + 1);
if ((((uintptr_t)&buffer->pmsg_header) & 7) != 1) {
- fprintf(stderr, "&buffer=0x%p iterations=%zu\n", &buffer->pmsg_header,
+ fprintf(stderr, "&buffer=0x%p iterations=%" PRIu64 "\n", &buffer->pmsg_header,
state.iterations());
}
@@ -560,7 +559,7 @@
/* performance test */
static void BM_sprintf_overhead(benchmark::State& state) {
while (state.KeepRunning()) {
- test_print("BM_sprintf_overhead:%zu", state.iterations());
+ test_print("BM_sprintf_overhead:%" PRIu64, state.iterations());
state.PauseTiming();
logd_yield();
state.ResumeTiming();
@@ -575,8 +574,7 @@
*/
static void BM_log_print_overhead(benchmark::State& state) {
while (state.KeepRunning()) {
- __android_log_print(ANDROID_LOG_INFO, "BM_log_overhead", "%zu",
- state.iterations());
+ __android_log_print(ANDROID_LOG_INFO, "BM_log_overhead", "%" PRIu64, state.iterations());
state.PauseTiming();
logd_yield();
state.ResumeTiming();