tree: 227014c8acf4d03e9ce8b25e6b668b8412ab2e88 [path history] [tgz]
  1. atrace_hal.cc
  2. atrace_hal.h
  3. BUILD.gn
  4. health_hal.cc
  5. health_hal.h
  6. incident_service.cc
  7. incident_service.h
  8. lazy_library_loader.cc
  9. lazy_library_loader.h
  10. power_stats.cc
  11. power_stats.h
  12. README.md
  13. statsd.cc
  14. statsd.h
  15. statsd_logging.cc
  16. statsd_logging.h
  17. tracing_service_proxy.cc
  18. tracing_service_proxy.h
src/android_internal/README.md

This directory contains code that accesses Android (hw)binder interfaces and is dynamically loaded and used by traced_probes / perfetto command line client. The code in this directory is built as a separate .so library and can depend on on Android internals.

Block diagram:

+---------------+       +---------------------------------+
| traced_probes |- - -> | libperfetto_android_internal.so |
+---------------+  ^    +---------------+-----------------+
                   |                    |
                   |                    | [  Non-NDK libraries ]
                   |                    +-> libbase.so
                   |                    +-> libutils.so
                   |                    +-> libhidltransport.so
                   |                    +-> libhwbinder.so
                   |                    +-> android.hardware.xxx@2.0
                   |
                   + dynamically loaded on first use via dlopen()

The major reason for using a separate .so() and introducing the shared library layer is avoiding the cost of linker relocations (~150 KB private dirty) required for loading the graph of binder-related libraries.

The general structure and rules for code in this directory is as-follows:

  • Targets herein defined must be leaf targets. Dependencies to perfetto targets (e.g. base) are not allowed, as doing that would create ODR violations.
  • Headers (e.g. health_hal.h) must have a plain old C interface (to avoid dealing with name mangling) and should not expose neither android internal structure/types nor struct/types defined in perfetto headers outside of this directory.
  • Dependencies to Android internal headers are allowed only in .cc files, not in headers.