summaryrefslogtreecommitdiffstats
path: root/Android.bp
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2018-12-13 14:13:19 -0800
committerMathieu Chartier <mathieuc@google.com>2019-01-16 16:23:48 -0800
commit07e8cce91a7fec677ee7936ce71852a48145eaf3 (patch)
tree9824d2a9dfa84910c32af2651ceaf40aa592ad24 /Android.bp
parent202cb0a892690b490a263293633cc623b62ff946 (diff)
downloadplatform_system_iorap-07e8cce91a7fec677ee7936ce71852a48145eaf3.tar.gz
platform_system_iorap-07e8cce91a7fec677ee7936ce71852a48145eaf3.tar.bz2
platform_system_iorap-07e8cce91a7fec677ee7936ce71852a48145eaf3.zip
iorap: Add iorap.inode2filename command line binary
Maps a list of inodes into their filenames by scanning the filesystem. This is a separate binary that will be fork+execd by iorapd as a background job when it occasionally needs to map ftrace events (from perfetto) from inode numbers into actual filenames. The inode scanning is following a security requirement to be in a separate process, and an sepolicy CL will be added in a follow-up to grant limit file scanning privileges to this binary. Test: atest iorapd-tests # and also manual Bug: 72170747 Change-Id: I280aa62ce3cc1d7efdadc22b40bd1435496b7086
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp44
1 files changed, 44 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index c81e41c..5209683 100644
--- a/Android.bp
+++ b/Android.bp
@@ -63,8 +63,11 @@ cc_defaults {
"libutils",
"libcutils", // tracing.
+ "libfruit", // dependency injection.
// TODO: remove these annoying dependencies by hiding them in the main library code.
],
+
+ header_libs: ["librxcpp"],
}
cc_library_shared {
@@ -117,9 +120,48 @@ cc_binary {
],
}
+cc_library_static {
+ name: "libiorap-inode2filename",
+ defaults: [
+ "iorap-default-flags",
+ "iorap-default-dependencies",
+ ],
+
+ srcs: [
+ "src/inode2filename/**/*.cc",
+ ],
+}
+
+cc_binary {
+ name: "iorap.inode2filename",
+ defaults: [
+ "iorap-default-flags",
+ "iorap-default-dependencies",
+ ],
+ srcs: [
+ "src/inode2filename/**/*.cc",
+ ],
+ // Easier debugging. TODO: make a separate debug config.
+ // XX: Using -O0 seems to completely hide some errors.
+ cflags: ["-O2", "-UNDEBUG", "-DIORAP_INODE2FILENAME_MAIN=1"],
+ sanitize: {
+ undefined: true,
+ all_undefined: true,
+ // Pretty print when ubsan detects a problem.
+ // Otherwise it just calls abort().
+
+/*
+ diag: {
+ undefined: true,
+ },
+ */ // don't use the diag when you want it to crash.
+ },
+}
+
cc_test {
name: "iorapd-tests",
test_suites: ["device-tests"],
+ gtest: false, // we use gtest *and* gmock.
defaults: [
"iorap-default-flags",
"iorap-default-dependencies",
@@ -127,4 +169,6 @@ cc_test {
srcs: [
"tests/src/**/*.cc",
],
+ cflags: ["-O2", "-UNDEBUG"],
+ static_libs: ["libgmock_main", "libgmock", "libgtest", "libiorap-inode2filename"],
}