Perfetto笔记-1-Perfetto官方文档翻译-2-Advanced Trace Analysis-1-PerfettoSQL
PerfettoSQL有两部分,这里是第二部分:
(1) Trace Analysis / PerfettoSQL: https://perfetto.dev/docs/analysis/perfetto-sql-getting-started
(2) Advanced Trace Analysis / PerfettoSQL Prelude: https://perfetto.dev/docs/analysis/sql-tables#slice
这个里面有讲解各个表之间的关系和各个表中的字段
注: 本文翻译自:Advanced Trace Analysis/PerfettoSQL Prelude: https://perfetto.dev/docs/analysis/sql-tables#slice
一、Tables diagram
1. Events tables

注: 还是看原网址上的原图要好一些,点击可以直接跳转。
2. Android tables

3. Callstack profilers tables

4. Metadata tables

5. Winscope tables

6. Misc tables

注: 下面是详细解释每个表的每个成员的含义的内容了,这里不再翻译,有需要看原文链接。
二、Events
1. slice
select * from slice 看有值。成员:
id ts dur track_id category name depth parent_id arg_set_id thread_ts thread_dur thread_instruction_count thread_instruction_delta cat slice_id
注: 还有一个 slices 表,但看其内容是同一个表。
2. ftrace_event
select * from ftrace_event 看有值。成员:
id ts name cpu utid arg_set_id common_flags ucpu
3. sched
select * from sched 看有值。成员:
id ts dur cpu utid end_state priority ucpu ts_end
注: 表示任务每次在cpu上运行的时间。还有一个别名 sched_slice 表。
4. spurious_sched_wakeup
select * from spurious_sched_wakeup 看有值。成员:
id ts thread_state_id irq_context utid waker_utid
注: 看起来是显示执行虚假唤醒动作的线程。实测 irq_context 恒为NULL.
5. thread_state
select * from thread_state 看有值。成员:
id ts dur cpu utid state io_wait blocked_function waker_utid waker_id irq_context ucpu
三、Android
1. android_dumpstate
select * from android_dumpstate 看没有值。成员:
id section service line
2. android_game_intervention_list
select * from android_game_intervention_list 看没有值。成员:
id package_name uid current_mode standard_mode_supported standard_mode_downscale
standard_mode_use_angle standard_mode_fps perf_mode_supported perf_mode_downscale
perf_mode_use_angle perf_mode_fps battery_mode_supported battery_mode_downscale
battery_mode_use_angle battery_mode_fps
四、Callstack profilers
1. stack_profile_mapping
select * from stack_profile_mapping 看没有值。成员:
id build_id exact_offset start_offset start end load_bias name
2. stack_profile_frame
select * from stack_profile_frame 看没有值。成员:
id name mapping rel_pc symbol_set_id deobfuscated_name
3. stack_profile_callsite
select * from stack_profile_callsite 看没有值。成员:
id depth parent_id frame_id
4. cpu_profile_stack_sample
select * from cpu_profile_stack_sample 看没有值。成员:
id ts callsite_id utid process_priority
5. heap_profile_allocation
select * from heap_profile_allocation 看没有值。成员:
id ts upid heap_name callsite_id count size
6. instruments_sample
select * from instruments_sample 看没有值。成员:
id ts utid callsite_id cpu
7. perf_session
select * from perf_session 看没有值。成员:
id cmdline perf_session_id
8. perf_sample
select * from perf_sample 看没有值。成员:
id ts utid cpu cpu_mode callsite_id unwind_error perf_session_id
9. profiler_smaps
select * from profiler_smaps 看没有值。成员:
id upid ts path size_kb private_dirty_kb swap_kb file_name start_address module_timestamp
module_debugid module_debug_path protection_flags private_clean_resident_kb
shared_dirty_resident_kb shared_clean_resident_kb locked_kb proportional_resident_kb
10. stack_profile_symbol
select * from stack_profile_symbol 看没有值。成员:
id symbol_set_id name source_file line_number inlined
五、Metadata
1. machine
select * from machine 看有值,只有一行。成员:
id raw_id sysname release version arch num_cpus android_build_fingerprint
android_device_manufacturer android_sdk_version
2. process
select * from process 看有值。成员:
upid id pid name start_ts end_ts parent_upid uid android_appid android_user_id
cmdline arg_set_id machine_id
3. thread
select * from thread 看有值。成员:
utid id tid name start_ts end_ts upid is_main_thread is_idle machine_id arg_set_id
4. filedescriptor
select * from filedescriptor 看没有值。成员:
id ufd fd ts upid path
5. metadata
select * from metadata 看有值。成员:
id name key_type int_value str_value
六、Winscope
1. surfaceflinger_layers_snapshot
select * from surfaceflinger_layers_snapshot 看没有值。成员:
id ts arg_set_id base64_proto_id sequence_id has_invalid_elapsed_ts
2. surfaceflinger_layer
select * from surfaceflinger_layer 看没有值。成员:
id snapshot_id arg_set_id base64_proto_id layer_id layer_name is_visible parent corner_radius_tl
corner_radius_tr corner_radius_bl corner_radius_br hwc_composition_type is_hidden_by_policy
z_order_relative_of is_missing_z_parent layer_rect_id input_rect_id
3. surfaceflinger_transactions
select * from surfaceflinger_transactions 看没有值。成员:
id ts arg_set_id base64_proto_id vsync_id
4. window_manager_shell_transitions
select * from window_manager_shell_transitions 看没有值。成员:
id ts transition_id arg_set_id transition_type send_time_ns dispatch_time_ns
duration_ns finish_time_ns shell_abort_time_ns handler status flags start_transaction_id
finish_transaction_id
5. window_manager_shell_transition_handlers
select * from window_manager_shell_transition_handlers 看没有值。成员:
id handler_id handler_name base64_proto_id
6. windowmanager
select * from windowmanager 看没有此表。
7. windowmanager_windowcontainer
select * from windowmanager_windowcontainer 看没有此表。
8. protolog
select * from protolog 看没有值。成员:
id ts level tag message stacktrace location
七、Misc
1. flow
select * from flow 看有值。成员:
id slice_out slice_in trace_id arg_set_id
2. args
select * from args 看有值。成员:
id arg_set_id flat_key key int_value string_value real_value value_type display_value
3. clock_snapshot
select * from clock_snapshot 看有值。成员:
id ts clock_id clock_name clock_value snapshot_id machine_id
4. cpu
select * from cpu 看有值。成员:
id ucpu cpu cluster_id processor machine_id capacity arg_set_id
5. cpu_freq
select * from cpu_freq 看没有此表。
7. trace_file
select * from trace_file 看没有此表。
8. gpu_counter_group
select * from gpu_counter_group 看没有值。成员:
id group_id track_id
9. package_list
select * from package_list 看没有值。成员:
id package_name uid debuggable profileable_from_shell version_code
10. vulkan_memory_allocations
select * from vulkan_memory_allocations 看没有值。成员:
id arg_set_id source operation timestamp upid device device_memory memory_type heap
function_name object_handle memory_address memory_size scope
posted on 2026-01-26 11:14 Hello-World3 阅读(4) 评论(0) 收藏 举报
浙公网安备 33010602011771号