tools/gen_bazel: Standalone Bazel build

Updates the gen_bazel generator and generates
a BUILD file that allows to build traced, traced_probes
perfetto and trace_processor both on Linux and Mac.
This also allows easy integration with google internal builds.
The major differences of the new generator are:
1. Uses the new way of dealing with protobuf libraries
   (proto_library -> cc_proto_library -> executable target
   see go/new-proto-library)
2. Instead of repeating all the source files in each target
   it creates Bazel filegroup(s) out of GN source_set(s).
   While doing so it takes care of propagating up flags and
   dependencies. This is because Bazel filegroup(s),
   conversely to GN source_set(s), are pure bags of sources.

Still missing:
 - cflags / ldflags propagation into Bazel.
 - Android toolchain (perhaps will never happen)

This will require a matching change to Google internal
sources.

Test: bazel build //:all
Change-Id: Ic1c725bd83e2a5e92eebb5c5b34728cf6d5983e6
21 files changed
tree: fb42e882625bba7abc97059fdfaa20a0dcc6a45f
  1. bazel/
  2. build_overrides/
  3. buildtools/
  4. debian/
  5. docs/
  6. gn/
  7. include/
  8. infra/
  9. protos/
  10. src/
  11. test/
  12. tools/
  13. ui/
  14. .clang-format
  15. .gitignore
  16. .gn
  17. Android.bp
  18. Android.bp.extras
  19. BUILD
  20. BUILD.extras
  21. BUILD.gn
  22. codereview.settings
  23. heapprofd.rc
  24. MODULE_LICENSE_APACHE2
  25. NOTICE
  26. OWNERS
  27. perfetto.rc
  28. PRESUBMIT.py
  29. README.chromium
  30. README.md
  31. TEST_MAPPING
  32. WORKSPACE
README.md

Perfetto - Performance instrumentation and tracing

Perfetto is an open-source project for performance instrumentation and tracing of Linux/Android/Chrome platforms and user-space apps.

See www.perfetto.dev for docs.

Bugs

  • For bugs affecting Android or the tracing internals use the internal bug tracker (go/perfetto-bugs).
  • For bugs affecting Chrome use http://crbug.com, Component:Speed>Tracing label:Perfetto.