Skip to content

Conversation

@annathedroid
Copy link
Contributor

@annathedroid annathedroid commented Oct 31, 2025

This update adds a new data source, android.user_list, to Perfetto. It parses the /data/system/users/user.list file, which is generated by UserManagerService, on system update or on user data change to record necessary Android User information directly into Perfetto traces.

The CL includes:

  • Proto definitions for the data source config (UserListConfig) and trace packet (UserList).
  • Implementation of the data source and parser logic in src/traced/probes/user_list/.
  • Unit tests for the parsing logic.
  • Build system updates (Android.bp, BUILD, .gn files) to incorporate the new source.
  • Initially, the data source will include User ID (0 for SYSTEM, 10+ for others) and User Type (SYSTEM, FULL, GUEST, WORK/CLONE/PRIVATE PROFILE, RESTRICTED).

This change overcomes the current limitations in Perfetto traces, where only Android user ID (derived from process UID) is available, making it difficult to understand the impact of different user types on system performance. By adding a dedicated Multiuser data source, developers and performance analysts will be able to:

  • Identify specific user types (system, headless system, secondary, restricted, guest, work profile, private profile, clone profile, communal profile) within Perfetto traces.
  • Analyze in depth how different user types contribute to performance issues or unexpected behaviors (e.g., decreased battery drain with work profile running).

Bug: 391110239
Flag: android.multiuser.perfetto_multiuser_table
Test: tools/run_android_test out/default perfetto_unittests
Change-Id: I00d24cb92c11e5b2a5fbb0301787fa01ef3dd774

This PR creates users table based on generated file by UserManagerService.
This reverts commit c504945.

Bug: 391110239
Flag: android.multiuser.perfetto_multiuser_table
Test: tools/run_android_test out/default perfetto_unittests
Change-Id: I00d24cb92c11e5b2a5fbb0301787fa01ef3dd774
@annathedroid annathedroid requested a review from a team as a code owner October 31, 2025 11:49
@annathedroid annathedroid requested a review from aMayzner October 31, 2025 11:50
@annathedroid annathedroid changed the title Add user list table to perfetto probes Add android user list data source to Perfetto probes Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants