Skip to content

Commit bbcdd4f

Browse files
authored
[BOLT] Use disambiguated local names in BAT YAML
Align BAT YAML to fdata profile. Test Plan: updated register-fragments-bolt-symbols.s Reviewers: dcci, rafaelauler, ayermolo, maksfb Reviewed By: dcci Pull Request: #91773
1 parent 3676b09 commit bbcdd4f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2339,7 +2339,7 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
23392339
continue;
23402340
BinaryFunction *BF = BC.getBinaryFunctionAtAddress(FuncAddress);
23412341
assert(BF);
2342-
YamlBF.Name = FuncName.str();
2342+
YamlBF.Name = getLocationName(*BF);
23432343
YamlBF.Id = BF->getFunctionNumber();
23442344
YamlBF.Hash = BAT->getBFHash(FuncAddress);
23452345
YamlBF.ExecCount = BF->getKnownExecutionCount();

bolt/test/X86/register-fragments-bolt-symbols.s

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# PREAGG: B X:0 #chain.cold.0# 1 0
1616
# RUN: perf2bolt %t.bolt -p %t.preagg --pa -o %t.bat.fdata -w %t.bat.yaml -v=1 \
1717
# RUN: | FileCheck %s --check-prefix=CHECK-REGISTER
18+
# RUN: FileCheck --input-file %t.bat.fdata --check-prefix=CHECK-FDATA %s
19+
# RUN: FileCheck --input-file %t.bat.yaml --check-prefix=CHECK-YAML %s
1820

1921
# CHECK-SYMS: l df *ABS* [[#]] chain.s
2022
# CHECK-SYMS: l F .bolt.org.text [[#]] chain
@@ -24,6 +26,9 @@
2426

2527
# CHECK-REGISTER: BOLT-INFO: marking chain.cold.0/1(*2) as a fragment of chain/2(*2)
2628

29+
# CHECK-FDATA: 0 [unknown] 0 1 chain/chain.s/2 10 0 1
30+
# CHECK-YAML: - name: 'chain/chain.s/2'
31+
2732
.file "chain.s"
2833
.text
2934
.type chain, @function

0 commit comments

Comments
 (0)