Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ class SubProcessFunctionExecutorImpl
if (ChildExitCode == 0) {
// The child exited succesfully, read counter values and return
// success
CounterValues[0] = Counter->read();
auto CounterValueOrErr = Counter->readOrError();
if (!CounterValueOrErr)
return CounterValueOrErr.takeError();
CounterValues = std::move(*CounterValueOrErr);

return Error::success();
}
// The child exited, but not successfully
Expand Down
13 changes: 0 additions & 13 deletions llvm/tools/llvm-exegesis/lib/PerfHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,6 @@ void Counter::stop() {
ioctl(FileDescriptor, PERF_EVENT_IOC_DISABLE, 0);
}

int64_t Counter::read() const {
auto ValueOrError = readOrError();
if (ValueOrError) {
if (!ValueOrError.get().empty())
return ValueOrError.get()[0];
errs() << "Counter has no reading\n";
} else
errs() << ValueOrError.takeError() << "\n";
return -1;
}

llvm::Expected<llvm::SmallVector<int64_t, 4>>
Counter::readOrError(StringRef /*unused*/) const {
int64_t Count = 0;
Expand Down Expand Up @@ -187,8 +176,6 @@ void Counter::start() {}

void Counter::stop() {}

int64_t Counter::read() const { return 42; }

llvm::Expected<llvm::SmallVector<int64_t, 4>>
Counter::readOrError(StringRef /*unused*/) const {
if (IsDummyEvent) {
Expand Down
3 changes: 0 additions & 3 deletions llvm/tools/llvm-exegesis/lib/PerfHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ class Counter {
/// Stops the measurement of the event.
void stop();

/// Returns the current value of the counter or -1 if it cannot be read.
int64_t read() const;

/// Returns the current value of the counter or error if it cannot be read.
/// FunctionBytes: The benchmark function being executed.
/// This is used to filter out the measurements to ensure they are only
Expand Down