File tree Expand file tree Collapse file tree 3 files changed +5
-17
lines changed
llvm/tools/llvm-exegesis/lib Expand file tree Collapse file tree 3 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -356,7 +356,11 @@ class SubProcessFunctionExecutorImpl
356
356
if (ChildExitCode == 0 ) {
357
357
// The child exited succesfully, read counter values and return
358
358
// success
359
- CounterValues[0 ] = Counter->read ();
359
+ auto CounterValueOrErr = Counter->readOrError ();
360
+ if (!CounterValueOrErr)
361
+ return CounterValueOrErr.takeError ();
362
+ CounterValues = std::move (*CounterValueOrErr);
363
+
360
364
return Error::success ();
361
365
}
362
366
// The child exited, but not successfully
Original file line number Diff line number Diff line change @@ -148,17 +148,6 @@ void Counter::stop() {
148
148
ioctl (FileDescriptor, PERF_EVENT_IOC_DISABLE, 0 );
149
149
}
150
150
151
- int64_t Counter::read () const {
152
- auto ValueOrError = readOrError ();
153
- if (ValueOrError) {
154
- if (!ValueOrError.get ().empty ())
155
- return ValueOrError.get ()[0 ];
156
- errs () << " Counter has no reading\n " ;
157
- } else
158
- errs () << ValueOrError.takeError () << " \n " ;
159
- return -1 ;
160
- }
161
-
162
151
llvm::Expected<llvm::SmallVector<int64_t , 4 >>
163
152
Counter::readOrError (StringRef /* unused*/ ) const {
164
153
int64_t Count = 0 ;
@@ -187,8 +176,6 @@ void Counter::start() {}
187
176
188
177
void Counter::stop () {}
189
178
190
- int64_t Counter::read () const { return 42 ; }
191
-
192
179
llvm::Expected<llvm::SmallVector<int64_t , 4 >>
193
180
Counter::readOrError (StringRef /* unused*/ ) const {
194
181
if (IsDummyEvent) {
Original file line number Diff line number Diff line change @@ -95,9 +95,6 @@ class Counter {
95
95
// / Stops the measurement of the event.
96
96
void stop ();
97
97
98
- // / Returns the current value of the counter or -1 if it cannot be read.
99
- int64_t read () const ;
100
-
101
98
// / Returns the current value of the counter or error if it cannot be read.
102
99
// / FunctionBytes: The benchmark function being executed.
103
100
// / This is used to filter out the measurements to ensure they are only
You can’t perform that action at this time.
0 commit comments