perfetto
perfetto copied to clipboard
Not able to capture a complete device trace
I tried to record trace with this setting
adb shell perfetto \
-c - --txt \
-o /data/misc/perfetto-traces/trace \
<<EOF
buffers: {
size_kb: 8960
fill_policy: DISCARD
}
buffers: {
size_kb: 1280
fill_policy: DISCARD
}
duration_ms: 10000
EOF
However, I only get a trace file that's 542 bytes and it shows nothing in the Perfetto UI
perfetto_cmd.cc:604 Connected to the Perfetto traced service, starting tracing for 10000 ms
perfetto_cmd.cc:677 Wrote 542 bytes into /data/misc/perfetto-traces/trace
However, if I run
adb shell perfetto --config :test --out /data/misc/perfetto-traces/trace
I am able to get a complete trace
perfetto_cmd.cc:604 Connected to the Perfetto traced service, starting tracing for 2000 ms
perfetto_cmd.cc:677 Wrote 3026379 bytes into /data/misc/perfetto-traces/trace
Devices tried are
- Nokia 7 Plus Android 10
- Samsung S9 Android 10
Hey 😄
Is this the full config you tried? It doesn't seem to name any data sources so it would be expected that it doesn't collect any data.
adb shell perfetto \
-c - --txt \
-o /data/misc/perfetto-traces/trace \
<<EOF
buffers: {
size_kb: 8960
fill_policy: DISCARD
}
buffers: {
size_kb: 1280
fill_policy: DISCARD
}
duration_ms: 10000
EOF
The built in :test config enables some data sources: https://github.com/google/perfetto/blob/master/src/perfetto_cmd/perfetto_cmd.cc#L266 so if you put those same data sources in your config it should work.
I see, thanks! I forgot to select probes in the UI, closing this issue now. 😄