afdo_tools: use `Random` instances in afdo_prof_analysis

Reasoning about the global `random.seed`'s state is difficult. Instead,
use easy-to-trace `random.Random` instances that are clearly and
deterministically seeded.

While I'm here, add a few type annotations where doing so is easy.

BUG=b:447149857
TEST=Unittests

Change-Id: I58a0e04583ae7dbc296beb25989173e78a26f604
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/6982910
Tested-by: George Burgess <gbiv@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
2 files changed
tree: cfc5cb9b3a2c1166615cc25a9f7640298b55ece9
  1. afdo_metadata/
  2. afdo_redaction/
  3. afdo_tools/
  4. bot_tools/
  5. compiler_wrapper/
  6. contrib/
  7. cros_utils/
  8. cwp/
  9. llvm_extra/
  10. llvm_patches/
  11. llvm_tools/
  12. pgo_tools/
  13. pgo_tools_rust/
  14. py/
  15. rust-analyzer-chromiumos-wrapper/
  16. rust_tools/
  17. seccomp_tools/
  18. toolchain_utils_githooks/
  19. upstream_workon/
  20. .gitignore
  21. android_merge_from_upstream.sh
  22. auto_abandon_cls.py
  23. check_portable_toolchains.py
  24. compiler-test.sh
  25. DIR_METADATA
  26. GEMINI.md
  27. LICENSE
  28. OWNERS
  29. OWNERS.toolchain
  30. ping_automatic_cls.py
  31. PRESUBMIT.cfg
  32. pyrightconfig.json
  33. pyrun
  34. python_wrapper.py
  35. README.chromium
  36. README.md
  37. run_python_tests.sh
  38. run_tests_for.py
  39. run_weekly_job.py
README.md

toolchain-utils

Various utilities used by the ChromeOS toolchain team.

Note

To run Python scripts in this directory, first run:

export PYTHONPATH=$(readlink -f .):$PYTHONPATH

from this directory.

Then you can run any script.

To get help on any script, type in python <script> --help, or refer to the header of the script for more information.