Skip to content

[memprof] Refactor getMemProfRecord (NFC) #93138

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

Merged
merged 2 commits into from
May 23, 2024

Conversation

kazutakahirata
Copy link
Contributor

This patch refactors getMemProfRecord for readability while adding
consistency checks.

  • This patch adds a switch statement on the MemProf version just like
    most places dealing with MemProf serialization/deserialization.

  • This patch adds asserts to ensure that the exact set of data
    structures are available while ones we do not use are not present.
    That is, getMemProfRecord no longer determines the version based on
    the availability of MemProfCallStackTable.

This patch refactors getMemProfRecord for readability while adding
consistency checks.

- This patch adds a switch statement on the MemProf version just like
  most places dealing with MemProf serialization/deserialization.

- This patch adds asserts to ensure that the exact set of data
  structures are available while ones we do not use are not present.
  That is, getMemProfRecord no longer determines the version based on
  the availability of MemProfCallStackTable.
@kazutakahirata
Copy link
Contributor Author

Thank you for the review! I've addressed comments. Please take a look again.

Copy link
Contributor

@snehasish snehasish left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@kazutakahirata kazutakahirata merged commit 8ad980d into llvm:main May 23, 2024
5 checks passed
@kazutakahirata kazutakahirata deleted the memprof_reader_version branch May 23, 2024 21:13
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.

2 participants