[perf] introduce --browser=builder to search browsers in out/

The out/ folders have changed to include the builder name with a hash.
The specific structure is
{4 character salt}-{15 character truncated builder name}.

The name of the out/ folder, and the --browser={} argument are
dependent on each other. When the telemetry library searches for a
browser binary to use, it:
1. generates paths using a static list of known out/ folder options
(ie/ release, debug, release_x64, etc.)
2. joins those paths against potential locations of Chrome (ie/
on win, it'd be chrome.exe but on Mac the executable location would
be generated elsewhere).
3. checks the out/ folder name of the binary and matches it against
what's provided by --browser argument. So if the binary was found at
out/Release, it'd be matched with --browser=release.

The change in the out folder name breaks this search process.

This change updates the search process in telemetry by:
1. Introducing a new browser arg, --browser=builder. When this is set,
the search will use regex "^[\w\d]{4}-[\\w\\d\-\_\(\)]{1,15}$"
to find the first browser that has a browser with out/ defined by
builder name and return the first matching one. This logic is in
browser_finder.py.
2. Have desktop_browser_finder.py provide all folders in out/
that may potentially have a Chrome binary, but not defined by the
statically maintained list. For example:

out/
  - Release
  - 0b5h-linux-perf

The logic would add {chrome_root}/out/0b5h-linux-perf as a potential
path to search for the Chrome binary. The root call is
FindAllAvailableBrowsers() in desktop_browser_finder.py, but this
logic is in util.py GetBuildDirectories().

The full fix needs to happen over a two step process, since catapult
is rolled in src/.

Bug: b/377748127
Change-Id: I333eea65d29c02427e966b4cc04d52b6bd5b9ec0
Reviewed-on: https://chromium-review.googlesource.com/c/catapult/+/6019526
Reviewed-by: John Chen <johnchen@chromium.org>
Commit-Queue: Jeff Yoon <jeffyoon@google.com>
5 files changed
tree: 1166039ac7b3cc790859cbc613e1a75fe37857b5
  1. bin/
  2. catapult_build/
  3. common/
  4. dashboard/
  5. dependency_manager/
  6. devil/
  7. docs/
  8. experimental/
  9. hooks/
  10. infra/
  11. netlog_viewer/
  12. perf_issue_service/
  13. skia_bridge/
  14. systrace/
  15. telemetry/
  16. third_party/
  17. trace_processor/
  18. tracing/
  19. web_page_replay_go/
  20. .eslintignore
  21. .eslintrc
  22. .gcloudignore
  23. .gitignore
  24. .style.yapf
  25. .vpython3
  26. .yapfignore
  27. AUTHORS
  28. BUILD.gn
  29. codereview.settings
  30. CONTRIBUTING.md
  31. DIR_METADATA
  32. generate_telemetry_build.py
  33. LICENSE
  34. navbar.md
  35. OWNERS
  36. PRESUBMIT.py
  37. pylintrc
  38. README.md
  39. WATCHLISTS
README.md

Catapult

Catapult is the home for several performance tools that span from gathering, displaying and analyzing performance data. This includes:

These tools were created by Chromium developers for performance analysis, testing, and monitoring of Chrome, but they can also be used for analyzing and monitoring websites, and eventually Android apps.

Contributing

Please see our contributor's guide