[PATCH] D124663: LNT: Only use text segment when isSO
Tamar Christina via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 29 02:41:28 PDT 2022
tnfchris updated this revision to Diff 426003.
tnfchris added a comment.
change brace style
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124663/new/
https://reviews.llvm.org/D124663
Files:
lnt/testing/profile/cPerf.cpp
Index: lnt/testing/profile/cPerf.cpp
===================================================================
--- lnt/testing/profile/cPerf.cpp
+++ lnt/testing/profile/cPerf.cpp
@@ -361,6 +361,7 @@
struct Map {
uint64_t Start, End, Adjust;
+ bool isSO;
const char *Filename;
};
@@ -528,10 +529,14 @@
void reset(Map *M) {
clear();
// Fetch both dynamic and static symbols, sort and unique them.
- uint64_t segmentStart = fetchExecSegment (M);
- /* Adjust the symbol to a value relative to the start of the load address
- to match up with registerNewMapping. */
- M->Adjust -= segmentStart;
+ /* If we're a relocatable object then take the actual start of the text
+ segment into account. */
+ if (M->isSO) {
+ uint64_t segmentStart = fetchExecSegment (M);
+ /* Adjust the symbol to a value relative to the start of the load address
+ to match up with registerNewMapping. */
+ M->Adjust -= segmentStart;
+ }
fetchSymbols(M);
std::sort(begin(), end());
@@ -852,7 +857,7 @@
bool IsSO = IsSharedObject(BinaryCacheRoot + std::string(Filename));
uint64_t End = E->start + E->extent;
uint64_t Adjust = IsSO ? E->start - E->pgoff : 0;
- Maps.push_back({E->start, End, Adjust, Filename});
+ Maps.push_back({E->start, End, Adjust, IsSO, Filename});
unsigned char *EndOfEvent = Buf + E->header.size;
// FIXME: The first EventID is used for every event.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124663.426003.patch
Type: text/x-patch
Size: 1459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220429/de88d11e/attachment.bin>
More information about the llvm-commits
mailing list