perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

Not able to capture a complete device trace

Open am5a03 opened this issue 6 years ago • 2 comments

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

  1. Nokia 7 Plus Android 10
  2. Samsung S9 Android 10

am5a03 avatar May 08 '20 16:05 am5a03

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.

chromy avatar May 08 '20 19:05 chromy

I see, thanks! I forgot to select probes in the UI, closing this issue now. 😄

am5a03 avatar May 09 '20 06:05 am5a03