File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -2009,8 +2009,9 @@ std::error_code DataAggregator::parseMMapEvents() {
2009
2009
return MI.second .PID == FileMMapInfo.second .PID ;
2010
2010
});
2011
2011
2012
- if (PIDExists)
2013
- continue ;
2012
+ // let duplicates to the multimap.
2013
+ // if (PIDExists)
2014
+ // continue;
2014
2015
2015
2016
GlobalMMapInfo.insert (FileMMapInfo);
2016
2017
}
@@ -2067,7 +2068,17 @@ std::error_code DataAggregator::parseMMapEvents() {
2067
2068
}
2068
2069
}
2069
2070
2070
- BinaryMMapInfo.insert (std::make_pair (MMapInfo.PID , MMapInfo));
2071
+ // The mapping was already in place, but there are cases where the size
2072
+ // is wrong. Fix it if needed.
2073
+ if (!BinaryMMapInfo.insert (std::make_pair (MMapInfo.PID , MMapInfo)).second ) {
2074
+ auto EndAddress = MMapInfo.MMapAddress + MMapInfo.Size ;
2075
+ auto FixedSize = EndAddress - BinaryMMapInfo[MMapInfo.PID ].BaseAddress ;
2076
+
2077
+ if (FixedSize != BinaryMMapInfo[MMapInfo.PID ].Size ) {
2078
+ outs () << " MMap size fixed: " << Twine::utohexstr (FixedSize) << " \n " ;
2079
+ BinaryMMapInfo[MMapInfo.PID ].Size = FixedSize;
2080
+ }
2081
+ }
2071
2082
}
2072
2083
2073
2084
if (BinaryMMapInfo.empty ()) {
Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ void Heatmap::print(raw_ostream &OS) const {
164
164
165
165
// Print map legend
166
166
OS << " Legend:\n " ;
167
+ OS << " \n Regions:\n " ;
167
168
uint64_t PrevValue = 0 ;
168
169
for (unsigned I = 0 ; I < sizeof (Range) / sizeof (Range[0 ]); ++I) {
169
170
const uint64_t Value = Range[I];
@@ -173,6 +174,16 @@ void Heatmap::print(raw_ostream &OS) const {
173
174
PrevValue = Value;
174
175
}
175
176
177
+ {
178
+ OS << " \n Sections:\n " ;
179
+ int Idx = 0 ;
180
+ for (auto TxtSeg : TextSections) {
181
+ OS << static_cast <char >(' A' + ((Idx++) % 26 )) << " : " << TxtSeg.Name
182
+ << " : 0x" << Twine::utohexstr (TxtSeg.BeginAddress ) << " -0x"
183
+ << Twine::utohexstr (TxtSeg.EndAddress ) << " \n " ;
184
+ }
185
+ }
186
+
176
187
// Pos - character position from right in hex form.
177
188
auto printHeader = [&](unsigned Pos) {
178
189
OS << " " ;
You can’t perform that action at this time.
0 commit comments