[memprof] Extend llvm-profdata to display MemProf profile summaries.
authorSnehasish Kumar <snehasishk@google.com>
Fri, 19 Nov 2021 22:02:41 +0000 (14:02 -0800)
committerSnehasish Kumar <snehasishk@google.com>
Tue, 30 Nov 2021 18:45:26 +0000 (10:45 -0800)
commit7cca33b40f77c2d8bcd4241bcd0e4c45a0209683
treeb8dd148bbb927648c6ea51f800e364197d4e78c3
parent8bc593cbbb1ae6aac6443132ae2d33c6513b1a2c
[memprof] Extend llvm-profdata to display MemProf profile summaries.

This commit adds initial support to llvm-profdata to read and print
summaries of raw memprof profiles.
Summary of changes:
* Refactor shared defs to MemProfData.inc
* Extend show_main to display memprof profile summaries.
* Add a simple raw memprof profile reader.
* Add a couple of tests to tools/llvm-profdata.

Differential Revision: https://reviews.llvm.org/D114286
15 files changed:
compiler-rt/include/CMakeLists.txt
compiler-rt/include/profile/MemProfData.inc [new file with mode: 0644]
compiler-rt/lib/memprof/CMakeLists.txt
compiler-rt/lib/memprof/memprof_rawprofile.cpp
compiler-rt/lib/memprof/memprof_rawprofile.h
llvm/include/llvm/ProfileData/MemProfData.inc [new file with mode: 0644]
llvm/include/llvm/ProfileData/RawMemProfReader.h [new file with mode: 0644]
llvm/lib/ProfileData/CMakeLists.txt
llvm/lib/ProfileData/RawMemProfReader.cpp [new file with mode: 0644]
llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw [new file with mode: 0644]
llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw [new file with mode: 0644]
llvm/test/tools/llvm-profdata/memprof-basic.test [new file with mode: 0644]
llvm/test/tools/llvm-profdata/memprof-multi.test [new file with mode: 0644]
llvm/test/tools/llvm-profdata/text-format-errors.test
llvm/tools/llvm-profdata/llvm-profdata.cpp