Skip to content

Commit 52fad27

Browse files
committed
Revert "[llvm-profgen] Add --sample-period to estimate absolute counts (llvm#99826)"
This reverts commit 01d7836.
1 parent ef1367f commit 52fad27

File tree

2 files changed

+0
-98
lines changed

2 files changed

+0
-98
lines changed

llvm/test/tools/llvm-profgen/period-scaling.test

Lines changed: 0 additions & 84 deletions
This file was deleted.

llvm/tools/llvm-profgen/PerfReader.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ static cl::alias
5353
cl::desc("Comma-delimited version of -perf-event"),
5454
cl::aliasopt(PerfEventFilter));
5555

56-
static cl::opt<uint64_t>
57-
SamplePeriod("sample-period", cl::init(1),
58-
cl::desc("The sampling period (-c) used for perf data"));
59-
6056
extern cl::opt<std::string> PerfTraceFilename;
6157
extern cl::opt<bool> ShowDisassemblyOnly;
6258
extern cl::opt<bool> ShowSourceLocations;
@@ -1004,16 +1000,6 @@ void LBRPerfReader::parseSample(TraceStream &TraceIt, uint64_t Count) {
10041000
if (extractLBRStack(TraceIt, Sample->LBRStack)) {
10051001
warnIfMissingMMap();
10061002
// Record LBR only samples by aggregation
1007-
// If a sampling period is given we can adjust the magnitude of sample
1008-
// counts to estimate the absolute magnitute.
1009-
if (SamplePeriod.getNumOccurrences()) {
1010-
Count *= SamplePeriod;
1011-
// If counts are LBR-based, as opposed to IP-based, then the magnitude is
1012-
// now amplified by roughly the LBR stack size. By adjusting this down, we
1013-
// can produce LBR-based and IP-based profiles with comparable magnitudes.
1014-
if (!LeadingIPOnly && Sample->LBRStack.size() > 1)
1015-
Count /= (Sample->LBRStack.size() - 1);
1016-
}
10171003
AggregatedSamples[Hashable<PerfSample>(Sample)] += Count;
10181004
}
10191005
}

0 commit comments

Comments
 (0)