commit | 4f919b63bcb065a11b687e4f9409ca2a359edc86 | [log] [tgz] |
---|---|---|
author | Ryan Savitski <rsavitski@google.com> | Sun Feb 27 16:36:46 2022 +0000 |
committer | Ryan Savitski <rsavitski@google.com> | Sun Feb 27 16:42:20 2022 +0000 |
tree | b4427ed12f6150a4c912b1ffd67acbfadf2752fa | |
parent | 23a2d49e1465799beaa2cdd34f5eb2e833e08d3d [diff] |
profile_module: omit packets referencing invalid callstack internings This came up with an older (Android R) trace with a ring buffer holding the perf_sample packets. The first N perf_sample packets were referencing internings that were overwritten by the buffer wrapping. The rest of the packets were fully well-formed since the tracing config requested periodic incremental state clears, so the profiler stopped referencing the old internings later in the packet sequence. Newer traced_perf builds use SEQ_NEEDS_INCREMENTAL_STATE sequence flag, which avoids this case as the pre-incremental-reset packets don't reach the profile module parsing stage. Distinguishing this case from counter-only profiles ended up being a bit tricky since those still reference a valid-but-empty callstack with zero frames. I chose to depend on the fact that the implementation always ends up setting the empty callstack's interning id to "1", as it is also the sentinel root node in the interning trie. Alternatively, we could make the stack_profile_tracker identify the zero-frame callstack's id dynamically, but that's not necessary at this point. Change-Id: I4cc4efc1284672c40f9fe194c9744cb7607de354 Bug: 218988616
Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.
See https://perfetto.dev/docs or the /docs/ directory for documentation.