[all-commits] [llvm/llvm-project] 807ba7: Reland "[memprof] Extend the index prof format to ...

Snehasish Kumar via All-commits all-commits at lists.llvm.org
Thu Feb 17 13:17:28 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 807ba7aace188ada83ddb4477265728e97346af1
      https://github.com/llvm/llvm-project/commit/807ba7aace188ada83ddb4477265728e97346af1
  Author: Snehasish Kumar <snehasishk at google.com>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

  Changed paths:
    M compiler-rt/include/profile/InstrProfData.inc
    M llvm/include/llvm/ProfileData/InstrProf.h
    M llvm/include/llvm/ProfileData/InstrProfData.inc
    M llvm/include/llvm/ProfileData/InstrProfReader.h
    M llvm/include/llvm/ProfileData/InstrProfWriter.h
    M llvm/include/llvm/ProfileData/MemProf.h
    M llvm/include/llvm/ProfileData/MemProfData.inc
    M llvm/include/llvm/ProfileData/RawMemProfReader.h
    M llvm/lib/ProfileData/CMakeLists.txt
    M llvm/lib/ProfileData/InstrProf.cpp
    M llvm/lib/ProfileData/InstrProfReader.cpp
    M llvm/lib/ProfileData/InstrProfWriter.cpp
    A llvm/lib/ProfileData/MemProf.cpp
    M llvm/lib/ProfileData/RawMemProfReader.cpp
    A llvm/test/tools/llvm-profdata/Inputs/basic.profraw
    A llvm/test/tools/llvm-profdata/memprof-merge.test
    M llvm/tools/llvm-profdata/llvm-profdata.cpp
    M llvm/unittests/ProfileData/InstrProfTest.cpp
    M llvm/unittests/ProfileData/MemProfTest.cpp

  Log Message:
  -----------
  Reland "[memprof] Extend the index prof format to include memory profiles."

This reverts commit 85355a560a33897453df2ef959e255ee725eebce.

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.

Differential Revision: https://reviews.llvm.org/D118653




More information about the All-commits mailing list