[all-commits] [llvm/llvm-project] 9def83: [memprof] Refactor out the MemInfoBlock into a mac...

Snehasish Kumar via All-commits all-commits at lists.llvm.org
Mon Feb 14 09:55:00 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9def83c6d02944b2931efd50cd2491953a772aab
      https://github.com/llvm/llvm-project/commit/9def83c6d02944b2931efd50cd2491953a772aab
  Author: Snehasish Kumar <snehasishk at google.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    A compiler-rt/include/profile/MIBEntryDef.inc
    M compiler-rt/include/profile/MemProfData.inc
    M compiler-rt/lib/memprof/memprof_allocator.cpp
    M compiler-rt/lib/memprof/tests/rawprofile.cpp
    A llvm/include/llvm/ProfileData/MIBEntryDef.inc
    M llvm/include/llvm/ProfileData/MemProf.h
    M llvm/include/llvm/ProfileData/MemProfData.inc
    M llvm/unittests/ProfileData/MemProfTest.cpp

  Log Message:
  -----------
  [memprof] Refactor out the MemInfoBlock into a macro based def.

This patch refactors out the MemInfoBlock definition into a macro based
header which can be included to generate enums, structus and code for
each field recorded by the memprof profiling runtime.

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


  Commit: 9b67165285c5e752fce3b554769f5a22e7b38da8
      https://github.com/llvm/llvm-project/commit/9b67165285c5e752fce3b554769f5a22e7b38da8
  Author: Snehasish Kumar <snehasishk at google.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M llvm/include/llvm/ProfileData/MemProf.h
    M llvm/lib/ProfileData/RawMemProfReader.cpp
    M llvm/test/tools/llvm-profdata/memprof-basic.test
    M llvm/unittests/ProfileData/MemProfTest.cpp

  Log Message:
  -----------
  [memprof] Introduce a wrapper around MemInfoBlock.

Use the macro based format to add a wrapper around the MemInfoBlock
when stored in the MemProfRecord. This wrapped block can then be
serialized/deserialized based on a schema specified by a list of enums.

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


  Commit: 14cc41a0206a85d350767f8aff6e02bd4e7dd5d6
      https://github.com/llvm/llvm-project/commit/14cc41a0206a85d350767f8aff6e02bd4e7dd5d6
  Author: Snehasish Kumar <snehasishk at google.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

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

  Log Message:
  -----------
  [InstrProf] Make the IndexedInstrProf header backwards compatible.

While the contents of the profile are backwards compatible the header
itself is not. For example, when adding new fields to the header results
in significant issues. This change adds allows for portable
instantiation of the header across indexed format versions.

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


  Commit: 43c2348c5b926df6bdbc5b70efaa35ecdefe12d5
      https://github.com/llvm/llvm-project/commit/43c2348c5b926df6bdbc5b70efaa35ecdefe12d5
  Author: Snehasish Kumar <snehasishk at google.com>
  Date:   2022-02-14 (Mon, 14 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:
  -----------
  [memprof] Extend the index prof format to include memory profiles.

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


Compare: https://github.com/llvm/llvm-project/compare/fb40a61b2f44...43c2348c5b92


More information about the All-commits mailing list