[stdlib]: Add a floor/ceiling option to the weight bounded DFS

The original wb-DFS ended the reachability search right before a
node would exceed the |root_max_weight|. The critical path algorithm
actually requires the algorithm to add the last node that would exceed
the max weight. This ensures that we follow the critical path right
passed the prev node of the root node.

Exposed both behaviors controlled with an is_target_weight_floor
parameter:
-If true, the root_target_weight is treated as a floor
and the behavior is to include the node that just pushes the
weight above the threshold.
-If false, the root_target_weight is treated as a ceiling
and the behavior is to NOT include the node that would push the
weight above the threshold.

Also updated the argument checking to return early if root_table
or graph_table is empty instead of throwing an error.

Test: tools/diff_test_trace_processor.py out/android/trace_processor_shell --name-filter '.*weight_bounded.*'
Change-Id: I035561c3a619961bf3fa5d94a71e926d7b5bdb74
5 files changed
tree: 7cbd7185b925fb918471ddca90e04ebd98253a85
  1. .github/
  2. bazel/
  3. build_overrides/
  4. buildtools/
  5. debian/
  6. docs/
  7. examples/
  8. gn/
  9. include/
  10. infra/
  11. protos/
  12. python/
  13. src/
  14. test/
  15. third_party/
  16. tools/
  17. ui/
  18. .clang-format
  19. .clang-tidy
  20. .git-blame-ignore-revs
  21. .gitattributes
  22. .gitignore
  23. .gn
  24. .style.yapf
  25. Android.bp
  26. Android.bp.extras
  27. BUILD
  28. BUILD.extras
  29. BUILD.gn
  30. CHANGELOG
  31. codereview.settings
  32. DIR_METADATA
  33. heapprofd.rc
  34. LICENSE
  35. meson.build
  36. METADATA
  37. MODULE_LICENSE_APACHE2
  38. OWNERS
  39. perfetto.rc
  40. PerfettoIntegrationTests.xml
  41. persistent_cfg.pbtxt
  42. PRESUBMIT.py
  43. README.chromium
  44. README.md
  45. TEST_MAPPING
  46. traced_perf.rc
  47. WATCHLISTS
  48. WORKSPACE
README.md

Perfetto - System profiling, app tracing and trace analysis

Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.

See https://perfetto.dev/docs or the /docs/ directory for documentation.