[BOLT] Expose pseudo probe function checksum and GUID (#99389)
Add a BinaryFunction field for pseudo probe function GUID. Populate it during pseudo probe section parsing, and emit it in YAML profile (both regular and BAT), along with function checksum. To be used for stale function matching. Test Plan: update pseudoprobe-decoding-inline.test
This commit is contained in:
@@ -2298,6 +2298,8 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
|
||||
|
||||
yaml::bolt::BinaryProfile BP;
|
||||
|
||||
const MCPseudoProbeDecoder *PseudoProbeDecoder = BC.getPseudoProbeDecoder();
|
||||
|
||||
// Fill out the header info.
|
||||
BP.Header.Version = 1;
|
||||
BP.Header.FileName = std::string(BC.getFilename());
|
||||
@@ -2398,6 +2400,13 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
|
||||
const unsigned BlockIndex = BlockMap.getBBIndex(BI.To.Offset);
|
||||
YamlBF.Blocks[BlockIndex].ExecCount += BI.Branches;
|
||||
}
|
||||
if (PseudoProbeDecoder) {
|
||||
if ((YamlBF.GUID = BF->getGUID())) {
|
||||
const MCPseudoProbeFuncDesc *FuncDesc =
|
||||
PseudoProbeDecoder->getFuncDescForGUID(YamlBF.GUID);
|
||||
YamlBF.PseudoProbeDescHash = FuncDesc->FuncHash;
|
||||
}
|
||||
}
|
||||
// Drop blocks without a hash, won't be useful for stale matching.
|
||||
llvm::erase_if(YamlBF.Blocks,
|
||||
[](const yaml::bolt::BinaryBasicBlockProfile &YamlBB) {
|
||||
|
||||
Reference in New Issue
Block a user