This is an archive of the discontinued LLVM Phabricator instance.

[memprof] Add a MemProfReader base class.
ClosedPublic

Authored by snehasish on Aug 29 2023, 2:24 PM.

Details

Summary

Add a MemProfReader base class which can be used directly where
symbolization and processing a raw profile is unnecessary.

Diff Detail

Event Timeline

snehasish created this revision.Aug 29 2023, 2:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 2:24 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
snehasish requested review of this revision.Aug 29 2023, 2:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 2:24 PM

Should there be a test to cover the new base class? In particular the constructor isn't called and the readNextRecord with a null Callback case.

llvm/include/llvm/ProfileData/RawMemProfReader.h
69

nit: I think the braces can be removed in this case

86

I don't see this constructor being called anywhere in this patch?

147

Should this call the base class constructor?

snehasish updated this revision to Diff 554814.Aug 30 2023, 1:02 PM

Add unit test, address comments, cleanup unused includes in test.

snehasish marked an inline comment as done.Aug 30 2023, 1:06 PM

Should there be a test to cover the new base class? In particular the constructor isn't called and the readNextRecord with a null Callback case.

Added a test which uses the constructor and relies on the default null Callback behaviour.

llvm/include/llvm/ProfileData/RawMemProfReader.h
86

Added a test which uses this constructor.

147

No we can't call the base class constructor from here since we need to do additional processing (symbolizeAndFilterStackFrames and mapRawProfileToRecords) before populating the function profile data structure.

This revision is now accepted and ready to land.Aug 30 2023, 1:18 PM
This revision was landed with ongoing or failed builds.Aug 30 2023, 1:21 PM
This revision was automatically updated to reflect the committed changes.