1.關閉重定向
system/core/init/util.cpp
--- a/init/util.cpp
+++ b/init/util.cpp
@@ -454,7 +454,7 @@ static void InitAborter(const char* abort_message) {
// SetStdioToDevNull() must be called again in second stage init.
void SetStdioToDevNull(char** argv) {
// Make stdin/stdout/stderr all point to /dev/null.
- int fd = open("/dev/null", O_RDWR);
+/* int fd = open("/dev/null", O_RDWR);
if (fd == -1) {
int saved_errno = errno;
android::base::InitLogging(argv, &android::base::KernelLogger, InitAborter);
@@ -464,7 +464,7 @@ void SetStdioToDevNull(char** argv) {
dup2(fd, STDIN_FILENO);
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
- if (fd > STDERR_FILENO) close(fd);
+ if (fd > STDERR_FILENO) close(fd);*/
}
2. 修改打印速率
kernel/msm-4.9/include/linux/ratelimit.h
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 57c9e06..499156a 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -6,7 +6,7 @@
#include <linux/spinlock.h>
#define DEFAULT_RATELIMIT_INTERVAL (5 * HZ)
-#define DEFAULT_RATELIMIT_BURST 10
+#define DEFAULT_RATELIMIT_BURST 1000