TriggerConfig. Trigger(STOP_TRACING) and data_stources {"Linux. perf"} are suspected to have errors when used together.
Current requirement: Only when an exception is triggered, can the previously collected memory data from perfetto be saved to disk. I carefully studied the official example code and wrote a cfg switch. I use duration_ms: 200000 as the end condition, and both perf stack data and process data can be saved. But instead of duration_ms, use trigger_made: STOP_TRACING, which only stores process data and lacks perf related stack data. Is this problem known?
Do you need me to provide anything that can quickly help solve this problem? One additional point: Calling a command is the same as using other methods
But according to the official website introduction and theory, triggers and data collectors should not be related, but I cannot explain this experimental phenomenon
Can you expand a bit with an example trace config. I am struggling to understand what you are doing from the bug.
Please:
- Share a full trace config
- Make a statement "this is what I expected to happen" vs "this is what happened"
to make this bug more understandable
这是我的调用命令: tracebox traced
tracebox traced_probes
tracebox traced_perf 抓取命令: sudo perfetto -c /etc/mirobot/perfetto/scheduling_hunter_trigger.cfg --txt -o output.perfetto-trace 若是触发:sudo trigger_perfetto Hunter_trigger
cfg 配置项:
mi@tegra-ubuntu-pos:~$ cat /etc/mirobot/perfetto/scheduling_hunter_trigger.cfg
buffers {
size_kb: 98400
}
buffers {
size_kb: 98400
}
data_sources {
config {
name: "linux.ftrace"
target_buffer: 0
ftrace_config {
symbolize_ksyms: true
ftrace_events: "sched/sched_switch"
ftrace_events: "sched/sched_waking"
ftrace_events: "sched/sched_wakeup_new"
ftrace_events: "task/task_newtask"
ftrace_events: "task/task_rename"
ftrace_events: "power/cpu_idle"
ftrace_events: "power/cpu_frequency"
ftrace_events: "power/cpu_frequency_limits"
ftrace_events: "power/suspend_resume"
ftrace_events: "power/clock_set_rate"
ftrace_events: "sched/sched_process_exec"
ftrace_events: "sched/sched_process_exit"
ftrace_events: "sched/sched_process_fork"
ftrace_events: "sched/sched_process_free"
ftrace_events: "sched/sched_process_hang"
ftrace_events: "sched/sched_process_wait"
}
}
}
data_sources {
config {
name: "linux.process_stats"
target_buffer: 0
process_stats_config {
proc_stats_poll_ms: 2000
}
}
}
data_sources {
config {
name: "linux.perf"
target_buffer: 1
perf_event_config {
timebase {
frequency: 5000
}
callstack_sampling {
kernel_frames: true
}
}
}
}
#trigger_config {
# trigger_mode: STOP_TRACING
# use_clone_snapshot_if_available: true
# trigger_timeout_ms: 604800000
# triggers {
# name: "Hunter_trigger"
# stop_delay_ms: 0
# }
#}
duration_ms: 10000
Can you please share the trace (either here or send it directly to me)? Can you also share the screenshot of your trace errors (from "Overview" in the navigation side bar -> "Info and stats")? It is possible that there are other issues with your config/setup, and maybe one of them caused the data to not fetch at all.
What do you mean by missing perf data? Do you see no data? Some specific one that you were looking for?
Specific data cannot be found (all perf stack related data is missing). The attachment contains files captured under two types of triggers.
Hi, you didn't attach any files
名称:trace.zip 地址:https://kpan.mioffice.cn/webfolder/ext/wAvVSd6v2u3%24uVm31GQvyw%40%40?n=0.5983061922895406 密码:G3WY
This is a file, can it be downloaded normally
According to my configuration file, reproducing the capture will result in this issue. I have already verified on multiple robots
Please use the "info & stats" or the "overview" page in the perfetto UI as the first step in troubleshooting. Your error is explained there, including a link to the relevant documentation.
But in essence: you're using RING_BUFFER tracing buffers and letting them wrap around, meaning that all incremental data is invalid. See https://perfetto.dev/docs/concepts/buffers#incremental-state-in-trace-packets.
PS: your original trace is full of data losses because you're asking for too high of a sampling frequency system-wide. Similarly, the errors page should provide additional clues.