google / perfetto

Performance instrumentation and tracing for Android, Linux and Chrome (read-only mirror of https://android.googlesource.com/platform/external/perfetto/)

Home Page:https://www.perfetto.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[question][Android] does perfetto support to run in production?

simpleton opened this issue · comments

Productionize [done]

Do security changes required to run heapprofd with setenforce 1 and as non-root.

I saw the doc claimed it supported. can you share more details about this? thank you!

It is definitely supported. There are caveats described in https://perfetto.dev/docs/data-sources/native-heap-profiler#heapprofd-targets

Summary:

  • On userdebug or eng (i.e. rooted) images all apps can be profiled
  • On user (production) images, you can only profile apps that, in their manifest.xml, are either
  1. Declared as debuggable
  2. Declared as profileable

The doc linked above shows examples and has all the info you need. Reopen if something is unclear.

I see, thanks for the prompt answer.

I'm curious does it support profiling the normal release build that we ship to real users.

Yes... as long as you mark it as profileable in the manifest.

You cannot profile apps if they are not profileable, unless you install it on a userdebug image (e.g. the ones you can download here https://source.android.com/setup/build/running for pixel).