Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion llvm/tools/llvm-profgen/ProfiledBinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ static cl::opt<bool>
cl::desc("Generate the profile for Linux kernel binary."),
cl::cat(ProfGenCategory));

static cl::opt<uint64_t>
Pagesize("page-size",
cl::desc("page size"), cl::init(0x1000),
cl::desc("target system pagee size."));

namespace sampleprof {

static const Target *getTarget(const ObjectFile *Obj) {
Expand Down Expand Up @@ -330,7 +335,7 @@ void ProfiledBinary::setPreferredTextSegmentAddresses(const ELFFile<ELFT> &Obj,
// However such info isn't available at post-processing time, assuming
// 4K page now. Note that we don't use EXEC_PAGESIZE from <linux/param.h>
// because we may build the tools on non-linux.
uint64_t PageSize = 0x1000;
uint64_t PageSize = Pagesize;
for (const typename ELFT::Phdr &Phdr : PhdrRange) {
if (Phdr.p_type == ELF::PT_LOAD) {
if (!FirstLoadableAddress)
Expand Down