[llvm-porfgen] Allow perf data as input
authorWenlei He <aktoon@gmail.com>
Thu, 30 Sep 2021 00:03:33 +0000 (17:03 -0700)
committerWenlei He <aktoon@gmail.com>
Thu, 30 Sep 2021 05:57:35 +0000 (22:57 -0700)
commit1f0bc617bdd11a4f3b0d820603b0089f81aca79b
tree0822dcec2744a6187b9bd8de2bc991bbcb525b23
parent941191aae4abaf88b176bec8cfe1c841a5832642
[llvm-porfgen] Allow perf data as input

This change enables llvm-profgen to take raw perf data as alternative input format. Sometimes we need to retrieve evenets for processes with matching binary. Using perf data as input allows us to retrieve process Ids from mmap events for matching binary, then filter by process id during perf script generation.

Differential Revision: https://reviews.llvm.org/D110793
llvm/tools/llvm-profgen/PerfReader.cpp
llvm/tools/llvm-profgen/PerfReader.h
llvm/tools/llvm-profgen/llvm-profgen.cpp