Android.bp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. //
  2. // Copyright (C) 2016 The Android Open Source Project
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. cc_defaults {
  17. name: "perfprofd_defaults",
  18. cflags: [
  19. "-Wall",
  20. "-Wextra",
  21. "-Werror",
  22. // Try some more extreme warnings.
  23. "-Wpedantic",
  24. "-Wunreachable-code-aggressive",
  25. // And disable some dumb things.
  26. "-Wno-zero-length-array",
  27. "-Wno-c99-extensions",
  28. "-Wno-language-extension-token",
  29. "-Wno-gnu-zero-variadic-macro-arguments",
  30. "-Wno-nested-anon-types",
  31. "-Wno-gnu-statement-expression",
  32. "-Wno-vla-extension",
  33. ],
  34. cppflags: [
  35. "-Wno-sign-compare",
  36. "-Wno-unused-parameter",
  37. ],
  38. target: {
  39. darwin: {
  40. enabled: false,
  41. },
  42. },
  43. }
  44. cc_defaults {
  45. name: "perfprofd_debug_defaults",
  46. cflags: [
  47. "-O0",
  48. "-g",
  49. "-UNDEBUG",
  50. ],
  51. // Add sanitizers that work w/o extra libraries. This is important
  52. // for atest etc to work.
  53. sanitize: {
  54. integer_overflow: true,
  55. undefined: true,
  56. },
  57. // TODO: Re-enable when ART's ASAN flags are correctly propagated.
  58. // target: {
  59. // // On the host add ASAN.
  60. // host: {
  61. // sanitize: {
  62. // address: true,
  63. // },
  64. // },
  65. // }
  66. }
  67. filegroup {
  68. name: "perfprofd_record_proto",
  69. srcs: [
  70. "perfprofd_record.proto",
  71. ],
  72. }
  73. // Static library for the record proto and its I/O.
  74. cc_library_static {
  75. name: "libperfprofd_record_proto",
  76. defaults: [
  77. "perfprofd_defaults",
  78. ],
  79. host_supported: true,
  80. static_libs: [
  81. "libbase",
  82. "libprotobuf-cpp-lite",
  83. "libquipper",
  84. "libz",
  85. ],
  86. srcs: [
  87. "perfprofd_io.cc",
  88. ":perfprofd_record_proto",
  89. ],
  90. proto: {
  91. export_proto_headers: true,
  92. include_dirs: ["external/perf_data_converter/src/quipper"],
  93. type: "lite",
  94. },
  95. export_include_dirs: ["."], // Really only the -fwd.h.
  96. export_static_lib_headers: ["libquipper"],
  97. }
  98. filegroup {
  99. name: "perfprofd_config_proto",
  100. srcs: [
  101. "perfprofd_config.proto",
  102. ],
  103. }
  104. cc_library_static {
  105. name: "libperfprofd_proto_config",
  106. defaults: [
  107. "perfprofd_defaults",
  108. ],
  109. host_supported: true,
  110. static_libs: [
  111. "libprotobuf-cpp-lite",
  112. ],
  113. srcs: [
  114. ":perfprofd_config_proto",
  115. ],
  116. proto: {
  117. export_proto_headers: true,
  118. type: "lite",
  119. },
  120. export_include_dirs: ["."], // Really only the -fwd.h.
  121. }
  122. //
  123. // Static library containing guts of AWP daemon.
  124. //
  125. cc_defaults {
  126. name: "libperfprofdcore_defaults",
  127. defaults: [
  128. "perfprofd_defaults",
  129. ],
  130. host_supported: true,
  131. static_libs: [
  132. "libbase",
  133. "libperfprofd_proto_config",
  134. "libprotobuf-cpp-lite",
  135. "libsimpleperf_dex_read",
  136. "libsimpleperf_elf_read",
  137. ],
  138. whole_static_libs: [
  139. "libperfprofd_dropbox",
  140. "libperfprofd_record_proto",
  141. "libquipper",
  142. ],
  143. srcs: [
  144. "perf_data_converter.cc",
  145. "configreader.cc",
  146. "cpuconfig.cc",
  147. "perfprofdcore.cc",
  148. "perfprofd_cmdline.cc",
  149. "perfprofd_perf.cc",
  150. "symbolizer.cc"
  151. ],
  152. cflags: [
  153. "-Wno-gnu-anonymous-struct",
  154. ],
  155. export_include_dirs: ["."],
  156. target: {
  157. android: {
  158. static_libs: [
  159. "libhealthhalutils",
  160. ],
  161. shared_libs: [
  162. "[email protected]",
  163. "libhidlbase",
  164. ],
  165. }
  166. }
  167. }
  168. cc_library_static {
  169. name: "libperfprofdcore",
  170. defaults: [
  171. "libart_static_defaults",
  172. "libperfprofdcore_defaults",
  173. ],
  174. }
  175. // Debug version.
  176. cc_library_static {
  177. name: "libperfprofdcored",
  178. defaults: [
  179. "libartd_static_defaults",
  180. "libperfprofdcore_defaults",
  181. "perfprofd_debug_defaults",
  182. ],
  183. }
  184. //
  185. // Main daemon
  186. //
  187. cc_binary {
  188. name: "perfprofd",
  189. defaults: [
  190. "libart_static_defaults",
  191. "perfprofd_defaults",
  192. "libsimpleperf_dex_read_static_reqs_defaults",
  193. "libsimpleperf_elf_read_static_reqs_defaults",
  194. ],
  195. srcs: [
  196. "perfprofdmain.cc",
  197. ],
  198. static_libs: [
  199. "libhealthhalutils",
  200. "libperfprofdcore",
  201. "libperfprofd_binder",
  202. "libperfprofd_proto_config",
  203. "libsimpleperf_dex_read",
  204. "libsimpleperf_elf_read",
  205. ],
  206. group_static_libs: true,
  207. shared_libs: [
  208. "[email protected]",
  209. "liblog",
  210. "libprotobuf-cpp-lite",
  211. "libbase",
  212. "libbinder",
  213. "libhidlbase",
  214. "libservices",
  215. "libutils",
  216. ],
  217. init_rc: ["perfprofd.rc"],
  218. product_variables: {
  219. pdk: {
  220. enabled: false,
  221. },
  222. },
  223. // We're technically independent, but ensure simpleperf is there.
  224. required: [
  225. "simpleperf",
  226. ],
  227. }
  228. subdirs = [
  229. "binder_interface",
  230. "tests",
  231. ]