1package { 2 default_applicable_licenses: ["Android-Apache-2.0"], 3 default_team: "trendy_team_system_performance", 4} 5 6aconfig_declarations { 7 name: "uprobestats_flags", 8 package: "android.uprobestats.flags", 9 container: "system", 10 srcs: ["flag.aconfig"], 11} 12 13aconfig_declarations { 14 name: "uprobestats_mainline_flags", 15 package: "android.uprobestats.mainline.flags", 16 container: "com.android.uprobestats", 17 srcs: ["mainline-flag.aconfig"], 18} 19 20cc_aconfig_library { 21 name: "uprobestats_flags_c_lib", 22 aconfig_declarations: "uprobestats_flags", 23 apex_available: [ 24 "//apex_available:platform", 25 "com.android.uprobestats", 26 ], 27 min_sdk_version: "36", 28} 29 30cc_aconfig_library { 31 name: "uprobestats_mainline_flags_c_lib", 32 aconfig_declarations: "uprobestats_mainline_flags", 33 apex_available: [ 34 "//apex_available:platform", 35 "com.android.uprobestats", 36 ], 37 min_sdk_version: "36", 38} 39 40java_aconfig_library { 41 name: "uprobestats_flags_java_lib", 42 aconfig_declarations: "uprobestats_flags", 43 host_supported: true, 44} 45 46java_aconfig_library { 47 name: "art_flags_uprobestats_java_lib", 48 aconfig_declarations: "art-aconfig-flags", 49 host_supported: true, 50} 51 52java_aconfig_library { 53 name: "uprobestats_mainline_flags_java_lib", 54 aconfig_declarations: "uprobestats_mainline_flags", 55 host_supported: true, 56 visibility: [ 57 "//cts/hostsidetests/statsdatom:__subpackages__", 58 ], 59} 60 61rust_aconfig_library { 62 name: "libuprobestats_mainline_flags_rust", 63 crate_name: "uprobestats_mainline_flags_rust", 64 defaults: ["uprobestats_rust_defaults"], 65 aconfig_declarations: "uprobestats_mainline_flags", 66} 67 68soong_config_module_type { 69 name: "uprobestats_cc_library", 70 module_type: "cc_library", 71 config_namespace: "ANDROID", 72 bool_variables: [ 73 "release_uprobestats_module", 74 ], 75 properties: [ 76 "cflags", 77 ], 78} 79 80soong_config_bool_variable { 81 name: "release_uprobestats_module", 82} 83 84uprobestats_cc_library { 85 name: "libuprobestats", 86 soong_config_variables: { 87 release_uprobestats_module: { 88 cflags: [ 89 "-DUPROBESTATS_IN_MAINLINE=1", 90 ], 91 }, 92 }, 93 srcs: [ 94 "Art.cpp", 95 "Bpf.cpp", 96 "ConfigResolver.cpp", 97 "DynamicInstrumentationManager.cpp", 98 "FlagSelector.cpp", 99 "Process.cpp", 100 "Guardrail.cpp", 101 "config.proto", 102 ], 103 header_libs: [ 104 "uprobestats_bpf_headers", 105 ], 106 shared_libs: [ 107 "libandroid", 108 "libbinder_ndk", 109 "libbase", 110 "liblog", 111 ], 112 static_libs: [ 113 "libjsoncpp", 114 "uprobestats_flags_c_lib", 115 "uprobestats_mainline_flags_c_lib", 116 ], 117 proto: { 118 export_proto_headers: true, 119 type: "lite", 120 }, 121 apex_available: [ 122 "//apex_available:platform", 123 "com.android.uprobestats", 124 ], 125 min_sdk_version: "35", 126} 127 128cc_binary { 129 name: "uprobestats", 130 enabled: true, 131 srcs: [ 132 "UprobeStats.cpp", 133 "config.proto", 134 ], 135 static_libs: [ 136 "libjsoncpp", 137 "libprotoutil", 138 "libuprobestats", 139 "uprobestats_flags_c_lib", 140 "uprobestats_mainline_flags_c_lib", 141 ], 142 shared_libs: [ 143 "libandroid", 144 "libbase", 145 "libbinder_ndk", 146 "liblog", 147 "libstatssocket", 148 ], 149 init_rc: [ 150 "UprobeStats-platform.rc", 151 ], 152 required: select(release_flag("RELEASE_UPROBESTATS_MODULE"), { 153 true: [], 154 false: [ 155 "BitmapAllocation.o", 156 "GenericInstrumentation.o", 157 "ProcessManagement.o", 158 "MalwareSignal.o", 159 ], 160 }), 161 162 proto: { 163 type: "lite", 164 static: true, 165 }, 166 apex_available: [ 167 "//apex_available:platform", 168 "com.android.uprobestats", 169 ], 170 171 min_sdk_version: "35", 172} 173 174filegroup { 175 name: "uprobestats-proto-files", 176 srcs: ["config.proto"], 177} 178 179java_library_host { 180 name: "uprobestats-protos", 181 srcs: [ 182 "config.proto", 183 ], 184 proto: { 185 include_dirs: [ 186 "external/protobuf/src", 187 ], 188 type: "full", 189 }, 190} 191 192cc_test { 193 name: "libuprobestats_test", 194 srcs: [ 195 "config.proto", 196 "Guardrail-test.cpp", 197 ], 198 shared_libs: [ 199 "libbase", 200 ], 201 static_libs: [ 202 "libbase", 203 "libgtest", 204 "liblog", 205 "libprotoutil", 206 "libuprobestats", 207 ], 208 proto: { 209 type: "lite", 210 static: true, 211 }, 212 test_suites: [ 213 "general-tests", 214 "mts-uprobestats", 215 ], 216} 217 218rust_protobuf { 219 name: "libuprobestats_proto", 220 crate_name: "uprobestats_proto", 221 defaults: ["uprobestats_rust_defaults"], 222 protos: ["config.proto"], 223 source_stem: "libuprobestats_proto", 224} 225