[PATCH] D118653: [memprof] Extend the index prof format to include memory profiles.

Snehasish Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 13:51:50 PST 2022


snehasish created this revision.
snehasish added reviewers: davidxl, tejohnson.
Herald added subscribers: dexonsmith, wenlei, arphaman, hiraditya, mgorny.
snehasish requested review of this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.

This patch adds support for optional memory profile information to be
included with and indexed profile. The indexed profile header adds a new
field which points to the offset of the memory profile section (if
present) in the indexed profile. For users who do not utilize this
feature the only overhead is a 64-bit offset in the header.

The memory profile section contains (1) profile metadata describing the
information recorded for each entry (2) an on-disk hashtable containing
the profile records indexed via llvm::md5(function_name). We chose to
introduce a separate hash table instead of the existing one since the
indexing for the instrumented fdo hash table is based on a CFG hash
which itself is perturbed by memprof instrumentation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118653

Files:
  compiler-rt/include/profile/InstrProfData.inc
  llvm/include/llvm/IR/ProfileSummary.h
  llvm/include/llvm/ProfileData/InstrProf.h
  llvm/include/llvm/ProfileData/InstrProfData.inc
  llvm/include/llvm/ProfileData/InstrProfReader.h
  llvm/include/llvm/ProfileData/InstrProfWriter.h
  llvm/include/llvm/ProfileData/MemProf.h
  llvm/include/llvm/ProfileData/RawMemProfReader.h
  llvm/lib/ProfileData/CMakeLists.txt
  llvm/lib/ProfileData/InstrProf.cpp
  llvm/lib/ProfileData/InstrProfReader.cpp
  llvm/lib/ProfileData/InstrProfWriter.cpp
  llvm/lib/ProfileData/MemProf.cpp
  llvm/lib/ProfileData/RawMemProfReader.cpp
  llvm/tools/llvm-profdata/llvm-profdata.cpp
  llvm/unittests/ProfileData/InstrProfTest.cpp
  llvm/unittests/ProfileData/MemProfTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118653.404722.patch
Type: text/x-patch
Size: 47873 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220131/d2f7d2f7/attachment.bin>


More information about the llvm-commits mailing list