| package { |
| default_applicable_licenses: ["Android-Apache-2.0"], |
| default_team: "trendy_team_system_performance", |
| } |
| |
| aconfig_declarations { |
| name: "uprobestats_flags", |
| package: "android.uprobestats.flags", |
| container: "system", |
| srcs: ["flag.aconfig"], |
| } |
| |
| aconfig_declarations { |
| name: "uprobestats_mainline_flags", |
| package: "android.uprobestats.mainline.flags", |
| container: "com.android.uprobestats", |
| srcs: ["mainline-flag.aconfig"], |
| } |
| |
| cc_aconfig_library { |
| name: "uprobestats_flags_c_lib", |
| aconfig_declarations: "uprobestats_flags", |
| apex_available: [ |
| "//apex_available:platform", |
| "com.android.uprobestats", |
| ], |
| min_sdk_version: "36", |
| } |
| |
| cc_aconfig_library { |
| name: "uprobestats_mainline_flags_c_lib", |
| aconfig_declarations: "uprobestats_mainline_flags", |
| apex_available: [ |
| "//apex_available:platform", |
| "com.android.uprobestats", |
| ], |
| min_sdk_version: "36", |
| } |
| |
| java_aconfig_library { |
| name: "uprobestats_flags_java_lib", |
| aconfig_declarations: "uprobestats_flags", |
| host_supported: true, |
| } |
| |
| java_aconfig_library { |
| name: "art_flags_uprobestats_java_lib", |
| aconfig_declarations: "art-aconfig-flags", |
| host_supported: true, |
| } |
| |
| java_aconfig_library { |
| name: "uprobestats_mainline_flags_java_lib", |
| aconfig_declarations: "uprobestats_mainline_flags", |
| host_supported: true, |
| visibility: [ |
| "//cts/hostsidetests/statsdatom:__subpackages__", |
| "//packages/modules/UprobeStats:__subpackages__", |
| ], |
| } |
| |
| rust_aconfig_library { |
| name: "libuprobestats_mainline_flags_rust", |
| crate_name: "uprobestats_mainline_flags_rust", |
| defaults: ["uprobestats_rust_defaults"], |
| aconfig_declarations: "uprobestats_mainline_flags", |
| } |
| |
| soong_config_module_type { |
| name: "uprobestats_cc_library", |
| module_type: "cc_library", |
| config_namespace: "ANDROID", |
| bool_variables: [ |
| "release_uprobestats_module", |
| ], |
| properties: [ |
| "cflags", |
| ], |
| } |
| |
| soong_config_bool_variable { |
| name: "release_uprobestats_module", |
| } |
| |
| uprobestats_cc_library { |
| name: "libuprobestats", |
| soong_config_variables: { |
| release_uprobestats_module: { |
| cflags: [ |
| "-DUPROBESTATS_IN_MAINLINE=1", |
| ], |
| }, |
| }, |
| srcs: [ |
| "Art.cpp", |
| "Bpf.cpp", |
| "ConfigResolver.cpp", |
| "DynamicInstrumentationManager.cpp", |
| "FlagSelector.cpp", |
| "Process.cpp", |
| "Guardrail.cpp", |
| "config.proto", |
| ], |
| header_libs: [ |
| "uprobestats_bpf_headers", |
| ], |
| shared_libs: [ |
| "libandroid", |
| "libbinder_ndk", |
| "libbase", |
| "liblog", |
| ], |
| static_libs: [ |
| "libjsoncpp", |
| "uprobestats_flags_c_lib", |
| "uprobestats_mainline_flags_c_lib", |
| ], |
| proto: { |
| export_proto_headers: true, |
| type: "lite", |
| }, |
| apex_available: [ |
| "//apex_available:platform", |
| "com.android.uprobestats", |
| ], |
| min_sdk_version: "35", |
| } |
| |
| cc_binary { |
| name: "uprobestats", |
| enabled: select(release_flag("RELEASE_UPROBESTATS_RUST"), { |
| true: false, |
| false: true, |
| }), |
| srcs: [ |
| "UprobeStats.cpp", |
| "config.proto", |
| ], |
| static_libs: [ |
| "libjsoncpp", |
| "libprotoutil", |
| "libuprobestats", |
| "uprobestats_flags_c_lib", |
| "uprobestats_mainline_flags_c_lib", |
| ], |
| shared_libs: [ |
| "libandroid", |
| "libbase", |
| "libbinder_ndk", |
| "liblog", |
| "libstatssocket", |
| ], |
| init_rc: [ |
| "UprobeStats-platform.rc", |
| ], |
| required: select(release_flag("RELEASE_UPROBESTATS_MODULE"), { |
| true: [], |
| false: [ |
| "BitmapAllocation.o", |
| "GenericInstrumentation.o", |
| "ProcessManagement.o", |
| ], |
| }), |
| |
| proto: { |
| type: "lite", |
| static: true, |
| }, |
| apex_available: [ |
| "//apex_available:platform", |
| "com.android.uprobestats", |
| ], |
| |
| min_sdk_version: "35", |
| } |
| |
| filegroup { |
| name: "uprobestats-proto-files", |
| srcs: ["config.proto"], |
| } |
| |
| java_library_host { |
| name: "uprobestats-protos", |
| srcs: [ |
| "config.proto", |
| ], |
| proto: { |
| include_dirs: [ |
| "external/protobuf/src", |
| ], |
| type: "full", |
| }, |
| } |
| |
| cc_test { |
| name: "libuprobestats_test", |
| srcs: [ |
| "config.proto", |
| "Guardrail-test.cpp", |
| ], |
| shared_libs: [ |
| "libbase", |
| ], |
| static_libs: [ |
| "libbase", |
| "libgtest", |
| "liblog", |
| "libprotoutil", |
| "libuprobestats", |
| ], |
| proto: { |
| type: "lite", |
| static: true, |
| }, |
| test_suites: [ |
| "general-tests", |
| "mts-uprobestats", |
| ], |
| } |
| |
| rust_protobuf { |
| name: "libuprobestats_proto", |
| crate_name: "uprobestats_proto", |
| defaults: ["uprobestats_rust_defaults"], |
| protos: ["config.proto"], |
| source_stem: "libuprobestats_proto", |
| } |