-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal_stats: init, report current memory consumption on linux and mac #4554
Conversation
686ae62
to
a165267
Compare
a165267
to
6f8030e
Compare
6f8030e
to
0ce7631
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on macOS, we can get this into shape as we go, it's useful already
log("{\n"); | ||
log(" \"creator\": %s,\n", json11::Json(yosys_version_str).dump().c_str()); | ||
std::stringstream invocation; | ||
std::copy(args.begin(), args.end(), std::ostream_iterator<std::string>(invocation, " ")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's best to serialize that as a list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copy pasted that from the json backend
void help() override | ||
{ | ||
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| | ||
log("\n"); // TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Help missing, not something we should let into a release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL empty help messages causes docs to fail (granted it is technically a warning, but warnings are errors in our ReadtheDocs setup)
/home/docs/checkouts/readthedocs.org/user_builds/yosys/checkouts/latest/docs/source/cmd/internal_stats.rst:21: WARNING: Literal block expected; none found. [docutils]
To find out static memory usage right after RTLIL generation and at other points in the flow, currently the best practice is to dump and reload and inspect peak memory usage. This PR adds the experimental
devstat
command that prints in a JSON format the current memory usage. It is intended to be expanded further for information about the efficiency of RTLIL object representation and anything else that's relevant to yosys developers but not users.On linux, yosys inspects its
/proc/self/status
file. This may not be present on some Linux distributions, but it should be handled gracefully should that file not exist.On macOS, I use task_info
-json
isn't used