tree: e9ef539f5994e186c462339adfd2a62ce91025ec [path history] [tgz]
  1. atrace_hal.cc
  2. atrace_hal.h
  3. BUILD.gn
  4. empty_file.cc
  5. health_hal.cc
  6. health_hal.h
  7. incident_service.cc
  8. incident_service.h
  9. lazy_library_loader.cc
  10. lazy_library_loader.h
  11. power_stats.cc
  12. power_stats.h
  13. README.md
  14. statsd_logging.cc
  15. statsd_logging.h
  16. tracing_service_proxy.cc
  17. 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.