OSDN Git Service

Perfprofd: Move proto to its own static library
authorAndreas Gampe <agampe@google.com>
Thu, 29 Mar 2018 17:03:13 +0000 (10:03 -0700)
committerAndreas Gampe <agampe@google.com>
Fri, 30 Mar 2018 03:53:02 +0000 (20:53 -0700)
In order to break dependency cycles, move the record proto to its
own library.

(cherry picked from commit a145b35d4780b4f81a8355bb3fe58a79af8a06f0)

Bug: 73175642
Test: mmma system/extras/perfprofd
Merged-In: I0931a59c82d92e2c9c2e702dbc89f76cd9804919
Change-Id: I0931a59c82d92e2c9c2e702dbc89f76cd9804919

perfprofd/Android.bp
perfprofd/dropbox/Android.bp

index 04c10b1..7cecbe9 100644 (file)
@@ -51,6 +51,41 @@ cc_defaults {
     ],
 }
 
+// Static library for the record proto and its I/O.
+
+cc_library_static {
+    name: "libperfprofd_record_proto",
+    defaults: [
+        "perfprofd_defaults",
+    ],
+    host_supported: true,
+    target: {
+        darwin: {
+            enabled: false,
+        },
+    },
+
+    static_libs: [
+        "libbase",
+        "libprotobuf-cpp-lite",
+        "libquipper",
+        "libz",
+    ],
+    srcs: [
+        "perfprofd_io.cc",
+        "perfprofd_record.proto",
+    ],
+
+    proto: {
+        export_proto_headers: true,
+        include_dirs: ["external/perf_data_converter/src/quipper"],
+        type: "lite",
+    },
+
+    export_include_dirs: ["."],  // Really only the -fwd.h.
+    export_static_lib_headers: ["libquipper"],
+}
+
 //
 // Static library containing guts of AWP daemon.
 //
@@ -72,24 +107,18 @@ cc_defaults {
         "libsimpleperf_elf_read",
     ],
     whole_static_libs: [
+        "libperfprofd_record_proto",
         "libquipper",
     ],
     srcs: [
-        "perfprofd_record.proto",
         "perf_data_converter.cc",
         "configreader.cc",
         "cpuconfig.cc",
         "perfprofdcore.cc",
         "perfprofd_cmdline.cc",
-        "perfprofd_io.cc",
         "symbolizer.cc"
     ],
 
-    proto: {
-        export_proto_headers: true,
-        include_dirs: ["external/perf_data_converter/src/quipper"],
-        type: "lite",
-    },
     cflags: [
         "-Wno-gnu-anonymous-struct",
     ],
index 72c749b..c3b8f3b 100644 (file)
@@ -27,7 +27,7 @@ cc_library_static {
     export_include_dirs: ["."],
     static_libs: [
         "libbase",
-        "libperfprofdcore",
+        "libperfprofd_record_proto",
         "libprotobuf-cpp-lite",
     ],
     target: {