commit | 55f309acae2b1032b4c28f343fac9347e9251494 | [log] [tgz] |
---|---|---|
author | Ryan <rsavitski@google.com> | Tue Apr 13 18:20:53 2021 +0100 |
committer | Ryan <rsavitski@google.com> | Tue Apr 13 18:20:53 2021 +0100 |
tree | 9bacdef812d50551f9ea6feae8a42e3793326c95 | |
parent | 016efc5e9a76abec192c26ecc6dda4e9b25a3ec6 [diff] |
traceconv: produce less redundant pprofs, at the expense of more work Additionally, add an option to suffix the frame name with the annotation, as obtained via experimental_annotated_callstack. This is primarily relevant to Android profiles. This is enabled by default when invoking as traceconv||trace_to_text, and suppressed if passed "--no-annotations" flag. The primary change for pprof_builder is that it now interns all callsites and frames, using their contents for the identity (instead of relying on row ids from SQL tables). This avoids emitting redundant functions. One reason when it'd happen: stack_profile_frame has rel_pc as part of the row's identity, whereas in the profile it is part of the location (and therefore all such frames should be shared). Another cause of redundancy is incremental state clears. This does come at a cost of both more work, and a higher memory footprint, as we're now keeping all of the stack_profile_frame and stack_profile_callsite derived information alive in the interning structures. I'm assuming we're not hyper-sensitive to these regressions, as long as WASM builds don't go oom (and there I'd expect the trace_processor state to be more significant anyway). I've tried it on one traced_perf field trace (with ~10 sub-profiles written, one per pid). Runtime went from ~1s to ~1.5s. Combined pprof size went from ~600 KB to ~400 KB. Do tell if you want concrete memory before/after numbers as well (but I assume they're on the order of the serialized profile's size). Change-Id: Id7d903003d31427b8b228ec34a123ab15eeb001a
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.