[all-commits] [llvm/llvm-project] 90acfb: [memprof] Use linear IDs for Frames and call stack...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Thu May 30 14:28:44 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 90acfbf90ddcb9c8c3338373bd13cb44f73bbd00
      https://github.com/llvm/llvm-project/commit/90acfbf90ddcb9c8c3338373bd13cb44f73bbd00
  Author: Kazu Hirata <kazu at google.com>
  Date:   2024-05-30 (Thu, 30 May 2024)

  Changed paths:
    M llvm/include/llvm/ProfileData/InstrProfReader.h
    M llvm/include/llvm/ProfileData/MemProf.h
    M llvm/lib/ProfileData/InstrProfReader.cpp
    M llvm/lib/ProfileData/InstrProfWriter.cpp
    M llvm/lib/ProfileData/MemProf.cpp

  Log Message:
  -----------
  [memprof] Use linear IDs for Frames and call stacks (#93740)

With this patch, we stop using on-disk hash tables for Frames and call
stacks.  Instead, we'll write out all the Frames as a flat array while
maintaining mappings from FrameIds to the indexes into the array.
Then we serialize call stacks in terms of those indexes.

Likewise, we'll write out all the call stacks as another flat array
while maintaining mappings from CallStackIds to the indexes into the
call stack array.  One minor difference from Frames is that the
indexes into the call stack array are not contiguous because call
stacks are variable-length objects.

Then we serialize IndexedMemProfRecords in terms of the indexes
into the call stack array.

Now, we describe each call stack with 32-bit indexes into the Frame
array (as opposed to the 64-bit FrameIds in Version 2).  The use of
the smaller type cuts down the profile file size by about 40% relative
to Version 2.  The departure from the on-disk hash tables contributes
a little bit to the savings, too.

For now, IndexedMemProfRecords refer to call stacks with 64-bit
indexes into the call stack array.  As a follow-up, I'll change that
to uint32_t, including necessary updates to RecordWriterTrait.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list