Some devices don't like all log buffers

This commit is contained in:
topjohnwu 2018-01-01 23:58:13 +08:00
parent e5c3183025
commit e733484fab
2 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@ static void *logger_thread(void *args) {
while (1) { while (1) {
// Start logcat // Start logcat
log_pid = exec_command(0, &log_fd, NULL, "logcat", "-b", "all" , "-v", "threadtime", "-s", "am_proc_start", "Magisk", NULL); log_pid = exec_command(0, &log_fd, NULL, "logcat", "-b", "events", "-b", "main", "-v", "threadtime", "-s", "am_proc_start", "-s", "Magisk", NULL);
while (fdgets(line, sizeof(line), log_fd)) { while (fdgets(line, sizeof(line), log_fd)) {
for (int i = 0; i < (sizeof(log_events) / sizeof(struct log_listener)); ++i) { for (int i = 0; i < (sizeof(log_events) / sizeof(struct log_listener)); ++i) {
if (log_events[i].fd > 0 && log_events[i].filter(line)) { if (log_events[i].fd > 0 && log_events[i].filter(line)) {
@ -74,7 +74,7 @@ static void *logger_thread(void *args) {
waitpid(log_pid, NULL, 0); waitpid(log_pid, NULL, 0);
// Clear buffer before restart // Clear buffer before restart
exec_command_sync("logcat", "-b", "all", "-c", NULL); exec_command_sync("logcat", "-b", "events", "-b", "main", "-c", NULL);
} }
// Should never be here, but well... // Should never be here, but well...

View File

@ -176,8 +176,8 @@ void proc_monitor() {
// Get the mount namespace of zygote // Get the mount namespace of zygote
zygote_num = 0; zygote_num = 0;
while(!zygote_num) { while(!zygote_num) {
// Check zygote every 2 secs // Check zygote every 10 ms
sleep(2); usleep(10000);
ps_filter_proc_name("zygote", store_zygote_ns); ps_filter_proc_name("zygote", store_zygote_ns);
} }
ps_filter_proc_name("zygote64", store_zygote_ns); ps_filter_proc_name("zygote64", store_zygote_ns);