This is an archive of the discontinued LLVM Phabricator instance.

[memprof] Introduce a wrapper around MemInfoBlock.
ClosedPublic

Authored by snehasish on Jan 13 2022, 2:48 PM.

Details

Summary

Use the macro based format to add a wrapper around the MemInfoBlock
when stored in the MemProfRecord. This wrapped block can then be
serialized/deserialized based on a schema specified by a list of enums.

Diff Detail

Event Timeline

snehasish requested review of this revision.Jan 13 2022, 2:48 PM
snehasish created this revision.
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 13 2022, 2:48 PM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript

This patch has two parts:

Can this be done as two patches then?

This patch has two parts:

Can this be done as two patches then?

I did start out with two commits but then merged them into one before putting it up for review since it seemed easier. I'll wait for @tejohnson / @davidxl to chime in before splitting it into two.

snehasish edited the summary of this revision. (Show Details)Jan 13 2022, 3:47 PM

lgtm but I think it would be nice to split into 2 patches, i.e. first the rename, which unfortunately does cause a little bit of extra churn on your end. But then it makes the new wrapper and inc file changes a little cleaner.

hiraditya added inline comments.
compiler-rt/include/profile/MemProfData.inc
86 ↗(On Diff #399800)

by MemProfData.inc, do we mean 'compiler-rt/include/profile/MemProfData.inc' the current file, or 'include/llvm/ProfileData/MemProfData.inc'?

snehasish updated this revision to Diff 401392.Jan 19 2022, 1:50 PM

Rebase after splitting out changes to MemInfoBlock (D117722).

lgtm but I think it would be nice to split into 2 patches, i.e. first the rename, which unfortunately does cause a little bit of extra churn on your end. But then it makes the new wrapper and inc file changes a little cleaner.

Done, uploaded the rename patch as D117722.

by MemProfData.inc, do we mean 'compiler-rt/include/profile/MemProfData.inc' the current file, or 'include/llvm/ProfileData/MemProfData.inc'?

@hiraditya Both files since they should be kept in sync. Instead of having dependencies across llvm and compiler-rt we use a .inc file (similar to InstrProfData.inc).

PTAL thanks!

compiler-rt/include/profile/MemProfData.inc
86 ↗(On Diff #399800)

by MemProfData.inc, do we mean 'compiler-rt/include/profile/MemProfData.inc' the current file, or 'include/llvm/ProfileData/MemProfData.inc'?

This revision is now accepted and ready to land.Jan 19 2022, 4:32 PM
snehasish updated this revision to Diff 408464.Feb 14 2022, 9:42 AM

Rebase and update with some fixes for unaligned reads.
Also update the unittest.

This revision was landed with ongoing or failed builds.Feb 14 2022, 9:55 AM
This revision was automatically updated to reflect the committed changes.