From 1723f3fcd1073896cc8d941a1e3b7d48f9a31af5 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Tue, 20 Sep 2016 16:14:20 +0000 Subject: [PATCH] Revert "Restrict pmsg use to eng builds." This reverts commit f894b96a9211dcefb83b175720b53a2e49b8e463. Kernel binaries have incorporated the performance-enhanced pmsg driver that has removed the bounce buffer. Bug: 31057326 Bug: 30375418 Change-Id: Id6cec3ac144f57e8e5465aa48bbdc829cf29e283 --- liblog/pmsg_writer.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/liblog/pmsg_writer.c b/liblog/pmsg_writer.c index b338dca4c..944febae8 100644 --- a/liblog/pmsg_writer.c +++ b/liblog/pmsg_writer.c @@ -31,8 +31,6 @@ #include #include -#include - #include "config_write.h" #include "log_portability.h" #include "logger.h" @@ -53,25 +51,8 @@ LIBLOG_HIDDEN struct android_log_transport_write pmsgLoggerWrite = { .write = pmsgWrite, }; -static bool pmsgShouldUse = false; - -// Only use pmsg on eng builds -static bool pmsgIsEng() { - char buf[PROP_VALUE_MAX]; - - if (__system_property_get("ro.build.type", buf) == 0) { - return false; - } - - if (!strncmp(buf, "eng", sizeof("eng"))) { - return true; - } - return false; -} - static int pmsgOpen() { - pmsgShouldUse = pmsgIsEng(); if (pmsgLoggerWrite.context.fd < 0) { pmsgLoggerWrite.context.fd = TEMP_FAILURE_RETRY(open("/dev/pmsg0", O_WRONLY | O_CLOEXEC)); } @@ -94,7 +75,7 @@ static int pmsgAvailable(log_id_t logId) } if ((logId != LOG_ID_SECURITY) && (logId != LOG_ID_EVENTS) && - (!pmsgShouldUse || !__android_log_is_debuggable())) { + !__android_log_is_debuggable()) { return -EINVAL; } if (pmsgLoggerWrite.context.fd < 0) { @@ -124,7 +105,7 @@ static int pmsgWrite(log_id_t logId, struct timespec *ts, size_t i, payloadSize; ssize_t ret; - if ((logId == LOG_ID_EVENTS) && (!pmsgShouldUse || !__android_log_is_debuggable())) { + if ((logId == LOG_ID_EVENTS) && !__android_log_is_debuggable()) { if (vec[0].iov_len < 4) { return -EINVAL; }