summaryrefslogtreecommitdiffstats
path: root/fs_mgr/fs_mgr_priv.h
diff options
context:
space:
mode:
authorbowgotsai <bowgotsai@google.com>2017-01-23 14:04:34 +0800
committerbowgotsai <bowgotsai@google.com>2017-01-26 21:47:55 +0800
commit47878de7d12c7e438fcc584183b44893e91b4a28 (patch)
treebec3ad43d3cd93bac3b6aa22cdb5a18adf32356d /fs_mgr/fs_mgr_priv.h
parenta59c7bcc48121cd95f65f3a67560dc1d461fc85a (diff)
downloadsystem_core-47878de7d12c7e438fcc584183b44893e91b4a28.tar.gz
system_core-47878de7d12c7e438fcc584183b44893e91b4a28.tar.bz2
system_core-47878de7d12c7e438fcc584183b44893e91b4a28.zip
fs_mgr: Switch to LOG()/PLOG() defined in <android-base/logging.h>
This is the minimal change just to replace KLOG_{INFO, WARNING, ERROR} defined in <cutils/klog.h> to LOG()/PLOG() defined in <android-base/logging.h>. The logging.h uses program invocation name as the tag when logging. e.g., init logs will have "init: ..." at the beginning in each line. To facilitate debugging, this commit adds [libfs_mgr] after the tag, and the resulting output will like this: [ 11.278002] init: [libfs_mgr]Enabling dm-verity for system (mode 2) [ 11.283309] init: [libfs_mgr]loading verity table: '1 /dev/block/platform/soc.0/f9824900.sdhci/by-name/system ...' [ 11.337884] init: [libfs_mgr]Not running /system/bin/tune2fs on /dev/block/dm-0 (executable not in system image) [ 11.362281] init: [libfs_mgr]__mount(source=/dev/block/dm-0,target=/system,type=ext4)=0 [ 11.376331] init: [libfs_mgr]Requested quota status is match on /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor [ 11.398237] init: [libfs_mgr]__mount(source=/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor,target=/vendor,type=ext4)=0 [ 11.410735] init: [libfs_mgr]Requested quota status is match on /dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata [ 11.426783] init: [libfs_mgr]check_fs(): mount(/dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata,/data,ext4)=-1: Invalid argument [ 11.439154] init: [libfs_mgr]Running /system/bin/e2fsck on /dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata Bug: 34336098 Test: check device can boot Change-Id: Idcbaca1050e2d8eabe1e4510a0af03aa0312d03a
Diffstat (limited to 'fs_mgr/fs_mgr_priv.h')
-rw-r--r--fs_mgr/fs_mgr_priv.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/fs_mgr/fs_mgr_priv.h b/fs_mgr/fs_mgr_priv.h
index 0a27c7a3f..79c27c425 100644
--- a/fs_mgr/fs_mgr_priv.h
+++ b/fs_mgr/fs_mgr_priv.h
@@ -17,11 +17,9 @@
#ifndef __CORE_FS_MGR_PRIV_H
#define __CORE_FS_MGR_PRIV_H
-#include <cutils/klog.h>
+#include <android-base/logging.h>
#include <fs_mgr.h>
-#ifdef __cplusplus
-#include <android-base/logging.h>
/* The CHECK() in logging.h will use program invocation name as the tag.
* Thus, the log will have prefix "init: " when libfs_mgr is statically
* linked in the init process. This might be opaque when debugging.
@@ -29,13 +27,20 @@
* indicate the check happens in fs_mgr.
*/
#define FS_MGR_CHECK(x) CHECK(x) << "in libfs_mgr "
-#endif
-__BEGIN_DECLS
+#define FS_MGR_TAG "[libfs_mgr]"
-#define INFO(x...) KLOG_INFO("fs_mgr", x)
-#define WARNING(x...) KLOG_WARNING("fs_mgr", x)
-#define ERROR(x...) KLOG_ERROR("fs_mgr", x)
+// Logs a message to kernel
+#define LINFO LOG(INFO) << FS_MGR_TAG
+#define LWARNING LOG(WARNING) << FS_MGR_TAG
+#define LERROR LOG(ERROR) << FS_MGR_TAG
+
+// Logs a message with strerror(errno) at the end
+#define PINFO PLOG(INFO) << FS_MGR_TAG
+#define PWARNING PLOG(WARNING) << FS_MGR_TAG
+#define PERROR PLOG(ERROR) << FS_MGR_TAG
+
+__BEGIN_DECLS
#define CRYPTO_TMPFS_OPTIONS "size=256m,mode=0771,uid=1000,gid=1000"