Skip to content
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

Add --profiling flag #1065

Merged
merged 4 commits into from
Oct 29, 2021
Merged

Add --profiling flag #1065

merged 4 commits into from
Oct 29, 2021

Conversation

shonfeder
Copy link
Contributor

@shonfeder shonfeder commented Oct 28, 2021

This flag is proposed in the ADR for the OutputManager but wasn't
implemented in #1025, which left us without a way to enable the
generation of the profile-rules.txt file that used to always be
created (other than using the global config). The benchmarks depend on
this file being created.


  • Tests added for any new code
  • Ran make fmt-fix (or had formatting run automatically on all files edited)
  • Documentation added for any new functionality
  • Entry added to UNRELEASED.md for any new functionality

Shon Feder added 4 commits October 28, 2021 17:58
- Followup to #1025
- Required for #1059

This flag is proposed in the ADR for the OutputManager but wasn't
implemented in #1025, which left us without a way to enable the
generation of the profile-rules.txt file that used to always be
created (other than using the global config). The benchmarks depend on
this file being created.
Comment on lines -131 to -145
// Flags can be passed from options too, e.g. --profile or --write-intermediate
// Strangly, we currently require data to flow both from the pass options
// to the output manager and from the manager to the pass options, this this "sync"
// is by directional.
// TODO: remove this once all flag operations are moved into PassOptions
def syncWithOptions(opt: WriteablePassOptions): Unit = {
opt.get[Boolean]("general", IntermediateFlag) foreach {
flags += IntermediateFlag -> _
}
opt.get[Boolean]("general", ProfilingFlag) foreach {
flags += ProfilingFlag -> _
}
opt.set("io.outdir", outDir)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the data is only one flowing one way: CLI args and the global config go through the OutputManager, and then we use some its determinations to set pass options. So this method becomes unnecessary.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. We could declare all these flags directly in the singleton

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. We can consider that for a follow up. Run in by Jute and see what he thinks.

@shonfeder
Copy link
Contributor Author

@Kukovec, @konnov: Would either of you like to see any changes here? If not, could I get a green check?

Copy link
Collaborator

@konnov konnov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shonfeder shonfeder merged commit c4f7c23 into unstable Oct 29, 2021
@shonfeder shonfeder deleted the shon/add-profiling-flag branch October 29, 2021 13:15
@apalache-bot apalache-bot mentioned this pull request Oct 29, 2021
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.

3 participants