[check-licenses] Add -trace and -pprof

Add a few trace.Region() to better understand in which section the time is most
spent, coupled with the flame graph this gives a pretty good overview of what's
happening.

Ran:
  fx check-licenses -trace trace.out -pprof profile.out
or (faster):
  cd tools
  go run ./check-licenses/cmd \
    -base_dir .. \
    -config_file check-licenses/config/config.json \
    -license_pattern_dir check-licenses/golden/patterns/ \
    -trace trace.out \
    -pprof profile.out

then
    go tool trace trace.out
    go tool pprof profile.out

It used to have more than 8 million (!) goroutines started before I started
refactoring.

Bug: 42986
Change-Id: Ia995e0fd2074e37e7afa8c0b73ac08792a221563
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/442657
Commit-Queue: Marc-Antoine Ruel <maruel@google.com>
Testability-Review: Francois Rousseau <frousseau@google.com>
Reviewed-by: Omer Lev-ran <omerlevran@google.com>
6 files changed
tree: ae7226624cf0864d30ac8a5959c01583cd63094f
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. garnet/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .gitattributes
  17. .gitignore
  18. .gn
  19. .style.yapf
  20. AUTHORS
  21. BUILD.gn
  22. CODE_OF_CONDUCT.md
  23. CONTRIBUTING.md
  24. LICENSE
  25. OWNERS
  26. PATENTS
  27. README.md
  28. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.