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() {
20092009 return MI.second .PID == FileMMapInfo.second .PID ;
20102010 });
20112011
2012- if (PIDExists)
2013- continue ;
2012+ // let duplicates to the multimap.
2013+ // if (PIDExists)
2014+ // continue;
20142015
20152016 GlobalMMapInfo.insert (FileMMapInfo);
20162017 }
@@ -2067,7 +2068,17 @@ std::error_code DataAggregator::parseMMapEvents() {
20672068 }
20682069 }
20692070
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+ }
20712082 }
20722083
20732084 if (BinaryMMapInfo.empty ()) {
Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ void Heatmap::print(raw_ostream &OS) const {
164164
165165 // Print map legend
166166 OS << " Legend:\n " ;
167+ OS << " \n Regions:\n " ;
167168 uint64_t PrevValue = 0 ;
168169 for (unsigned I = 0 ; I < sizeof (Range) / sizeof (Range[0 ]); ++I) {
169170 const uint64_t Value = Range[I];
@@ -173,6 +174,16 @@ void Heatmap::print(raw_ostream &OS) const {
173174 PrevValue = Value;
174175 }
175176
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+
176187 // Pos - character position from right in hex form.
177188 auto printHeader = [&](unsigned Pos) {
178189 OS << " " ;
You can’t perform that action at this time.
0 commit comments