Skip to content

Commit

Permalink
build: expose python metrics target in android.bp
Browse files Browse the repository at this point in the history
Change-Id: I7787f0d616e9a086db25119f16aaed0ff2b68946
  • Loading branch information
LalitMaganti committed Sep 9, 2024
1 parent 820783a commit e0f892c
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
75 changes: 75 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -2685,6 +2685,81 @@ cc_test {
test_config: "PerfettoIntegrationTests.xml",
}

// GN: [//protos/perfetto/metrics:source_set]
python_library_host {
name: "perfetto_metrics_python_protos",
srcs: [
"protos/perfetto/metrics/android/ad_services_metric.proto",
"protos/perfetto/metrics/android/android_anomaly_metric.proto",
"protos/perfetto/metrics/android/android_blocking_call.proto",
"protos/perfetto/metrics/android/android_blocking_calls_cuj_metric.proto",
"protos/perfetto/metrics/android/android_blocking_calls_unagg.proto",
"protos/perfetto/metrics/android/android_boot.proto",
"protos/perfetto/metrics/android/android_boot_unagg.proto",
"protos/perfetto/metrics/android/android_broadcasts_metric.proto",
"protos/perfetto/metrics/android/android_frame_timeline_metric.proto",
"protos/perfetto/metrics/android/android_garbage_collection_unagg_metric.proto",
"protos/perfetto/metrics/android/android_oom_adjuster_metric.proto",
"protos/perfetto/metrics/android/android_sysui_notifications_blocking_calls_metric.proto",
"protos/perfetto/metrics/android/android_trusty_workqueues.proto",
"protos/perfetto/metrics/android/anr_metric.proto",
"protos/perfetto/metrics/android/app_process_starts_metric.proto",
"protos/perfetto/metrics/android/auto_metric.proto",
"protos/perfetto/metrics/android/batt_metric.proto",
"protos/perfetto/metrics/android/binder_metric.proto",
"protos/perfetto/metrics/android/camera_metric.proto",
"protos/perfetto/metrics/android/camera_unagg_metric.proto",
"protos/perfetto/metrics/android/codec_metrics.proto",
"protos/perfetto/metrics/android/cpu_metric.proto",
"protos/perfetto/metrics/android/display_metrics.proto",
"protos/perfetto/metrics/android/dma_heap_metric.proto",
"protos/perfetto/metrics/android/dvfs_metric.proto",
"protos/perfetto/metrics/android/fastrpc_metric.proto",
"protos/perfetto/metrics/android/g2d_metric.proto",
"protos/perfetto/metrics/android/gpu_metric.proto",
"protos/perfetto/metrics/android/hwcomposer.proto",
"protos/perfetto/metrics/android/hwui_metric.proto",
"protos/perfetto/metrics/android/io_metric.proto",
"protos/perfetto/metrics/android/io_unagg_metric.proto",
"protos/perfetto/metrics/android/ion_metric.proto",
"protos/perfetto/metrics/android/irq_runtime_metric.proto",
"protos/perfetto/metrics/android/jank_cuj_metric.proto",
"protos/perfetto/metrics/android/java_heap_class_stats.proto",
"protos/perfetto/metrics/android/java_heap_histogram.proto",
"protos/perfetto/metrics/android/java_heap_stats.proto",
"protos/perfetto/metrics/android/lmk_metric.proto",
"protos/perfetto/metrics/android/lmk_reason_metric.proto",
"protos/perfetto/metrics/android/mem_metric.proto",
"protos/perfetto/metrics/android/mem_unagg_metric.proto",
"protos/perfetto/metrics/android/monitor_contention_agg_metric.proto",
"protos/perfetto/metrics/android/monitor_contention_metric.proto",
"protos/perfetto/metrics/android/multiuser_metric.proto",
"protos/perfetto/metrics/android/network_metric.proto",
"protos/perfetto/metrics/android/other_traces.proto",
"protos/perfetto/metrics/android/package_list.proto",
"protos/perfetto/metrics/android/powrails_metric.proto",
"protos/perfetto/metrics/android/process_metadata.proto",
"protos/perfetto/metrics/android/profiler_smaps.proto",
"protos/perfetto/metrics/android/rt_runtime_metric.proto",
"protos/perfetto/metrics/android/simpleperf.proto",
"protos/perfetto/metrics/android/startup_metric.proto",
"protos/perfetto/metrics/android/surfaceflinger.proto",
"protos/perfetto/metrics/android/sysui_notif_shade_list_builder_metric.proto",
"protos/perfetto/metrics/android/sysui_slice_performance_statistical_data.proto",
"protos/perfetto/metrics/android/sysui_update_notif_on_ui_mode_changed_metric.proto",
"protos/perfetto/metrics/android/task_names.proto",
"protos/perfetto/metrics/android/thread_time_in_state_metric.proto",
"protos/perfetto/metrics/android/trace_quality.proto",
"protos/perfetto/metrics/android/unsymbolized_frames.proto",
"protos/perfetto/metrics/android/wattson_in_time_period.proto",
"protos/perfetto/metrics/android/wattson_tasks_attribution.proto",
"protos/perfetto/metrics/metrics.proto",
],
proto: {
canonical_path_from_root: false,
},
}

// GN: //protos/perfetto/common:cpp
filegroup {
name: "perfetto_protos_perfetto_common_cpp",
Expand Down
13 changes: 13 additions & 0 deletions tools/gen_android_bp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ proto_groups = {
'//protos/perfetto/config:source_set',
]
},
'metrics': {
'types': ['python'],
'targets': [
'//protos/perfetto/metrics:source_set',
]
},
}

needs_libfts = [
Expand Down Expand Up @@ -1013,6 +1019,13 @@ def create_proto_group_modules(blueprint, gn: GnParser, module_name: str,
module.proto = {'type': 'lite', 'canonical_path_from_root': False}
module.srcs = module_sources
blueprint.add_module(module)
elif type == 'python':
name = label_to_module_name(module_name) + '_python_protos'
module = Module('python_library_host', name, name)
module.comment = f'''GN: [{', '.join(target_names)}]'''
module.proto = {'canonical_path_from_root': False}
module.srcs = module_sources
blueprint.add_module(module)
else:
raise Error('Unhandled proto group type: {}'.format(group.type))

Expand Down

0 comments on commit e0f892c

Please sign in to comment.