tp: stdlib: add track-event-based JobScheduler queries#5324
Open
tp: stdlib: add track-event-based JobScheduler queries#5324
Conversation
Added a new module `android.job_scheduler_states_track_events` to provide JobScheduler state tracking derived from track events. This co-exists with the existing statsd-based `android_job_scheduler_states` module. Changes: - Created `android.job_scheduler_states_track_events` module. - Implemented comprehensive state and reason mapping functions. - Added logic to carry forward requested_priority from SCHEDULED events. - Added diff tests using synthetic track event traces. - Retained existing statsd-based JobScheduler queries and tests. Test: tools/diff_test_trace_processor.py ./out/dist/trace_processor_shell --name-filter '.*job_scheduler.*'
🎨 Perfetto UI Builds
|
| -- limitations under the License. | ||
| -- | ||
|
|
||
| -- Checks if a specific job state flag is set in the bitmask. |
Member
There was a problem hiding this comment.
I have to ask: do we have a reason for doing this in SQL instead of just doing this in C++? LIke this seems so much more more work and without all the benefits of type checking that you get from doing this in C++.
You would also be much more efficient: instea of first adding to args and then "reintrepreting" it in SQL, you could parse it correctly in C++ in the first palce.
Honestly just feels like a much better path honestly...
| ); | ||
|
|
||
| -- Extracts job scheduler arg from arg_set_id. | ||
| CREATE PERFETTO FUNCTION _android_js_extract_js_arg( |
Member
There was a problem hiding this comment.
This feels like a massive hack I'll be very honest.
| FROM raw_job_states; | ||
|
|
||
| -- Create table with job execution intervals (state='STARTED'). | ||
| CREATE PERFETTO TABLE _android_js_job_started AS |
Member
There was a problem hiding this comment.
THis is honestly the only part I'd consider keeping in SQL. Everything else before this point feels like it should be in C++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a new module
android.job_scheduler_states_track_eventsto provide JobScheduler state tracking derived from track events. This co-exists with the existing statsd-basedandroid_job_scheduler_statesmodule.Changes:
android.job_scheduler_states_track_eventsmodule.Test: tools/diff_test_trace_processor.py ./out/dist/trace_processor_shell --name-filter '.job_scheduler.'
Welcome to Perfetto!
Make sure your PR has a bug/issue attached or has at least
a clear description of the problem you are trying to fix.
For more details please see
https://perfetto.dev/docs/contributing/getting-started