commit | 43ff2c1f637f2c8d444f88e982f04a5b354ec0c2 | [log] [tgz] |
---|---|---|
author | Mohit Saini <mohitms@google.com> | Sun Mar 13 21:28:39 2022 +0000 |
committer | Mohit Saini <mohitms@google.com> | Mon Mar 14 11:50:26 2022 +0000 |
tree | a0ffc347e02f784a0e047776c2e8a73b59940af4 | |
parent | 6d204989009bbb1da10ad0d5339aafd0bcd208d5 [diff] |
Fix 'weak-vtables' warning in TrackEvent warning: 'TrackEvent' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Wweak-vtables] This warning can be reproduced by compiling example.cc using clang compiler that supports `-Wweak-vtables` warning. It was suppressed earlier by supplying `configs -= [ "//gn/standalone:extra_warnings" ]` option in `examples/sdk/BUILD.gn`. The root cause of this warning is demonstrated in CL aosp/2019905 Note that this warning is NOT serious because linker will anyway merge those vtable into a single vtable. i.e. duplicated vtable won't increase the size of final executable. The root cause is, `TrackEvent` don't have any non-inline virtual function. So compiler cannot decide where to place vtable. Itanium CXX ABI, section 5.2.3: The virtual table for a class is emitted in the same object containing the definition of its key function, i.e. the first non-pure virtual function that is not inline at the point of class definition. If there is no key function, it is emitted everywhere used. The emitted virtual table includes the full virtual table group for the class, any new construction virtual tables required for subobjects, and the VTT for the class. They are emitted in a COMDAT group, with the virtual table mangled name as the identifying symbol. Note that if the key function is not declared inline in the class definition, but its definition later is always declared inline, it will be emitted in every object containing the definition. NOTE: In the abstract, a pure virtual destructor could be used as the key function, as it must be defined even though it is pure. However, the ABI committee did not realize this fact until after the specification of key function was complete; therefore a pure virtual destructor cannot be the key function. Ref: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vague-vtable Change-Id: I29f3308bdb91b135e3cc91c3a0a3d60dc3de4d86
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.