Loading fs_mgr/fs_mgr_main.c +0 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,6 @@ int main(int argc, char *argv[]) char *fstab_file=NULL; struct fstab *fstab=NULL; klog_init(); klog_set_level(6); parse_options(argc, argv, &a_flag, &u_flag, &n_flag, &n_name, &n_blk_dev); Loading @@ -111,4 +110,3 @@ int main(int argc, char *argv[]) /* Should not get here */ exit(1); } include/cutils/klog.h +0 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ __BEGIN_DECLS void klog_init(void); int klog_get_level(void); void klog_set_level(int level); /* TODO: void klog_close(void); - and make klog_fd users thread safe. */ void klog_write(int level, const char *fmt, ...) __attribute__ ((format(printf, 2, 3))); Loading init/init.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -477,7 +477,6 @@ int main(int argc, char** argv) { // kmsg and null, otherwise we won't be able to remount / read-only // later on. Now that tmpfs is mounted on /dev, we can actually talk // to the outside world. open_devnull_stdio(); InitKernelLogging(argv); LOG(INFO) << "init " << (is_first_stage ? "first stage" : "second stage") << " started!"; Loading init/log.cpp +16 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,11 @@ #include "log.h" #include <fcntl.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/uio.h> #include <selinux/selinux.h> Loading Loading @@ -51,9 +54,20 @@ static void KernelLogger(android::base::LogId, android::base::LogSeverity severi } void InitKernelLogging(char* argv[]) { // Make stdin/stdout/stderr all point to /dev/null. int fd = open("/sys/fs/selinux/null", O_RDWR); if (fd == -1) { int saved_errno = errno; android::base::InitLogging(argv, &KernelLogger); errno = saved_errno; PLOG(FATAL) << "Couldn't open /sys/fs/selinux/null"; } dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); if (fd > 2) close(fd); klog_init(); android::base::InitLogging(argv, &KernelLogger); klog_set_level(KLOG_NOTICE_LEVEL); } Loading init/readme.txt +2 −2 Original line number Diff line number Diff line Loading @@ -518,5 +518,5 @@ Alternatively, use the emulator: emulator -partition-size 1024 -verbose -show-kernel -no-window You might want to call klog_set_level(6) after the klog_init() call so you see the kernel logging in dmesg (or the emulator output). You might want to change the klog_set_level call so you see all the kernel logging in dmesg (or the emulator output). Loading
fs_mgr/fs_mgr_main.c +0 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,6 @@ int main(int argc, char *argv[]) char *fstab_file=NULL; struct fstab *fstab=NULL; klog_init(); klog_set_level(6); parse_options(argc, argv, &a_flag, &u_flag, &n_flag, &n_name, &n_blk_dev); Loading @@ -111,4 +110,3 @@ int main(int argc, char *argv[]) /* Should not get here */ exit(1); }
include/cutils/klog.h +0 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ __BEGIN_DECLS void klog_init(void); int klog_get_level(void); void klog_set_level(int level); /* TODO: void klog_close(void); - and make klog_fd users thread safe. */ void klog_write(int level, const char *fmt, ...) __attribute__ ((format(printf, 2, 3))); Loading
init/init.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -477,7 +477,6 @@ int main(int argc, char** argv) { // kmsg and null, otherwise we won't be able to remount / read-only // later on. Now that tmpfs is mounted on /dev, we can actually talk // to the outside world. open_devnull_stdio(); InitKernelLogging(argv); LOG(INFO) << "init " << (is_first_stage ? "first stage" : "second stage") << " started!"; Loading
init/log.cpp +16 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,11 @@ #include "log.h" #include <fcntl.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/uio.h> #include <selinux/selinux.h> Loading Loading @@ -51,9 +54,20 @@ static void KernelLogger(android::base::LogId, android::base::LogSeverity severi } void InitKernelLogging(char* argv[]) { // Make stdin/stdout/stderr all point to /dev/null. int fd = open("/sys/fs/selinux/null", O_RDWR); if (fd == -1) { int saved_errno = errno; android::base::InitLogging(argv, &KernelLogger); errno = saved_errno; PLOG(FATAL) << "Couldn't open /sys/fs/selinux/null"; } dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); if (fd > 2) close(fd); klog_init(); android::base::InitLogging(argv, &KernelLogger); klog_set_level(KLOG_NOTICE_LEVEL); } Loading
init/readme.txt +2 −2 Original line number Diff line number Diff line Loading @@ -518,5 +518,5 @@ Alternatively, use the emulator: emulator -partition-size 1024 -verbose -show-kernel -no-window You might want to call klog_set_level(6) after the klog_init() call so you see the kernel logging in dmesg (or the emulator output). You might want to change the klog_set_level call so you see all the kernel logging in dmesg (or the emulator output).