Skip to content

Add compile-time max RSS reporting support#373

Open
tomershafir wants to merge 1 commit intollvm:mainfrom
tomershafir:add-compile-time-max-rss-reporting
Open

Add compile-time max RSS reporting support#373
tomershafir wants to merge 1 commit intollvm:mainfrom
tomershafir:add-compile-time-max-rss-reporting

Conversation

@tomershafir
Copy link
Copy Markdown
Contributor

This patch adds basic compile/link time max RSS reporting to llvm-test-suite. Memory usage is an important metric for users, and thus also for LLVM developer to better understand the compile/link time impact of a compiler change.

Memory usage and its measurement in general can get very complex and platform specific. A simple but still useful aggregate is max working set size. It is reported by getrusage() on Apple platforms and Linux, which are the scope of this patch. Even though getrusage() is a POSIX API, the maxrss part of it is not and is platform dependent. Support for other platforms can be added later.

There is already an orthogonal reporting capabily by https://llvm-compile-time-tracker.com/ but adding this capability to llvm-test-suite can offer more programmability and integration opportunities.

Bottom-up implementation:

  • Add a new --report-maxrss option to timeit which collects maxrss for the supported platforms from getrusage() and writes it to the summary file or the non-POSIX terminal
  • Add LIT bindings for maxrss read from output to litsupport/modules/timeit.py
  • Add max-based aggregation for maxrss to litsupport/modules/compiletime.py
  • Add a CMake option TEST_SUITE_REPORT_COMPILE_MAXRSS that is only active under TEST_SUITE_COLLECT_COMPILE_TIME

This patch adds basic compile/link time max RSS reporting to llvm-test-suite. Memory usage is an important metric for users, and thus also for LLVM developer to better understand the compile/link time impact of a compiler change.

Memory usage and its measurement in general can get very complex and platform specific. A simple but still useful aggregate is max working set size. It is reported by `getrusage()` on Apple platforms and Linux, which are the scope of this patch. Even though `getrusage()` is a POSIX API, the `maxrss` part of it is not and is platform dependent. Support for other platforms can be added later.

There is already an orthogonal reporting capabily by https://llvm-compile-time-tracker.com/ but adding this capability to llvm-test-suite can offer more programmability and integration opportunities.

Bottom-up implementation:
- Add a new `--report-maxrss` option to `timeit` which collects `maxrss` for the supported platforms from `getrusage()` and writes it to the summary file or the non-POSIX terminal
- Add LIT bindings for `maxrss` read from output to `litsupport/modules/timeit.py`
- Add max-based aggregation for `maxrss` to `litsupport/modules/compiletime.py`
- Add a CMake option `TEST_SUITE_REPORT_COMPILE_MAXRSS` that is only active under `TEST_SUITE_COLLECT_COMPILE_TIME`
@tomershafir
Copy link
Copy Markdown
Contributor Author

Ping @nikic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant