[PATCH] D89707: [CSSPGO][llvm-profgen] Parse mmap events from perf script

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 10:29:40 PDT 2020


mtrofin added inline comments.


================
Comment at: llvm/tools/llvm-profgen/llvm-profgen.cpp:143-144
+    // Update the binary address map.
+    BinaryAddrMap.erase(Binary.getBaseAddress());
+    BinaryAddrMap[Event.BaseAddress] = &Binary;
+
----------------
wlei wrote:
> wlei wrote:
> > mtrofin wrote:
> > > wmi wrote:
> > > > Here BinaryAddrMap needs to erase an entry before inserting a new one. I guess it is to support the case that a load image is unloaded and then reloaded at a different place. If that is correct, please add some comment to make it clear. 
> > > Naive question: that assumes no interesting events were collected when the image was loaded at the old address?
> > yes , comments added
> Not sure whether it will remain the same address, but here I think it will cover this case. or maybe you want me to check if the base address doesn't change then we can just drop this event?
Sorry, what I meant was: as the events list gets traversed, say that for a while events corresponding to the current base address are captured; then the base address changes. What happens to the captured events?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89707/new/

https://reviews.llvm.org/D89707



More information about the llvm-commits mailing list