diff --git a/Android.bp b/Android.bp index 61295740cfe..ac1057aa773 100644 --- a/Android.bp +++ b/Android.bp @@ -2733,11 +2733,6 @@ filegroup { name: "perfetto_include_perfetto_ext_trace_processor_trace_processor_shell", } -// GN: //include/perfetto/ext/traceconv:traceconv -filegroup { - name: "perfetto_include_perfetto_ext_traceconv_traceconv", -} - // GN: //include/perfetto/ext/traced:sys_stats_counters filegroup { name: "perfetto_include_perfetto_ext_traced_sys_stats_counters", @@ -21908,14 +21903,6 @@ filegroup { ], } -// GN: //src/traceconv:main -filegroup { - name: "perfetto_src_traceconv_main", - srcs: [ - "src/traceconv/main.cc", - ], -} - // GN: //src/traceconv:pprofbuilder filegroup { name: "perfetto_src_traceconv_pprofbuilder", @@ -21924,14 +21911,6 @@ filegroup { ], } -// GN: //src/traceconv:traceconv_lib -filegroup { - name: "perfetto_src_traceconv_traceconv_lib", - srcs: [ - "src/traceconv/traceconv.cc", - ], -} - // GN: //src/traceconv:utils filegroup { name: "perfetto_src_traceconv_utils", @@ -25626,416 +25605,6 @@ cc_binary { min_sdk_version: "35", } -// GN: //src/traceconv:traceconv -cc_binary_host { - name: "traceconv", - srcs: [ - ":perfetto_base_default_platform", - ":perfetto_include_perfetto_base_base", - ":perfetto_include_perfetto_ext_base_base", - ":perfetto_include_perfetto_ext_base_regex", - ":perfetto_include_perfetto_ext_base_version", - ":perfetto_include_perfetto_ext_protozero_protozero", - ":perfetto_include_perfetto_ext_trace_processor_demangle", - ":perfetto_include_perfetto_ext_trace_processor_export_json", - ":perfetto_include_perfetto_ext_trace_processor_importers_memory_tracker_memory_tracker", - ":perfetto_include_perfetto_ext_traceconv_traceconv", - ":perfetto_include_perfetto_ext_traced_sys_stats_counters", - ":perfetto_include_perfetto_profiling_pprof_builder", - ":perfetto_include_perfetto_protozero_protozero", - ":perfetto_include_perfetto_public_abi_base", - ":perfetto_include_perfetto_public_base", - ":perfetto_include_perfetto_public_protozero", - ":perfetto_include_perfetto_trace_processor_basic_types", - ":perfetto_include_perfetto_trace_processor_io", - ":perfetto_include_perfetto_trace_processor_storage", - ":perfetto_include_perfetto_trace_processor_trace_processor", - ":perfetto_include_perfetto_trace_processor_util", - ":perfetto_protos_perfetto_common_cpp_gen", - ":perfetto_protos_perfetto_common_semantic_type_zero_gen", - ":perfetto_protos_perfetto_common_zero_gen", - ":perfetto_protos_perfetto_config_android_zero_gen", - ":perfetto_protos_perfetto_config_ftrace_zero_gen", - ":perfetto_protos_perfetto_config_gpu_zero_gen", - ":perfetto_protos_perfetto_config_inode_file_zero_gen", - ":perfetto_protos_perfetto_config_interceptors_zero_gen", - ":perfetto_protos_perfetto_config_linux_zero_gen", - ":perfetto_protos_perfetto_config_power_zero_gen", - ":perfetto_protos_perfetto_config_priority_boost_zero_gen", - ":perfetto_protos_perfetto_config_process_stats_zero_gen", - ":perfetto_protos_perfetto_config_profiling_zero_gen", - ":perfetto_protos_perfetto_config_protovm_zero_gen", - ":perfetto_protos_perfetto_config_qnx_zero_gen", - ":perfetto_protos_perfetto_config_statsd_zero_gen", - ":perfetto_protos_perfetto_config_sys_stats_zero_gen", - ":perfetto_protos_perfetto_config_system_info_zero_gen", - ":perfetto_protos_perfetto_config_track_event_zero_gen", - ":perfetto_protos_perfetto_config_zero_gen", - ":perfetto_protos_perfetto_perfetto_sql_zero_gen", - ":perfetto_protos_perfetto_protovm_cpp_gen", - ":perfetto_protos_perfetto_protovm_zero_gen", - ":perfetto_protos_perfetto_trace_android_zero_gen", - ":perfetto_protos_perfetto_trace_chrome_zero_gen", - ":perfetto_protos_perfetto_trace_etw_zero_gen", - ":perfetto_protos_perfetto_trace_field_options_zero_gen", - ":perfetto_protos_perfetto_trace_filesystem_zero_gen", - ":perfetto_protos_perfetto_trace_ftrace_zero_gen", - ":perfetto_protos_perfetto_trace_generic_kernel_zero_gen", - ":perfetto_protos_perfetto_trace_gpu_gpu_interned_data_zero_gen", - ":perfetto_protos_perfetto_trace_gpu_gpu_track_event_zero_gen", - ":perfetto_protos_perfetto_trace_gpu_zero_gen", - ":perfetto_protos_perfetto_trace_interned_data_zero_gen", - ":perfetto_protos_perfetto_trace_linux_zero_gen", - ":perfetto_protos_perfetto_trace_minimal_zero_gen", - ":perfetto_protos_perfetto_trace_non_minimal_zero_gen", - ":perfetto_protos_perfetto_trace_perfetto_zero_gen", - ":perfetto_protos_perfetto_trace_power_zero_gen", - ":perfetto_protos_perfetto_trace_processor_metrics_impl_zero_gen", - ":perfetto_protos_perfetto_trace_processor_zero_gen", - ":perfetto_protos_perfetto_trace_profiling_inline_callstack_zero_gen", - ":perfetto_protos_perfetto_trace_profiling_zero_gen", - ":perfetto_protos_perfetto_trace_ps_zero_gen", - ":perfetto_protos_perfetto_trace_statsd_zero_gen", - ":perfetto_protos_perfetto_trace_summary_zero_gen", - ":perfetto_protos_perfetto_trace_sys_stats_zero_gen", - ":perfetto_protos_perfetto_trace_system_info_zero_gen", - ":perfetto_protos_perfetto_trace_track_event_zero_gen", - ":perfetto_protos_perfetto_trace_translation_zero_gen", - ":perfetto_protos_third_party_android_art_art_heap_graph_zero_gen", - ":perfetto_protos_third_party_android_connectivity_connectivity_network_trace_zero_gen", - ":perfetto_protos_third_party_android_frameworks_base_proto_tracing_frameworks_base_interned_data_zero_gen", - ":perfetto_protos_third_party_android_frameworks_base_proto_tracing_frameworks_base_trace_packet_zero_gen", - ":perfetto_protos_third_party_android_frameworks_base_proto_tracing_frameworks_base_track_event_zero_gen", - ":perfetto_protos_third_party_android_frameworks_native_tracing_frameworks_native_interned_data_zero_gen", - ":perfetto_protos_third_party_android_frameworks_native_tracing_frameworks_native_trace_packet_zero_gen", - ":perfetto_protos_third_party_android_frameworks_native_tracing_winscope_winscope_extensions_zero_gen", - ":perfetto_protos_third_party_android_frameworks_native_tracing_winscope_winscope_regular_zero_gen", - ":perfetto_protos_third_party_android_packages_modules_bluetooth_tracing_bluetooth_tracing_zero_gen", - ":perfetto_protos_third_party_chromium_zero_gen", - ":perfetto_protos_third_party_pprof_zero_gen", - ":perfetto_protos_third_party_primes_cpp_gen", - ":perfetto_protos_third_party_primes_zero_gen", - ":perfetto_protos_third_party_simpleperf_zero_gen", - ":perfetto_src_base_base", - ":perfetto_src_base_check_cpu_optimizations", - ":perfetto_src_base_clock_snapshots", - ":perfetto_src_base_regex_regex", - ":perfetto_src_base_version", - ":perfetto_src_kernel_utils_kernel_wakelock_errors", - ":perfetto_src_kernel_utils_syscall_table", - ":perfetto_src_protovm_protovm", - ":perfetto_src_protozero_proto_ring_buffer", - ":perfetto_src_protozero_protozero", - ":perfetto_src_protozero_text_to_proto_text_to_proto", - ":perfetto_src_trace_processor_containers_containers", - ":perfetto_src_trace_processor_core_common_common", - ":perfetto_src_trace_processor_core_dataframe_dataframe", - ":perfetto_src_trace_processor_core_interpreter_interpreter", - ":perfetto_src_trace_processor_core_plugin_plugin", - ":perfetto_src_trace_processor_core_tree_tree", - ":perfetto_src_trace_processor_core_util_util", - ":perfetto_src_trace_processor_export_json", - ":perfetto_src_trace_processor_importers_android_bugreport_android_bugreport", - ":perfetto_src_trace_processor_importers_android_bugreport_android_dumpstate_event", - ":perfetto_src_trace_processor_importers_android_bugreport_android_log_event", - ":perfetto_src_trace_processor_importers_archive_archive", - ":perfetto_src_trace_processor_importers_art_hprof_art_hprof", - ":perfetto_src_trace_processor_importers_art_method_art_method", - ":perfetto_src_trace_processor_importers_art_method_art_method_event", - ":perfetto_src_trace_processor_importers_collapsed_stack_collapsed_stack", - ":perfetto_src_trace_processor_importers_common_common", - ":perfetto_src_trace_processor_importers_common_parser_types", - ":perfetto_src_trace_processor_importers_common_stats_tracker", - ":perfetto_src_trace_processor_importers_common_synthetic_tid_hdr", - ":perfetto_src_trace_processor_importers_common_v8_profile_parser", - ":perfetto_src_trace_processor_importers_etw_full", - ":perfetto_src_trace_processor_importers_etw_minimal", - ":perfetto_src_trace_processor_importers_ftrace_ftrace_descriptors", - ":perfetto_src_trace_processor_importers_ftrace_full", - ":perfetto_src_trace_processor_importers_ftrace_minimal", - ":perfetto_src_trace_processor_importers_fuchsia_fuchsia_record", - ":perfetto_src_trace_processor_importers_fuchsia_full", - ":perfetto_src_trace_processor_importers_fuchsia_minimal", - ":perfetto_src_trace_processor_importers_gecko_gecko", - ":perfetto_src_trace_processor_importers_gecko_gecko_event", - ":perfetto_src_trace_processor_importers_generic_kernel_full", - ":perfetto_src_trace_processor_importers_i2c_full", - ":perfetto_src_trace_processor_importers_json_json", - ":perfetto_src_trace_processor_importers_memory_tracker_graph_processor", - ":perfetto_src_trace_processor_importers_ninja_ninja", - ":perfetto_src_trace_processor_importers_perf_perf", - ":perfetto_src_trace_processor_importers_perf_record", - ":perfetto_src_trace_processor_importers_pprof_pprof", - ":perfetto_src_trace_processor_importers_primes_primes", - ":perfetto_src_trace_processor_importers_proto_full", - ":perfetto_src_trace_processor_importers_proto_minimal", - ":perfetto_src_trace_processor_importers_proto_packet_sequence_state_generation_hdr", - ":perfetto_src_trace_processor_importers_proto_proto_importer_module", - ":perfetto_src_trace_processor_importers_simpleperf_proto_simpleperf_proto", - ":perfetto_src_trace_processor_importers_syscalls_full", - ":perfetto_src_trace_processor_importers_systrace_full", - ":perfetto_src_trace_processor_importers_systrace_systrace_line", - ":perfetto_src_trace_processor_importers_systrace_systrace_parser", - ":perfetto_src_trace_processor_io", - ":perfetto_src_trace_processor_lib", - ":perfetto_src_trace_processor_metatrace", - ":perfetto_src_trace_processor_metrics_metrics", - ":perfetto_src_trace_processor_perfetto_sql_engine_engine", - ":perfetto_src_trace_processor_perfetto_sql_generator_generator", - ":perfetto_src_trace_processor_perfetto_sql_intrinsics_types_types", - ":perfetto_src_trace_processor_perfetto_sql_parser_intrinsic_macro_expansion", - ":perfetto_src_trace_processor_perfetto_sql_parser_parser", - ":perfetto_src_trace_processor_perfetto_sql_syntaqlite_syntaqlite", - ":perfetto_src_trace_processor_perfetto_sql_tokenizer_tokenizer", - ":perfetto_src_trace_processor_plugins_ancestor_ancestor", - ":perfetto_src_trace_processor_plugins_android_framework_track_event_android_framework_track_event", - ":perfetto_src_trace_processor_plugins_args_args", - ":perfetto_src_trace_processor_plugins_art_heap_graph_functions_art_heap_graph_functions", - ":perfetto_src_trace_processor_plugins_art_process_metadata_importer_art_process_metadata_importer", - ":perfetto_src_trace_processor_plugins_base64_functions_base64_functions", - ":perfetto_src_trace_processor_plugins_connected_flow_connected_flow", - ":perfetto_src_trace_processor_plugins_core_functions_core_functions", - ":perfetto_src_trace_processor_plugins_counter_intervals_counter_intervals", - ":perfetto_src_trace_processor_plugins_counter_mipmap_operator_counter_mipmap_operator", - ":perfetto_src_trace_processor_plugins_create_function_create_function", - ":perfetto_src_trace_processor_plugins_create_intervals_create_intervals", - ":perfetto_src_trace_processor_plugins_create_view_function_create_view_function", - ":perfetto_src_trace_processor_plugins_critical_path_critical_path", - ":perfetto_src_trace_processor_plugins_descendant_descendant", - ":perfetto_src_trace_processor_plugins_developer_functions_developer_functions", - ":perfetto_src_trace_processor_plugins_dfs_weight_bounded_dfs_weight_bounded", - ":perfetto_src_trace_processor_plugins_dominator_tree_dominator_tree", - ":perfetto_src_trace_processor_plugins_etm_decode_chunk_etm_decode_chunk", - ":perfetto_src_trace_processor_plugins_etm_iterate_range_etm_iterate_range", - ":perfetto_src_trace_processor_plugins_experimental_annotated_stack_experimental_annotated_stack", - ":perfetto_src_trace_processor_plugins_experimental_flamegraph_experimental_flamegraph", - ":perfetto_src_trace_processor_plugins_experimental_flat_slice_experimental_flat_slice", - ":perfetto_src_trace_processor_plugins_experimental_slice_layout_experimental_slice_layout", - ":perfetto_src_trace_processor_plugins_graph_scan_graph_scan", - ":perfetto_src_trace_processor_plugins_graph_traversal_graph_traversal", - ":perfetto_src_trace_processor_plugins_import_import", - ":perfetto_src_trace_processor_plugins_interval_intersect_interval_intersect", - ":perfetto_src_trace_processor_plugins_layout_functions_layout_functions", - ":perfetto_src_trace_processor_plugins_math_functions_math_functions", - ":perfetto_src_trace_processor_plugins_metadata_metadata", - ":perfetto_src_trace_processor_plugins_package_lookup_package_lookup", - ":perfetto_src_trace_processor_plugins_perf_counter_perf_counter", - ":perfetto_src_trace_processor_plugins_perf_text_perf_text", - ":perfetto_src_trace_processor_plugins_perfetto_manifest_perfetto_manifest", - ":perfetto_src_trace_processor_plugins_pprof_functions_pprof_functions", - ":perfetto_src_trace_processor_plugins_slice_mipmap_operator_slice_mipmap_operator", - ":perfetto_src_trace_processor_plugins_span_join_operator_span_join_operator", - ":perfetto_src_trace_processor_plugins_sql_stats_table_sql_stats_table", - ":perfetto_src_trace_processor_plugins_stack_functions_stack_functions", - ":perfetto_src_trace_processor_plugins_stack_sample_importer_stack_sample_importer", - ":perfetto_src_trace_processor_plugins_stdlib_docs_stdlib_docs", - ":perfetto_src_trace_processor_plugins_storage_tables_storage_tables", - ":perfetto_src_trace_processor_plugins_strace_strace", - ":perfetto_src_trace_processor_plugins_string_functions_string_functions", - ":perfetto_src_trace_processor_plugins_structural_tree_partition_structural_tree_partition", - ":perfetto_src_trace_processor_plugins_symbolize_symbolize", - ":perfetto_src_trace_processor_plugins_table_info_table_info", - ":perfetto_src_trace_processor_plugins_table_pointer_module_table_pointer_module", - ":perfetto_src_trace_processor_plugins_time_functions_time_functions", - ":perfetto_src_trace_processor_plugins_to_ftrace_to_ftrace", - ":perfetto_src_trace_processor_plugins_trace_export_trace_export", - ":perfetto_src_trace_processor_plugins_tree_functions_tree_functions", - ":perfetto_src_trace_processor_plugins_type_builder_functions_type_builder_functions", - ":perfetto_src_trace_processor_plugins_utils_functions_utils_functions", - ":perfetto_src_trace_processor_plugins_video_frame_importer_video_frame_importer", - ":perfetto_src_trace_processor_plugins_wattson_wattson", - ":perfetto_src_trace_processor_plugins_window_operator_window_operator", - ":perfetto_src_trace_processor_plugins_winscope_importer_winscope_importer", - ":perfetto_src_trace_processor_plugins_winscope_proto_to_args_with_defaults_winscope_proto_to_args_with_defaults", - ":perfetto_src_trace_processor_plugins_winscope_surfaceflinger_hierarchy_paths_winscope_surfaceflinger_hierarchy_paths", - ":perfetto_src_trace_processor_plugins_zstd_functions_zstd_functions", - ":perfetto_src_trace_processor_sorter_sorter", - ":perfetto_src_trace_processor_sqlite_bindings_bindings", - ":perfetto_src_trace_processor_sqlite_sqlite", - ":perfetto_src_trace_processor_storage_minimal", - ":perfetto_src_trace_processor_storage_storage", - ":perfetto_src_trace_processor_tables_tables", - ":perfetto_src_trace_processor_trace_summary_trace_summary", - ":perfetto_src_trace_processor_types_types", - ":perfetto_src_trace_processor_util_args_utils", - ":perfetto_src_trace_processor_util_blob", - ":perfetto_src_trace_processor_util_build_id", - ":perfetto_src_trace_processor_util_bump_allocator", - ":perfetto_src_trace_processor_util_clock", - ":perfetto_src_trace_processor_util_compressor", - ":perfetto_src_trace_processor_util_decompressor", - ":perfetto_src_trace_processor_util_deobfuscation_deobfuscator", - ":perfetto_src_trace_processor_util_descriptors", - ":perfetto_src_trace_processor_util_elf_elf", - ":perfetto_src_trace_processor_util_flatbuffer_reader", - ":perfetto_src_trace_processor_util_flatbuffer_writer", - ":perfetto_src_trace_processor_util_galloping_search", - ":perfetto_src_trace_processor_util_glob", - ":perfetto_src_trace_processor_util_interned_message_view", - ":perfetto_src_trace_processor_util_json_args", - ":perfetto_src_trace_processor_util_json_parser", - ":perfetto_src_trace_processor_util_json_serializer", - ":perfetto_src_trace_processor_util_json_value", - ":perfetto_src_trace_processor_util_owned_sql_value", - ":perfetto_src_trace_processor_util_profile_builder", - ":perfetto_src_trace_processor_util_profiler_util", - ":perfetto_src_trace_processor_util_proto_profiler", - ":perfetto_src_trace_processor_util_proto_to_args_parser", - ":perfetto_src_trace_processor_util_protozero_to_json", - ":perfetto_src_trace_processor_util_protozero_to_text", - ":perfetto_src_trace_processor_util_simple_json_parser", - ":perfetto_src_trace_processor_util_simple_json_serializer", - ":perfetto_src_trace_processor_util_sql_argument", - ":perfetto_src_trace_processor_util_sql_bundle", - ":perfetto_src_trace_processor_util_sql_module_doc_parser", - ":perfetto_src_trace_processor_util_stdlib", - ":perfetto_src_trace_processor_util_symbolizer_symbolize_database", - ":perfetto_src_trace_processor_util_symbolizer_symbolizer", - ":perfetto_src_trace_processor_util_tar_writer", - ":perfetto_src_trace_processor_util_trace_blob_view_reader", - ":perfetto_src_trace_processor_util_trace_enrichment_trace_enrichment", - ":perfetto_src_trace_processor_util_trace_type", - ":perfetto_src_trace_processor_util_zip_reader", - ":perfetto_src_traceconv_lib", - ":perfetto_src_traceconv_main", - ":perfetto_src_traceconv_pprofbuilder", - ":perfetto_src_traceconv_traceconv_lib", - ":perfetto_src_traceconv_utils", - ], - static_libs: [ - "libpcre2", - "libsqlite_static_noicu", - "libz", - "libzstd", - "perfetto_src_trace_processor_demangle", - "sqlite_ext_percentile", - ], - generated_headers: [ - "perfetto_protos_perfetto_common_cpp_gen_headers", - "perfetto_protos_perfetto_common_semantic_type_zero_gen_headers", - "perfetto_protos_perfetto_common_zero_gen_headers", - "perfetto_protos_perfetto_config_android_zero_gen_headers", - "perfetto_protos_perfetto_config_ftrace_zero_gen_headers", - "perfetto_protos_perfetto_config_gpu_zero_gen_headers", - "perfetto_protos_perfetto_config_inode_file_zero_gen_headers", - "perfetto_protos_perfetto_config_interceptors_zero_gen_headers", - "perfetto_protos_perfetto_config_linux_zero_gen_headers", - "perfetto_protos_perfetto_config_power_zero_gen_headers", - "perfetto_protos_perfetto_config_priority_boost_zero_gen_headers", - "perfetto_protos_perfetto_config_process_stats_zero_gen_headers", - "perfetto_protos_perfetto_config_profiling_zero_gen_headers", - "perfetto_protos_perfetto_config_protovm_zero_gen_headers", - "perfetto_protos_perfetto_config_qnx_zero_gen_headers", - "perfetto_protos_perfetto_config_statsd_zero_gen_headers", - "perfetto_protos_perfetto_config_sys_stats_zero_gen_headers", - "perfetto_protos_perfetto_config_system_info_zero_gen_headers", - "perfetto_protos_perfetto_config_track_event_zero_gen_headers", - "perfetto_protos_perfetto_config_zero_gen_headers", - "perfetto_protos_perfetto_perfetto_sql_zero_gen_headers", - "perfetto_protos_perfetto_protovm_cpp_gen_headers", - "perfetto_protos_perfetto_protovm_zero_gen_headers", - "perfetto_protos_perfetto_trace_android_zero_gen_headers", - "perfetto_protos_perfetto_trace_chrome_zero_gen_headers", - "perfetto_protos_perfetto_trace_etw_zero_gen_headers", - "perfetto_protos_perfetto_trace_field_options_zero_gen_headers", - "perfetto_protos_perfetto_trace_filesystem_zero_gen_headers", - "perfetto_protos_perfetto_trace_ftrace_zero_gen_headers", - "perfetto_protos_perfetto_trace_generic_kernel_zero_gen_headers", - "perfetto_protos_perfetto_trace_gpu_gpu_interned_data_zero_gen_headers", - "perfetto_protos_perfetto_trace_gpu_gpu_track_event_zero_gen_headers", - "perfetto_protos_perfetto_trace_gpu_zero_gen_headers", - "perfetto_protos_perfetto_trace_interned_data_zero_gen_headers", - "perfetto_protos_perfetto_trace_linux_zero_gen_headers", - "perfetto_protos_perfetto_trace_minimal_zero_gen_headers", - "perfetto_protos_perfetto_trace_non_minimal_zero_gen_headers", - "perfetto_protos_perfetto_trace_perfetto_zero_gen_headers", - "perfetto_protos_perfetto_trace_power_zero_gen_headers", - "perfetto_protos_perfetto_trace_processor_metrics_impl_zero_gen_headers", - "perfetto_protos_perfetto_trace_processor_zero_gen_headers", - "perfetto_protos_perfetto_trace_profiling_inline_callstack_zero_gen_headers", - "perfetto_protos_perfetto_trace_profiling_zero_gen_headers", - "perfetto_protos_perfetto_trace_ps_zero_gen_headers", - "perfetto_protos_perfetto_trace_statsd_zero_gen_headers", - "perfetto_protos_perfetto_trace_summary_zero_gen_headers", - "perfetto_protos_perfetto_trace_sys_stats_zero_gen_headers", - "perfetto_protos_perfetto_trace_system_info_zero_gen_headers", - "perfetto_protos_perfetto_trace_track_event_zero_gen_headers", - "perfetto_protos_perfetto_trace_translation_zero_gen_headers", - "perfetto_protos_third_party_android_art_art_heap_graph_zero_gen_headers", - "perfetto_protos_third_party_android_connectivity_connectivity_network_trace_zero_gen_headers", - "perfetto_protos_third_party_android_frameworks_base_proto_tracing_frameworks_base_interned_data_zero_gen_headers", - "perfetto_protos_third_party_android_frameworks_base_proto_tracing_frameworks_base_trace_packet_zero_gen_headers", - "perfetto_protos_third_party_android_frameworks_base_proto_tracing_frameworks_base_track_event_zero_gen_headers", - "perfetto_protos_third_party_android_frameworks_native_tracing_frameworks_native_interned_data_zero_gen_headers", - "perfetto_protos_third_party_android_frameworks_native_tracing_frameworks_native_trace_packet_zero_gen_headers", - "perfetto_protos_third_party_android_frameworks_native_tracing_winscope_winscope_extensions_zero_gen_headers", - "perfetto_protos_third_party_android_frameworks_native_tracing_winscope_winscope_regular_zero_gen_headers", - "perfetto_protos_third_party_android_packages_modules_bluetooth_tracing_bluetooth_tracing_zero_gen_headers", - "perfetto_protos_third_party_chromium_zero_gen_headers", - "perfetto_protos_third_party_pprof_zero_gen_headers", - "perfetto_protos_third_party_primes_cpp_gen_headers", - "perfetto_protos_third_party_primes_zero_gen_headers", - "perfetto_protos_third_party_simpleperf_zero_gen_headers", - "perfetto_src_base_version_gen_h", - "perfetto_src_trace_processor_importers_proto_gen_cc_android_extension_descriptor", - "perfetto_src_trace_processor_importers_proto_gen_cc_chrome_track_event_descriptor", - "perfetto_src_trace_processor_importers_proto_gen_cc_gpu_interned_data_descriptor", - "perfetto_src_trace_processor_importers_proto_gen_cc_gpu_track_event_descriptor", - "perfetto_src_trace_processor_importers_proto_gen_cc_statsd_atoms_descriptor", - "perfetto_src_trace_processor_importers_proto_gen_cc_trace_descriptor", - "perfetto_src_trace_processor_importers_proto_gen_cc_track_event_descriptor", - "perfetto_src_trace_processor_metrics_gen_cc_all_chrome_metrics_descriptor", - "perfetto_src_trace_processor_metrics_gen_cc_all_webview_metrics_descriptor", - "perfetto_src_trace_processor_metrics_gen_cc_metrics_descriptor", - "perfetto_src_trace_processor_metrics_sql_gen_amalgamated_sql_metrics", - "perfetto_src_trace_processor_perfetto_sql_stdlib_stdlib", - "perfetto_src_trace_processor_plugins_ancestor_tables", - "perfetto_src_trace_processor_plugins_android_framework_track_event_tables", - "perfetto_src_trace_processor_plugins_connected_flow_tables", - "perfetto_src_trace_processor_plugins_critical_path_tables", - "perfetto_src_trace_processor_plugins_developer_functions_tables", - "perfetto_src_trace_processor_plugins_dfs_weight_bounded_tables", - "perfetto_src_trace_processor_plugins_dominator_tree_tables", - "perfetto_src_trace_processor_plugins_experimental_annotated_stack_tables", - "perfetto_src_trace_processor_plugins_experimental_flat_slice_tables", - "perfetto_src_trace_processor_plugins_experimental_slice_layout_tables", - "perfetto_src_trace_processor_plugins_graph_traversal_tables", - "perfetto_src_trace_processor_plugins_stdlib_docs_tables", - "perfetto_src_trace_processor_plugins_structural_tree_partition_tables", - "perfetto_src_trace_processor_plugins_table_info_tables", - "perfetto_src_trace_processor_plugins_video_frame_importer_tables", - "perfetto_src_trace_processor_plugins_wattson_gen_cpu_1d_curves", - "perfetto_src_trace_processor_plugins_wattson_gen_cpu_2d_curves", - "perfetto_src_trace_processor_plugins_wattson_gen_gpu_curves", - "perfetto_src_trace_processor_plugins_wattson_gen_l3_curves", - "perfetto_src_trace_processor_plugins_wattson_gen_tpu_curves", - "perfetto_src_trace_processor_plugins_winscope_proto_to_args_with_defaults_tables", - "perfetto_src_trace_processor_plugins_winscope_surfaceflinger_hierarchy_paths_tables", - "perfetto_src_trace_processor_tables_tables_python", - "perfetto_src_trace_processor_trace_summary_gen_cc_trace_summary_descriptor", - "perfetto_src_traceconv_gen_cc_android_extension_descriptor", - "perfetto_src_traceconv_gen_cc_trace_descriptor", - ], - defaults: [ - "perfetto_defaults", - ], - cflags: [ - "-DZLIB_IMPLEMENTATION", - ], - target: { - android: { - static_libs: [ - "perfetto_flags_c_lib", - ], - }, - musl: { - static_libs: [ - "libfts", - ], - }, - }, -} - // GN: //src/traced/service:traced cc_binary { name: "traced", diff --git a/BUILD b/BUILD index 39854f42a97..5418349e773 100644 --- a/BUILD +++ b/BUILD @@ -1528,14 +1528,6 @@ perfetto_filegroup( ], ) -# GN target: //include/perfetto/ext/traceconv:traceconv -perfetto_filegroup( - name = "include_perfetto_ext_traceconv_traceconv", - srcs = [ - "include/perfetto/ext/traceconv/traceconv.h", - ], -) - # GN target: //include/perfetto/ext/traced:sys_stats_counters perfetto_filegroup( name = "include_perfetto_ext_traced_sys_stats_counters", @@ -6319,14 +6311,6 @@ perfetto_filegroup( ], ) -# GN target: //src/traceconv:main -perfetto_filegroup( - name = "src_traceconv_main", - srcs = [ - "src/traceconv/main.cc", - ], -) - # GN target: //src/traceconv:pprofbuilder perfetto_filegroup( name = "src_traceconv_pprofbuilder", @@ -6335,14 +6319,6 @@ perfetto_filegroup( ], ) -# GN target: //src/traceconv:traceconv_lib -perfetto_filegroup( - name = "src_traceconv_traceconv_lib", - srcs = [ - "src/traceconv/traceconv.cc", - ], -) - # GN target: //src/traceconv:utils perfetto_filegroup( name = "src_traceconv_utils", @@ -11805,327 +11781,6 @@ perfetto_cc_binary( ], ) -# GN target: //src/traceconv:traceconv -perfetto_cc_binary( - name = "traceconv", - srcs = [ - ":include_perfetto_base_base", - ":include_perfetto_ext_base_base", - ":include_perfetto_ext_protozero_protozero", - ":include_perfetto_ext_trace_processor_demangle", - ":include_perfetto_ext_trace_processor_export_json", - ":include_perfetto_ext_trace_processor_importers_memory_tracker_memory_tracker", - ":include_perfetto_ext_traceconv_traceconv", - ":include_perfetto_ext_traced_sys_stats_counters", - ":include_perfetto_profiling_pprof_builder", - ":include_perfetto_protozero_protozero", - ":include_perfetto_public_abi_base", - ":include_perfetto_public_base", - ":include_perfetto_public_protozero", - ":include_perfetto_trace_processor_basic_types", - ":include_perfetto_trace_processor_io", - ":include_perfetto_trace_processor_storage", - ":include_perfetto_trace_processor_trace_processor", - ":include_perfetto_trace_processor_util", - ":src_kernel_utils_kernel_wakelock_errors", - ":src_kernel_utils_syscall_table", - ":src_protozero_proto_ring_buffer", - ":src_protozero_text_to_proto_text_to_proto", - ":src_trace_processor_core_common_common", - ":src_trace_processor_core_dataframe_dataframe", - ":src_trace_processor_core_interpreter_interpreter", - ":src_trace_processor_core_plugin_plugin", - ":src_trace_processor_core_tree_tree", - ":src_trace_processor_core_util_util", - ":src_trace_processor_export_json", - ":src_trace_processor_importers_android_bugreport_android_bugreport", - ":src_trace_processor_importers_android_bugreport_android_dumpstate_event", - ":src_trace_processor_importers_android_bugreport_android_log_event", - ":src_trace_processor_importers_archive_archive", - ":src_trace_processor_importers_art_hprof_art_hprof", - ":src_trace_processor_importers_art_method_art_method", - ":src_trace_processor_importers_art_method_art_method_event", - ":src_trace_processor_importers_collapsed_stack_collapsed_stack", - ":src_trace_processor_importers_common_common", - ":src_trace_processor_importers_common_parser_types", - ":src_trace_processor_importers_common_stats_tracker", - ":src_trace_processor_importers_common_synthetic_tid_hdr", - ":src_trace_processor_importers_common_v8_profile_parser", - ":src_trace_processor_importers_etw_full", - ":src_trace_processor_importers_etw_minimal", - ":src_trace_processor_importers_ftrace_ftrace_descriptors", - ":src_trace_processor_importers_ftrace_full", - ":src_trace_processor_importers_ftrace_minimal", - ":src_trace_processor_importers_fuchsia_fuchsia_record", - ":src_trace_processor_importers_fuchsia_full", - ":src_trace_processor_importers_fuchsia_minimal", - ":src_trace_processor_importers_gecko_gecko", - ":src_trace_processor_importers_gecko_gecko_event", - ":src_trace_processor_importers_generic_kernel_full", - ":src_trace_processor_importers_i2c_full", - ":src_trace_processor_importers_json_json", - ":src_trace_processor_importers_memory_tracker_graph_processor", - ":src_trace_processor_importers_ninja_ninja", - ":src_trace_processor_importers_perf_perf", - ":src_trace_processor_importers_perf_record", - ":src_trace_processor_importers_pprof_pprof", - ":src_trace_processor_importers_primes_primes", - ":src_trace_processor_importers_proto_full", - ":src_trace_processor_importers_proto_minimal", - ":src_trace_processor_importers_proto_packet_sequence_state_generation_hdr", - ":src_trace_processor_importers_proto_proto_importer_module", - ":src_trace_processor_importers_simpleperf_proto_simpleperf_proto", - ":src_trace_processor_importers_syscalls_full", - ":src_trace_processor_importers_systrace_full", - ":src_trace_processor_importers_systrace_systrace_line", - ":src_trace_processor_importers_systrace_systrace_parser", - ":src_trace_processor_io", - ":src_trace_processor_lib", - ":src_trace_processor_metatrace", - ":src_trace_processor_metrics_metrics", - ":src_trace_processor_perfetto_sql_engine_engine", - ":src_trace_processor_perfetto_sql_generator_generator", - ":src_trace_processor_perfetto_sql_intrinsics_types_types", - ":src_trace_processor_perfetto_sql_parser_intrinsic_macro_expansion", - ":src_trace_processor_perfetto_sql_parser_parser", - ":src_trace_processor_perfetto_sql_syntaqlite_syntaqlite", - ":src_trace_processor_perfetto_sql_tokenizer_tokenizer", - ":src_trace_processor_plugins_ancestor_ancestor", - ":src_trace_processor_plugins_ancestor_tables", - ":src_trace_processor_plugins_android_framework_track_event_android_framework_track_event", - ":src_trace_processor_plugins_android_framework_track_event_tables", - ":src_trace_processor_plugins_args_args", - ":src_trace_processor_plugins_art_heap_graph_functions_art_heap_graph_functions", - ":src_trace_processor_plugins_art_process_metadata_importer_art_process_metadata_importer", - ":src_trace_processor_plugins_base64_functions_base64_functions", - ":src_trace_processor_plugins_connected_flow_connected_flow", - ":src_trace_processor_plugins_connected_flow_tables", - ":src_trace_processor_plugins_core_functions_core_functions", - ":src_trace_processor_plugins_counter_intervals_counter_intervals", - ":src_trace_processor_plugins_counter_mipmap_operator_counter_mipmap_operator", - ":src_trace_processor_plugins_create_function_create_function", - ":src_trace_processor_plugins_create_intervals_create_intervals", - ":src_trace_processor_plugins_create_view_function_create_view_function", - ":src_trace_processor_plugins_critical_path_critical_path", - ":src_trace_processor_plugins_critical_path_tables", - ":src_trace_processor_plugins_descendant_descendant", - ":src_trace_processor_plugins_developer_functions_developer_functions", - ":src_trace_processor_plugins_developer_functions_tables", - ":src_trace_processor_plugins_dfs_weight_bounded_dfs_weight_bounded", - ":src_trace_processor_plugins_dfs_weight_bounded_tables", - ":src_trace_processor_plugins_dominator_tree_dominator_tree", - ":src_trace_processor_plugins_dominator_tree_tables", - ":src_trace_processor_plugins_etm_decode_chunk_etm_decode_chunk", - ":src_trace_processor_plugins_etm_iterate_range_etm_iterate_range", - ":src_trace_processor_plugins_experimental_annotated_stack_experimental_annotated_stack", - ":src_trace_processor_plugins_experimental_annotated_stack_tables", - ":src_trace_processor_plugins_experimental_flamegraph_experimental_flamegraph", - ":src_trace_processor_plugins_experimental_flat_slice_experimental_flat_slice", - ":src_trace_processor_plugins_experimental_flat_slice_tables", - ":src_trace_processor_plugins_experimental_slice_layout_experimental_slice_layout", - ":src_trace_processor_plugins_experimental_slice_layout_tables", - ":src_trace_processor_plugins_graph_scan_graph_scan", - ":src_trace_processor_plugins_graph_traversal_graph_traversal", - ":src_trace_processor_plugins_graph_traversal_tables", - ":src_trace_processor_plugins_import_import", - ":src_trace_processor_plugins_interval_intersect_interval_intersect", - ":src_trace_processor_plugins_layout_functions_layout_functions", - ":src_trace_processor_plugins_math_functions_math_functions", - ":src_trace_processor_plugins_metadata_metadata", - ":src_trace_processor_plugins_package_lookup_package_lookup", - ":src_trace_processor_plugins_perf_counter_perf_counter", - ":src_trace_processor_plugins_perf_text_perf_text", - ":src_trace_processor_plugins_perfetto_manifest_perfetto_manifest", - ":src_trace_processor_plugins_pprof_functions_pprof_functions", - ":src_trace_processor_plugins_slice_mipmap_operator_slice_mipmap_operator", - ":src_trace_processor_plugins_span_join_operator_span_join_operator", - ":src_trace_processor_plugins_sql_stats_table_sql_stats_table", - ":src_trace_processor_plugins_stack_functions_stack_functions", - ":src_trace_processor_plugins_stack_sample_importer_stack_sample_importer", - ":src_trace_processor_plugins_stdlib_docs_stdlib_docs", - ":src_trace_processor_plugins_stdlib_docs_tables", - ":src_trace_processor_plugins_storage_tables_storage_tables", - ":src_trace_processor_plugins_strace_strace", - ":src_trace_processor_plugins_string_functions_string_functions", - ":src_trace_processor_plugins_structural_tree_partition_structural_tree_partition", - ":src_trace_processor_plugins_structural_tree_partition_tables", - ":src_trace_processor_plugins_symbolize_symbolize", - ":src_trace_processor_plugins_table_info_table_info", - ":src_trace_processor_plugins_table_info_tables", - ":src_trace_processor_plugins_table_pointer_module_table_pointer_module", - ":src_trace_processor_plugins_time_functions_time_functions", - ":src_trace_processor_plugins_to_ftrace_to_ftrace", - ":src_trace_processor_plugins_trace_export_trace_export", - ":src_trace_processor_plugins_tree_functions_tree_functions", - ":src_trace_processor_plugins_type_builder_functions_type_builder_functions", - ":src_trace_processor_plugins_utils_functions_utils_functions", - ":src_trace_processor_plugins_video_frame_importer_tables", - ":src_trace_processor_plugins_video_frame_importer_video_frame_importer", - ":src_trace_processor_plugins_wattson_wattson", - ":src_trace_processor_plugins_window_operator_window_operator", - ":src_trace_processor_plugins_winscope_importer_winscope_importer", - ":src_trace_processor_plugins_winscope_proto_to_args_with_defaults_tables", - ":src_trace_processor_plugins_winscope_proto_to_args_with_defaults_winscope_proto_to_args_with_defaults", - ":src_trace_processor_plugins_winscope_surfaceflinger_hierarchy_paths_tables", - ":src_trace_processor_plugins_winscope_surfaceflinger_hierarchy_paths_winscope_surfaceflinger_hierarchy_paths", - ":src_trace_processor_plugins_zstd_functions_zstd_functions", - ":src_trace_processor_sorter_sorter", - ":src_trace_processor_sqlite_bindings_bindings", - ":src_trace_processor_sqlite_sqlite", - ":src_trace_processor_storage_minimal", - ":src_trace_processor_storage_storage", - ":src_trace_processor_tables_tables", - ":src_trace_processor_tables_tables_python", - ":src_trace_processor_trace_summary_trace_summary", - ":src_trace_processor_types_types", - ":src_trace_processor_util_args_utils", - ":src_trace_processor_util_blob", - ":src_trace_processor_util_bump_allocator", - ":src_trace_processor_util_clock", - ":src_trace_processor_util_compressor", - ":src_trace_processor_util_decompressor", - ":src_trace_processor_util_descriptors", - ":src_trace_processor_util_elf_elf", - ":src_trace_processor_util_flatbuffer_reader", - ":src_trace_processor_util_flatbuffer_writer", - ":src_trace_processor_util_galloping_search", - ":src_trace_processor_util_glob", - ":src_trace_processor_util_interned_message_view", - ":src_trace_processor_util_json_args", - ":src_trace_processor_util_json_parser", - ":src_trace_processor_util_json_serializer", - ":src_trace_processor_util_json_value", - ":src_trace_processor_util_owned_sql_value", - ":src_trace_processor_util_profile_builder", - ":src_trace_processor_util_profiler_util", - ":src_trace_processor_util_proto_profiler", - ":src_trace_processor_util_proto_to_args_parser", - ":src_trace_processor_util_protozero_to_json", - ":src_trace_processor_util_protozero_to_text", - ":src_trace_processor_util_simple_json_parser", - ":src_trace_processor_util_simple_json_serializer", - ":src_trace_processor_util_sql_argument", - ":src_trace_processor_util_sql_bundle", - ":src_trace_processor_util_sql_module_doc_parser", - ":src_trace_processor_util_stdlib", - ":src_trace_processor_util_tar_writer", - ":src_trace_processor_util_trace_blob_view_reader", - ":src_trace_processor_util_trace_enrichment_trace_enrichment", - ":src_trace_processor_util_trace_type", - ":src_trace_processor_util_zip_reader", - ":src_traceconv_lib", - ":src_traceconv_main", - ":src_traceconv_pprofbuilder", - ":src_traceconv_traceconv_lib", - ":src_traceconv_utils", - ], - visibility = [ - "//visibility:public", - ], - deps = [ - ":protos_perfetto_common_cpp", - ":protos_perfetto_common_semantic_type_zero", - ":protos_perfetto_common_zero", - ":protos_perfetto_config_android_zero", - ":protos_perfetto_config_ftrace_zero", - ":protos_perfetto_config_gpu_zero", - ":protos_perfetto_config_inode_file_zero", - ":protos_perfetto_config_interceptors_zero", - ":protos_perfetto_config_linux_zero", - ":protos_perfetto_config_power_zero", - ":protos_perfetto_config_priority_boost_zero", - ":protos_perfetto_config_process_stats_zero", - ":protos_perfetto_config_profiling_zero", - ":protos_perfetto_config_protovm_zero", - ":protos_perfetto_config_qnx_zero", - ":protos_perfetto_config_statsd_zero", - ":protos_perfetto_config_sys_stats_zero", - ":protos_perfetto_config_system_info_zero", - ":protos_perfetto_config_track_event_zero", - ":protos_perfetto_config_zero", - ":protos_perfetto_perfetto_sql_zero", - ":protos_perfetto_protovm_cpp", - ":protos_perfetto_protovm_zero", - ":protos_perfetto_trace_android_zero", - ":protos_perfetto_trace_chrome_zero", - ":protos_perfetto_trace_etw_zero", - ":protos_perfetto_trace_field_options_zero", - ":protos_perfetto_trace_filesystem_zero", - ":protos_perfetto_trace_ftrace_zero", - ":protos_perfetto_trace_generic_kernel_zero", - ":protos_perfetto_trace_gpu_gpu_interned_data_zero", - ":protos_perfetto_trace_gpu_gpu_track_event_zero", - ":protos_perfetto_trace_gpu_zero", - ":protos_perfetto_trace_interned_data_zero", - ":protos_perfetto_trace_linux_zero", - ":protos_perfetto_trace_minimal_zero", - ":protos_perfetto_trace_non_minimal_zero", - ":protos_perfetto_trace_perfetto_zero", - ":protos_perfetto_trace_power_zero", - ":protos_perfetto_trace_processor_metrics_impl_zero", - ":protos_perfetto_trace_processor_zero", - ":protos_perfetto_trace_profiling_inline_callstack_zero", - ":protos_perfetto_trace_profiling_zero", - ":protos_perfetto_trace_ps_zero", - ":protos_perfetto_trace_statsd_zero", - ":protos_perfetto_trace_summary_zero", - ":protos_perfetto_trace_sys_stats_zero", - ":protos_perfetto_trace_system_info_zero", - ":protos_perfetto_trace_track_event_zero", - ":protos_perfetto_trace_translation_zero", - ":protos_third_party_android_art_art_heap_graph_zero", - ":protos_third_party_android_connectivity_connectivity_network_trace_zero", - ":protos_third_party_android_frameworks_base_proto_tracing_frameworks_base_interned_data_zero", - ":protos_third_party_android_frameworks_base_proto_tracing_frameworks_base_trace_packet_zero", - ":protos_third_party_android_frameworks_base_proto_tracing_frameworks_base_track_event_zero", - ":protos_third_party_android_frameworks_native_tracing_frameworks_native_interned_data_zero", - ":protos_third_party_android_frameworks_native_tracing_frameworks_native_trace_packet_zero", - ":protos_third_party_android_frameworks_native_tracing_winscope_winscope_extensions_zero", - ":protos_third_party_android_frameworks_native_tracing_winscope_winscope_regular_zero", - ":protos_third_party_android_packages_modules_bluetooth_tracing_bluetooth_tracing_zero", - ":protos_third_party_chromium_zero", - ":protos_third_party_pprof_zero", - ":protos_third_party_primes_cpp", - ":protos_third_party_primes_zero", - ":protos_third_party_simpleperf_zero", - ":protozero", - ":src_base_base", - ":src_base_clock_snapshots", - ":src_base_regex_regex", - ":src_base_version", - ":src_protovm_protovm", - ":src_trace_processor_containers_containers", - ":src_trace_processor_importers_proto_gen_cc_android_extension_descriptor", - ":src_trace_processor_importers_proto_gen_cc_chrome_track_event_descriptor", - ":src_trace_processor_importers_proto_gen_cc_gpu_interned_data_descriptor", - ":src_trace_processor_importers_proto_gen_cc_gpu_track_event_descriptor", - ":src_trace_processor_importers_proto_gen_cc_statsd_atoms_descriptor", - ":src_trace_processor_importers_proto_gen_cc_trace_descriptor", - ":src_trace_processor_importers_proto_gen_cc_track_event_descriptor", - ":src_trace_processor_metrics_gen_cc_all_chrome_metrics_descriptor", - ":src_trace_processor_metrics_gen_cc_all_webview_metrics_descriptor", - ":src_trace_processor_metrics_gen_cc_metrics_descriptor", - ":src_trace_processor_metrics_sql_gen_amalgamated_sql_metrics", - ":src_trace_processor_perfetto_sql_stdlib_stdlib", - ":src_trace_processor_plugins_wattson_gen_cpu_1d_curves", - ":src_trace_processor_plugins_wattson_gen_cpu_2d_curves", - ":src_trace_processor_plugins_wattson_gen_gpu_curves", - ":src_trace_processor_plugins_wattson_gen_l3_curves", - ":src_trace_processor_plugins_wattson_gen_tpu_curves", - ":src_trace_processor_trace_summary_gen_cc_trace_summary_descriptor", - ":src_trace_processor_util_build_id", - ":src_trace_processor_util_deobfuscation_deobfuscator", - ":src_trace_processor_util_symbolizer_symbolize_database", - ":src_trace_processor_util_symbolizer_symbolizer", - ":src_traceconv_gen_cc_android_extension_descriptor", - ":src_traceconv_gen_cc_trace_descriptor", - ] + PERFETTO_CONFIG.deps.sqlite + - PERFETTO_CONFIG.deps.sqlite_ext_percentile + - PERFETTO_CONFIG.deps.zlib + - PERFETTO_CONFIG.deps.zstd + - PERFETTO_CONFIG.deps.demangle_wrapper, -) - # GN target: //src/traced/probes:traced_probes perfetto_cc_binary( name = "traced_probes", diff --git a/BUILD.gn b/BUILD.gn index 8d548fa7556..2cf5f7535ab 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -60,22 +60,14 @@ if (enable_perfetto_trace_processor) { } if (enable_perfetto_traceconv) { - all_targets += [ - "src/traceconv", - "src/proto_utils", - ] + # The standalone traceconv host binary has been folded into + # trace_processor_shell (the convert/bundle/util subcommands), so it is no + # longer built here. The src/traceconv:lib conversion code is pulled in + # directly by the shell, and the UI's traceconv WASM module is built via + # ui/BUILD.gn. + all_targets += [ "src/proto_utils" ] if (is_cross_compiling) { - # In many cross-compilation scenarios (typically Android) developers expect - # the host version of traceconv to be available somewhere in out/, so - # they can convert Android traces on their dev machine. Also - # tools/gen_android_bp explicitly depends on the host version for the - # cc_binary_host("traceconv") target in Android.bp. - # Note that when cross-compiling the host executable will be available in - # out/xxx/gcc_like_host/traceconv NOT just out/xxx/traceconv. - all_targets += [ - "src/traceconv($host_toolchain)", - "src/proto_utils($host_toolchain)", - ] + all_targets += [ "src/proto_utils($host_toolchain)" ] } } diff --git a/gn/perfetto_integrationtests.gni b/gn/perfetto_integrationtests.gni index 7352db5fd6b..07dc0b7b944 100644 --- a/gn/perfetto_integrationtests.gni +++ b/gn/perfetto_integrationtests.gni @@ -49,6 +49,8 @@ if (enable_perfetto_trace_processor && perfetto_build_standalone && !is_android) { perfetto_integrationtests_targets += [ "src/trace_processor:integrationtests" ] + perfetto_integrationtests_targets += + [ "src/trace_processor/shell:integrationtests" ] perfetto_integrationtests_targets += [ "src/traceconv:integrationtests" ] perfetto_integrationtests_data_targets += [ "protos/perfetto/trace:test_extensions_slim_descriptor" ] diff --git a/include/perfetto/ext/traceconv/BUILD.gn b/include/perfetto/ext/traceconv/BUILD.gn deleted file mode 100644 index b946081a60a..00000000000 --- a/include/perfetto/ext/traceconv/BUILD.gn +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2024 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -source_set("traceconv") { - sources = [ "traceconv.h" ] -} diff --git a/include/perfetto/ext/traceconv/traceconv.h b/include/perfetto/ext/traceconv/traceconv.h deleted file mode 100644 index 73e6f86750d..00000000000 --- a/include/perfetto/ext/traceconv/traceconv.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef INCLUDE_PERFETTO_EXT_TRACECONV_TRACECONV_H_ -#define INCLUDE_PERFETTO_EXT_TRACECONV_TRACECONV_H_ - -#include "perfetto/base/export.h" - -namespace perfetto::traceconv { - -int PERFETTO_EXPORT_COMPONENT TraceconvMain(int argc, char** argv); - -} // namespace perfetto::traceconv - -#endif // INCLUDE_PERFETTO_EXT_TRACECONV_TRACECONV_H_ diff --git a/infra/luci/recipes/perfetto.py b/infra/luci/recipes/perfetto.py index 0c6170344a5..cce86e4f3f6 100644 --- a/infra/luci/recipes/perfetto.py +++ b/infra/luci/recipes/perfetto.py @@ -43,9 +43,6 @@ { 'name': 'trace_processor_shell' }, - { - 'name': 'traceconv', - }, { 'name': 'tracebox', 'exclude_platforms': ['windows-amd64'] diff --git a/src/trace_processor/shell/BUILD.gn b/src/trace_processor/shell/BUILD.gn index 14afe3d4aa0..ba06f7e654c 100644 --- a/src/trace_processor/shell/BUILD.gn +++ b/src/trace_processor/shell/BUILD.gn @@ -126,3 +126,20 @@ source_set("unittests") { "../../base", ] } + +if (enable_perfetto_integration_tests) { + source_set("integrationtests") { + testonly = true + sources = [ "bundle_integrationtest.cc" ] + deps = [ + "..:trace_processor_shell_lib", + "../../../gn:default_deps", + "../../../gn:gtest_and_gmock", + "../../../include/perfetto/ext/base", + "../../../include/perfetto/ext/trace_processor:trace_processor_shell", + "../../../protos/perfetto/trace:cpp", + "../../../protos/perfetto/trace/profiling:cpp", + "../../base:test_support", + ] + } +} diff --git a/src/traceconv/traceconv_bundle_integrationtest.cc b/src/trace_processor/shell/bundle_integrationtest.cc similarity index 94% rename from src/traceconv/traceconv_bundle_integrationtest.cc rename to src/trace_processor/shell/bundle_integrationtest.cc index 9b8d18a9ec6..427e86497c9 100644 --- a/src/traceconv/traceconv_bundle_integrationtest.cc +++ b/src/trace_processor/shell/bundle_integrationtest.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "perfetto/ext/traceconv/traceconv.h" +#include "perfetto/ext/trace_processor/trace_processor_shell.h" #include #include @@ -31,12 +31,13 @@ #include "src/base/test/utils.h" #include "test/gtest_and_gmock.h" -namespace perfetto::traceconv { +namespace perfetto::trace_processor { namespace { using testing::UnorderedElementsAre; -// Helper: builds an argv from owned strings and invokes TraceconvMain. +// Helper: builds an argv from owned strings and invokes the shell's `bundle` +// subcommand via TraceProcessorShellMain. class ArgvInvoker { public: void Add(const std::string& arg) { args_.push_back(arg); } @@ -45,7 +46,7 @@ class ArgvInvoker { for (auto& s : args_) { argv.push_back(s.data()); } - return TraceconvMain(static_cast(argv.size()), argv.data()); + return TraceProcessorShellMain(static_cast(argv.size()), argv.data()); } private: @@ -131,7 +132,7 @@ TEST_F(TraceconvBundleTest, BundleWithProguardMap) { " void bar() -> b\n"); ArgvInvoker invoker; - invoker.Add("traceconv"); + invoker.Add("trace_processor_shell"); invoker.Add("bundle"); invoker.Add("--no-auto-symbol-paths"); invoker.Add("--proguard-map"); @@ -176,7 +177,7 @@ TEST_F(TraceconvBundleTest, BundleWithRepeatedProguardMaps) { base::TempFile map2 = WriteTempFile("com.example.Bar -> b.b:\n"); ArgvInvoker invoker; - invoker.Add("traceconv"); + invoker.Add("trace_processor_shell"); invoker.Add("bundle"); invoker.Add("--no-auto-symbol-paths"); invoker.Add("--proguard-map"); @@ -200,7 +201,7 @@ TEST_F(TraceconvBundleTest, BundleWithProguardMapNoPackage) { base::TempFile mapping = WriteTempFile("com.example.Foo -> a.a:\n"); ArgvInvoker invoker; - invoker.Add("traceconv"); + invoker.Add("trace_processor_shell"); invoker.Add("bundle"); invoker.Add("--no-auto-symbol-paths"); invoker.Add("--proguard-map"); @@ -224,7 +225,7 @@ TEST_F(TraceconvBundleTest, BundleWithProguardMapNoPackage) { // Explicit --proguard-map pointing at a missing file must fail the command. TEST_F(TraceconvBundleTest, BundleWithMissingProguardMapFails) { ArgvInvoker invoker; - invoker.Add("traceconv"); + invoker.Add("trace_processor_shell"); invoker.Add("bundle"); invoker.Add("--no-auto-symbol-paths"); invoker.Add("--proguard-map"); @@ -238,7 +239,7 @@ TEST_F(TraceconvBundleTest, BundleWithMissingProguardMapFails) { // --proguard-map with no following argument is a usage error. TEST_F(TraceconvBundleTest, BundleProguardMapMissingArgFails) { ArgvInvoker invoker; - invoker.Add("traceconv"); + invoker.Add("trace_processor_shell"); invoker.Add("bundle"); invoker.Add("--proguard-map"); @@ -253,7 +254,7 @@ TEST_F(TraceconvBundleTest, BundleNoAutoProguardMapsWithExplicit) { base::TempFile mapping = WriteTempFile("com.example.Foo -> a.a:\n"); ArgvInvoker invoker; - invoker.Add("traceconv"); + invoker.Add("trace_processor_shell"); invoker.Add("bundle"); invoker.Add("--no-auto-symbol-paths"); invoker.Add("--no-auto-proguard-maps"); @@ -271,4 +272,4 @@ TEST_F(TraceconvBundleTest, BundleNoAutoProguardMapsWithExplicit) { } } // namespace -} // namespace perfetto::traceconv +} // namespace perfetto::trace_processor diff --git a/src/traceconv/BUILD.gn b/src/traceconv/BUILD.gn index 56b31a18285..c0b62875cca 100644 --- a/src/traceconv/BUILD.gn +++ b/src/traceconv/BUILD.gn @@ -18,13 +18,11 @@ import("../../gn/perfetto_host_executable.gni") import("../../gn/test.gni") import("../../gn/wasm.gni") -executable("traceconv") { - testonly = true - deps = [ - ":main", - "../../gn:default_deps", - ] -} +# NOTE: there is no longer a standalone "traceconv" executable. The host CLI is +# now trace_processor_shell (the convert/bundle/util subcommands, plus +# traceconv-name compatibility), and the conversion implementation below +# (":lib") is linked directly by the shell. The only artifact still built from +# this directory is the UI's "traceconv" WASM module (wasm_lib below). source_set("utils") { deps = [ @@ -119,28 +117,6 @@ source_set("lib") { ] } -source_set("main") { - deps = [ - ":traceconv_lib", - "../../gn:default_deps", - ] - sources = [ "main.cc" ] -} - -source_set("traceconv_lib") { - deps = [ - ":gen_cc_android_extension_descriptor", - ":gen_cc_trace_descriptor", - ":lib", - "../../gn:default_deps", - "../../include/perfetto/ext/base:base", - "../base:version", - "../protozero/text_to_proto", - ] - public_deps = [ "../../include/perfetto/ext/traceconv:traceconv" ] - sources = [ "traceconv.cc" ] -} - if (enable_perfetto_ui) { wasm_lib("traceconv_wasm") { name = "traceconv" @@ -149,9 +125,14 @@ if (enable_perfetto_ui) { enable_web_environment = true enable_filesystem = true deps = [ - ":main", + ":gen_cc_android_extension_descriptor", + ":gen_cc_trace_descriptor", + ":lib", "../../gn:default_deps", + "../../include/perfetto/ext/base:base", + "../protozero/text_to_proto", ] + sources = [ "wasm_main.cc" ] } } @@ -170,7 +151,6 @@ if (enable_perfetto_integration_tests) { testonly = true deps = [ ":lib", - ":traceconv_lib", "../../gn:default_deps", "../../gn:gtest_and_gmock", "../../include/perfetto/base", @@ -186,7 +166,6 @@ if (enable_perfetto_integration_tests) { "pprof_reader.h", "trace_to_pprof_integrationtest.cc", "trace_to_text_integrationtest.cc", - "traceconv_bundle_integrationtest.cc", ] } } diff --git a/src/traceconv/main.cc b/src/traceconv/main.cc deleted file mode 100644 index e710999bbe2..00000000000 --- a/src/traceconv/main.cc +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "perfetto/ext/traceconv/traceconv.h" - -int main(int argc, char** argv) { - return perfetto::traceconv::TraceconvMain(argc, argv); -} diff --git a/src/traceconv/traceconv.cc b/src/traceconv/traceconv.cc deleted file mode 100644 index 31bb5279fda..00000000000 --- a/src/traceconv/traceconv.cc +++ /dev/null @@ -1,445 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "perfetto/ext/traceconv/traceconv.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "perfetto/base/build_config.h" -#include "perfetto/base/logging.h" -#include "perfetto/ext/base/file_utils.h" -#include "perfetto/ext/base/string_utils.h" -#include "perfetto/ext/base/utils.h" -#include "perfetto/ext/base/version.h" -#include "perfetto/profiling/pprof_builder.h" -#include "src/protozero/text_to_proto/text_to_proto.h" -#include "src/traceconv/android_extension.descriptor.h" -#include "src/traceconv/deobfuscate_profile.h" -#include "src/traceconv/symbolize_profile.h" -#include "src/traceconv/trace.descriptor.h" -#include "src/traceconv/trace_to_bundle.h" -#include "src/traceconv/trace_to_firefox.h" -#include "src/traceconv/trace_to_json.h" -#include "src/traceconv/trace_to_profile.h" -#include "src/traceconv/trace_to_systrace.h" -#include "src/traceconv/trace_to_text.h" -#include "src/traceconv/trace_unpack.h" - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -#include -#include -#endif - -namespace perfetto::traceconv { -namespace { - -int Usage(const char* argv0) { - fprintf(stderr, R"( -Trace format conversion tool. -Usage: %s MODE [OPTIONS] [input_file] [output_file] - -CONVERSION MODES AND THEIR SUPPORTED OPTIONS: - - systrace Converts to systrace HTML format - --truncate [start|end] Truncates trace to keep start or end - --full-sort Forces full trace sorting - - json Converts to Chrome JSON format - --truncate [start|end] Truncates trace to keep start or end - --full-sort Forces full trace sorting - - ctrace Converts to compressed systrace format - --truncate [start|end] Truncates trace to keep start or end - --full-sort Forces full trace sorting - - text Converts to human-readable text format - --skip-unknown Skip unknown fields when converting to text - - profile Converts profile data to pprof format - (default: auto-detect profile type) - --alloc Convert only the allocator profile - --perf Convert only the perf profile - --java-heap Convert only the heap graph profile - --no-annotations Don't add derived annotations to frames - --timestamps T1,T2,... Generate profiles for specific timestamps - --pid PID Generate profiles for specific process - --output-dir DIR Output directory for profiles (default: random tmp) - - java_heap_profile Legacy alias for "profile --java-heap" - - symbolize Symbolizes addresses in profiles - (no additional options) - - deobfuscate Deobfuscates obfuscated profiles - (no additional options) - - firefox Converts to Firefox profiler format - (no additional options) - - decompress_packets Decompresses compressed trace packets - (no additional options) - - bundle Creates bundle with trace + debug data - (outputs TAR with symbols/deobfuscation mappings) - Requires input and output file paths (no stdin/stdout) - --symbol-paths PATH1,PATH2,... Additional paths to search for symbols - (beyond automatic discovery) - --no-auto-symbol-paths Disable automatic symbol path discovery - --proguard-map [pkg=]PATH ProGuard/R8 mapping.txt for Java/Kotlin - deobfuscation (may be repeated). - pkg= prefix scopes the map to a package. - --no-auto-proguard-maps Disable automatic ProGuard/R8 mapping - discovery (e.g. Gradle project layout) - --verbose Print more detailed output - - binary Converts text proto to binary format - (no additional options) - -NOTES: - - If no input file is specified, reads from stdin - - If no output file is specified, writes to stdout - - Input/output files can be '-' to explicitly use stdin/stdout -)", - argv0); - return 1; -} - -uint64_t StringToUint64OrDie(const char* str) { - char* end; - uint64_t number = static_cast(strtoll(str, &end, 10)); - if (*end != '\0') { - PERFETTO_ELOG("Invalid %s. Expected decimal integer.", str); - exit(1); - } - return number; -} - -int TextToTrace(std::istream* input, std::ostream* output) { - std::string trace_text(std::istreambuf_iterator{*input}, - std::istreambuf_iterator{}); - std::vector descriptors; - descriptors.reserve(kTraceDescriptor.size() + - kAndroidExtensionDescriptor.size()); - descriptors.insert(descriptors.end(), kTraceDescriptor.begin(), - kTraceDescriptor.end()); - descriptors.insert(descriptors.end(), kAndroidExtensionDescriptor.begin(), - kAndroidExtensionDescriptor.end()); - auto proto_status = - protozero::TextToProto(descriptors.data(), descriptors.size(), - ".perfetto.protos.Trace", "trace", trace_text); - if (!proto_status.ok()) { - PERFETTO_ELOG("Failed to parse trace: %s", - proto_status.status().c_message()); - return 1; - } - const std::vector& trace_proto = proto_status.value(); - output->write(reinterpret_cast(trace_proto.data()), - static_cast(trace_proto.size())); - return 0; -} - -int Main(int argc, char** argv) { - std::vector positional_args; - trace_to_text::Keep truncate_keep = trace_to_text::Keep::kAll; - uint64_t pid = 0; - std::vector timestamps; - bool full_sort = false; - std::optional profile_type; - bool profile_no_annotations = false; - std::vector symbol_paths; - std::vector proguard_maps; - bool no_auto_symbol_paths = false; - bool no_auto_proguard_maps = false; - bool verbose = false; - bool skip_unknown_fields = false; - std::string output_dir; - for (int i = 1; i < argc; i++) { - if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) { - printf("%s\n", base::GetVersionString()); - return 0; - } - if (strcmp(argv[i], "-t") == 0 || strcmp(argv[i], "--truncate") == 0) { - i++; - if (i <= argc && strcmp(argv[i], "start") == 0) { - truncate_keep = trace_to_text::Keep::kStart; - } else if (i <= argc && strcmp(argv[i], "end") == 0) { - truncate_keep = trace_to_text::Keep::kEnd; - } else { - PERFETTO_ELOG( - "--truncate must specify whether to keep the end or the " - "start of the trace."); - return Usage(argv[0]); - } - } else if (i <= argc && strcmp(argv[i], "--pid") == 0) { - i++; - pid = StringToUint64OrDie(argv[i]); - } else if (i <= argc && strcmp(argv[i], "--timestamps") == 0) { - i++; - std::vector ts_strings = base::SplitString(argv[i], ","); - for (const std::string& ts : ts_strings) { - timestamps.emplace_back(StringToUint64OrDie(ts.c_str())); - } - } else if (strcmp(argv[i], "--alloc") == 0) { - profile_type = trace_to_text::ConversionMode::kHeapProfile; - } else if (strcmp(argv[i], "--perf") == 0) { - profile_type = trace_to_text::ConversionMode::kPerfProfile; - } else if (strcmp(argv[i], "--java-heap") == 0) { - profile_type = trace_to_text::ConversionMode::kJavaHeapProfile; - } else if (strcmp(argv[i], "--no-annotations") == 0) { - profile_no_annotations = true; - } else if (strcmp(argv[i], "--full-sort") == 0) { - full_sort = true; - } else if (i < argc && strcmp(argv[i], "--symbol-paths") == 0) { - i++; - symbol_paths = base::SplitString(argv[i], ","); - } else if (strcmp(argv[i], "--no-auto-symbol-paths") == 0) { - no_auto_symbol_paths = true; - } else if (strcmp(argv[i], "--no-auto-proguard-maps") == 0) { - no_auto_proguard_maps = true; - } else if (i < argc && strcmp(argv[i], "--proguard-map") == 0) { - i++; - if (i >= argc) { - PERFETTO_ELOG("--proguard-map requires an argument."); - return Usage(argv[0]); - } - std::string arg = argv[i]; - size_t eq = arg.find('='); - trace_to_text::ProguardMapSpec spec; - if (eq == std::string::npos) { - spec.path = std::move(arg); - } else { - spec.package = arg.substr(0, eq); - spec.path = arg.substr(eq + 1); - } - proguard_maps.push_back(std::move(spec)); - } else if (strcmp(argv[i], "--verbose") == 0) { - verbose = true; - } else if (i < argc && strcmp(argv[i], "--output-dir") == 0) { - i++; - if (i >= argc) { - PERFETTO_ELOG("--output-dir requires an argument."); - return Usage(argv[0]); - } - output_dir = argv[i]; - } else if (strcmp(argv[i], "--skip-unknown") == 0) { - skip_unknown_fields = true; - } else { - positional_args.push_back(argv[i]); - } - } - - if (positional_args.empty()) - return Usage(argv[0]); - - std::istream* input_stream; - std::ifstream file_istream; - if (positional_args.size() > 1) { - const char* file_path = positional_args[1]; - file_istream.open(file_path, std::ios_base::in | std::ios_base::binary); - if (!file_istream.is_open()) - PERFETTO_FATAL("Could not open %s", file_path); - input_stream = &file_istream; - } else { - if (base::IsTty(stdin)) { - PERFETTO_ELOG("Reading from stdin but it's connected to a TTY"); - PERFETTO_LOG("It is unlikely that you want to type in some binary."); - PERFETTO_LOG("Either pass a file path to the cmdline or pipe stdin"); - return Usage(argv[0]); - } - input_stream = &std::cin; - } - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - // We don't want the runtime to replace "\n" with "\r\n" on `std::cout`. - _setmode(_fileno(stdout), _O_BINARY); -#endif - - std::string format(positional_args[0]); - - std::ostream* output_stream; - std::ofstream file_ostream; - if (positional_args.size() > 2) { - const char* file_path = positional_args[2]; - file_ostream.open(file_path, std::ios_base::out | std::ios_base::trunc | - std::ios_base::binary); - if (!file_ostream.is_open()) - PERFETTO_FATAL("Could not open %s", file_path); - output_stream = &file_ostream; - } else { - // Binary formats would corrupt an interactive terminal if printed on it. - if ((format == "binary" || format == "ctrace" || - format == "decompress_packets" || format == "symbolize" || - format == "deobfuscate") && - base::IsTty(stdout)) { - PERFETTO_ELOG( - "Refusing to write binary output to a terminal. Pass an output " - "file path or redirect stdout."); - return 1; - } - output_stream = &std::cout; - } - - if ((format != "profile" && format != "java_heap_profile") && - (pid != 0 || !timestamps.empty())) { - PERFETTO_ELOG( - "--pid and --timestamps are supported only for profile " - "and java_heap_profile formats."); - return 1; - } - - if ((format != "profile" && format != "java_heap_profile") && - !output_dir.empty()) { - PERFETTO_ELOG( - "--output-dir is supported only for profile and java_heap_profile " - "formats."); - return 1; - } - - if (format == "binary") { - return TextToTrace(input_stream, output_stream); - } - - if (format == "json") - return trace_to_text::TraceToJson(input_stream, output_stream, - /*compress=*/false, truncate_keep, - full_sort); - - if (format == "systrace") - return trace_to_text::TraceToSystrace(input_stream, output_stream, - /*ctrace=*/false, truncate_keep, - full_sort); - - if (format == "ctrace") - return trace_to_text::TraceToSystrace(input_stream, output_stream, - /*ctrace=*/true, truncate_keep, - full_sort); - - if (truncate_keep != trace_to_text::Keep::kAll) { - PERFETTO_ELOG( - "--truncate is unsupported for " - "text|profile|symbolize|decompress_packets format."); - return 1; - } - - if (full_sort) { - PERFETTO_ELOG( - "--full-sort is unsupported for " - "text|profile|symbolize|decompress_packets format."); - return 1; - } - - if (format == "text") { - trace_to_text::TraceToTextOptions options; - options.skip_unknown_fields = skip_unknown_fields; - return trace_to_text::TraceToText(input_stream, output_stream, options) ? 0 - : 1; - } - - if (format == "profile") { - if (positional_args.size() > 2) { - PERFETTO_ELOG( - "output file is not supported for \"profile\", use --output-dir " - "instead"); - return Usage(argv[0]); - } - return trace_to_text::TraceToProfile(input_stream, pid, timestamps, - !profile_no_annotations, output_dir, - profile_type, verbose); - } - - if (format == "java_heap_profile") { - // legacy alias for "profile --java-heap" - return trace_to_text::TraceToProfile( - input_stream, pid, timestamps, !profile_no_annotations, output_dir, - trace_to_text::ConversionMode::kJavaHeapProfile, verbose); - } - - if (format == "symbolize") - return trace_to_text::SymbolizeProfile(input_stream, output_stream, - verbose); - - if (format == "deobfuscate") - return trace_to_text::DeobfuscateProfile(input_stream, output_stream); - - if (format == "firefox") - return trace_to_text::TraceToFirefoxProfile(input_stream, output_stream); - - if (format == "decompress_packets") - return trace_to_text::UnpackCompressedPackets(input_stream, output_stream); - - if (format == "bundle") { - // Bundle mode requires both input and output file paths - if (positional_args.size() < 3) { - PERFETTO_ELOG("Bundle mode requires both input and output file paths"); - return Usage(argv[0]); - } - - const char* input_file = positional_args[1]; - const char* output_file = positional_args[2]; - - // Validate that stdin/stdout are not used for bundle mode - if (strcmp(input_file, "-") == 0) { - PERFETTO_ELOG( - "Bundle mode does not support stdin input, provide file path"); - return 1; - } - if (strcmp(output_file, "-") == 0) { - PERFETTO_ELOG( - "Bundle mode does not support stdout output, provide file path"); - return 1; - } - - // Validate input file exists and is readable - if (!base::FileExists(input_file)) { - PERFETTO_ELOG("Input file does not exist: %s", input_file); - return 1; - } - - trace_to_text::BundleContext context; - context.symbol_paths = symbol_paths; - context.proguard_maps = std::move(proguard_maps); - context.no_auto_symbol_paths = no_auto_symbol_paths; - context.no_auto_proguard_maps = no_auto_proguard_maps; - context.verbose = verbose; - if (const char* val = getenv("ANDROID_PRODUCT_OUT")) { - context.android_product_out = val; - } - if (const char* val = getenv("HOME")) { - context.home_dir = val; - } - context.root_dir = "/"; - return trace_to_text::TraceToBundle(input_file, output_file, context); - } - - return Usage(argv[0]); -} - -} // namespace - -int TraceconvMain(int argc, char** argv) { - return Main(argc, argv); -} - -} // namespace perfetto::traceconv diff --git a/src/traceconv/wasm_main.cc b/src/traceconv/wasm_main.cc new file mode 100644 index 00000000000..b2657140401 --- /dev/null +++ b/src/traceconv/wasm_main.cc @@ -0,0 +1,263 @@ +/* + * Copyright (C) 2026 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Thin conversion-only entry point for the trace_processor "traceconv" WASM +// module used by the Perfetto UI (see ui/src/traceconv/index.ts). It exposes a +// trimmed traceconv-style CLI -- ` [input] [output]` -- covering only +// the format conversions the UI needs (json/systrace/profile and friends). The +// symbolize/deobfuscate/bundle modes are intentionally excluded: they are +// host-only and not invoked from the browser. The full host CLI lives in +// trace_processor_shell (the `convert`/`bundle`/`util` subcommands); this file +// is deliberately standalone so the WASM links only the lightweight +// src/traceconv:lib conversion code and not the rpc/httpd-heavy shell. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "perfetto/base/build_config.h" +#include "perfetto/base/logging.h" +#include "perfetto/ext/base/string_utils.h" +#include "src/protozero/text_to_proto/text_to_proto.h" +#include "src/traceconv/android_extension.descriptor.h" +#include "src/traceconv/trace.descriptor.h" +#include "src/traceconv/trace_to_firefox.h" +#include "src/traceconv/trace_to_json.h" +#include "src/traceconv/trace_to_profile.h" +#include "src/traceconv/trace_to_systrace.h" +#include "src/traceconv/trace_to_text.h" +#include "src/traceconv/trace_unpack.h" + +#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) +#include +#include +#else +#include +#endif + +namespace perfetto::traceconv { +namespace { + +int Usage(const char* argv0) { + fprintf(stderr, + "Usage: %s MODE [OPTIONS] [input_file] [output_file]\n" + "MODE is one of: json, systrace, ctrace, text, profile, " + "java_heap_profile, firefox, decompress_packets, binary.\n", + argv0); + return 1; +} + +uint64_t StringToUint64OrDie(const char* str) { + std::optional n = base::CStringToUInt64(str); + if (!n) { + PERFETTO_ELOG("Invalid %s. Expected decimal integer.", str); + exit(1); + } + return *n; +} + +int TextToTrace(std::istream* input, std::ostream* output) { + std::string trace_text(std::istreambuf_iterator{*input}, + std::istreambuf_iterator{}); + std::vector descriptors; + descriptors.reserve(kTraceDescriptor.size() + + kAndroidExtensionDescriptor.size()); + descriptors.insert(descriptors.end(), kTraceDescriptor.begin(), + kTraceDescriptor.end()); + descriptors.insert(descriptors.end(), kAndroidExtensionDescriptor.begin(), + kAndroidExtensionDescriptor.end()); + auto proto_status = + protozero::TextToProto(descriptors.data(), descriptors.size(), + ".perfetto.protos.Trace", "trace", trace_text); + if (!proto_status.ok()) { + PERFETTO_ELOG("Failed to parse trace: %s", + proto_status.status().c_message()); + return 1; + } + const std::vector& trace_proto = proto_status.value(); + output->write(reinterpret_cast(trace_proto.data()), + static_cast(trace_proto.size())); + return 0; +} + +int Main(int argc, char** argv) { + std::vector positional_args; + trace_to_text::Keep truncate_keep = trace_to_text::Keep::kAll; + uint64_t pid = 0; + std::vector timestamps; + bool full_sort = false; + std::optional profile_type; + bool profile_no_annotations = false; + bool verbose = false; + bool skip_unknown_fields = false; + std::string output_dir; + for (int i = 1; i < argc; i++) { + if (strcmp(argv[i], "-t") == 0 || strcmp(argv[i], "--truncate") == 0) { + i++; + if (i < argc && strcmp(argv[i], "start") == 0) { + truncate_keep = trace_to_text::Keep::kStart; + } else if (i < argc && strcmp(argv[i], "end") == 0) { + truncate_keep = trace_to_text::Keep::kEnd; + } else { + PERFETTO_ELOG( + "--truncate must specify whether to keep 'start' or 'end'."); + return Usage(argv[0]); + } + } else if (i < argc && strcmp(argv[i], "--pid") == 0) { + pid = StringToUint64OrDie(argv[++i]); + } else if (i < argc && strcmp(argv[i], "--timestamps") == 0) { + for (const std::string& ts : base::SplitString(argv[++i], ",")) { + timestamps.emplace_back(StringToUint64OrDie(ts.c_str())); + } + } else if (strcmp(argv[i], "--alloc") == 0) { + profile_type = trace_to_text::ConversionMode::kHeapProfile; + } else if (strcmp(argv[i], "--perf") == 0) { + profile_type = trace_to_text::ConversionMode::kPerfProfile; + } else if (strcmp(argv[i], "--java-heap") == 0) { + profile_type = trace_to_text::ConversionMode::kJavaHeapProfile; + } else if (strcmp(argv[i], "--no-annotations") == 0) { + profile_no_annotations = true; + } else if (strcmp(argv[i], "--full-sort") == 0) { + full_sort = true; + } else if (strcmp(argv[i], "--verbose") == 0) { + verbose = true; + } else if (i < argc && strcmp(argv[i], "--output-dir") == 0) { + output_dir = argv[++i]; + } else if (strcmp(argv[i], "--skip-unknown") == 0) { + skip_unknown_fields = true; + } else { + positional_args.push_back(argv[i]); + } + } + + if (positional_args.empty()) + return Usage(argv[0]); + + std::istream* input_stream; + std::ifstream file_istream; + if (positional_args.size() > 1) { + const char* file_path = positional_args[1]; + file_istream.open(file_path, std::ios_base::in | std::ios_base::binary); + if (!file_istream.is_open()) + PERFETTO_FATAL("Could not open %s", file_path); + input_stream = &file_istream; + } else { + input_stream = &std::cin; + } + +#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) + _setmode(_fileno(stdout), _O_BINARY); +#endif + + std::ostream* output_stream; + std::ofstream file_ostream; + if (positional_args.size() > 2) { + const char* file_path = positional_args[2]; + file_ostream.open(file_path, std::ios_base::out | std::ios_base::trunc | + std::ios_base::binary); + if (!file_ostream.is_open()) + PERFETTO_FATAL("Could not open %s", file_path); + output_stream = &file_ostream; + } else { + output_stream = &std::cout; + } + + std::string format(positional_args[0]); + + if ((format != "profile" && format != "java_heap_profile") && + (pid != 0 || !timestamps.empty())) { + PERFETTO_ELOG( + "--pid and --timestamps are supported only for profile formats."); + return 1; + } + if ((format != "profile" && format != "java_heap_profile") && + !output_dir.empty()) { + PERFETTO_ELOG("--output-dir is supported only for profile formats."); + return 1; + } + + if (format == "binary") + return TextToTrace(input_stream, output_stream); + + if (format == "json") + return trace_to_text::TraceToJson(input_stream, output_stream, + /*compress=*/false, truncate_keep, + full_sort); + + if (format == "systrace") + return trace_to_text::TraceToSystrace(input_stream, output_stream, + /*ctrace=*/false, truncate_keep, + full_sort); + + if (format == "ctrace") + return trace_to_text::TraceToSystrace(input_stream, output_stream, + /*ctrace=*/true, truncate_keep, + full_sort); + + if (truncate_keep != trace_to_text::Keep::kAll) { + PERFETTO_ELOG("--truncate is unsupported for the '%s' format.", + format.c_str()); + return 1; + } + if (full_sort) { + PERFETTO_ELOG("--full-sort is unsupported for the '%s' format.", + format.c_str()); + return 1; + } + + if (format == "text") { + trace_to_text::TraceToTextOptions options; + options.skip_unknown_fields = skip_unknown_fields; + return trace_to_text::TraceToText(input_stream, output_stream, options) ? 0 + : 1; + } + + if (format == "profile") + return trace_to_text::TraceToProfile(input_stream, pid, timestamps, + !profile_no_annotations, output_dir, + profile_type, verbose); + + if (format == "java_heap_profile") + return trace_to_text::TraceToProfile( + input_stream, pid, timestamps, !profile_no_annotations, output_dir, + trace_to_text::ConversionMode::kJavaHeapProfile, verbose); + + if (format == "firefox") + return trace_to_text::TraceToFirefoxProfile(input_stream, output_stream) + ? 0 + : 1; + + if (format == "decompress_packets") + return trace_to_text::UnpackCompressedPackets(input_stream, output_stream) + ? 0 + : 1; + + return Usage(argv[0]); +} + +} // namespace +} // namespace perfetto::traceconv + +int main(int argc, char** argv) { + return perfetto::traceconv::Main(argc, argv); +} diff --git a/tools/gen_android_bp b/tools/gen_android_bp index 42d49076af0..134e2e39138 100755 --- a/tools/gen_android_bp +++ b/tools/gen_android_bp @@ -101,7 +101,6 @@ protozero_descriptor_diff_target = '//src/protozero/descriptor_diff:protozero_de gn_utils.HOST_TOOLCHAIN) default_targets += [ - '//src/traceconv:traceconv(%s)' % gn_utils.HOST_TOOLCHAIN, '//src/tools:tracing_proto_extensions(%s)' % gn_utils.HOST_TOOLCHAIN, '//src/protovm/compiler:protovm_compiler(%s)' % gn_utils.HOST_TOOLCHAIN, protozero_plugin, @@ -202,7 +201,6 @@ transitive_proto_filegroups = { needs_libfts = [ '//:perfetto_unittests', '//src/trace_processor:trace_processor_shell_lib', - '//src/traceconv:traceconv', ] # All module names are prefixed with this string to avoid collisions. @@ -935,8 +933,8 @@ class Blueprint(object): def label_to_module_name(label: str): """Turn a GN label (e.g., //:perfetto_tests) into a module name.""" # If the label is explicibly listed in the default target list, don't prefix - # its name and return just the target name. This is so tools like - # "traceconv" stay as such in the Android tree. + # its name and return just the target name. This is so host tools keep their + # bare name in the Android tree. label_without_toolchain = gn_utils.label_without_toolchain(label) if label in default_targets or label_without_toolchain in default_targets: return label_without_toolchain.split(':')[-1] diff --git a/tools/gen_bazel b/tools/gen_bazel index 1ad9bc7a435..76be68f34b1 100755 --- a/tools/gen_bazel +++ b/tools/gen_bazel @@ -97,7 +97,6 @@ public_targets = [ '//src/traced/service:traced', '//src/trace_processor:trace_processor_shell', '//src/trace_processor:trace_processor', - '//src/traceconv:traceconv', ] # These targets will be exported with visibility only to our allowlist. diff --git a/tools/release/package-github-release-artifacts b/tools/release/package-github-release-artifacts index 5f0baedb91b..932346443c4 100755 --- a/tools/release/package-github-release-artifacts +++ b/tools/release/package-github-release-artifacts @@ -44,9 +44,6 @@ _ARTIFACTS = [ { 'name': 'trace_processor_shell' }, - { - 'name': 'traceconv' - }, { 'name': 'tracebox', 'exclude_platforms': ['windows-amd64'],