@@ -309,10 +309,10 @@ class SubProcessFunctionExecutorImpl
309
309
}
310
310
311
311
if (ParentOrChildPID == 0 ) {
312
- // We are in the child process, close the write end of the pipe
312
+ // We are in the child process, close the write end of the pipe.
313
313
close (PipeFiles[1 ]);
314
314
// Unregister handlers, signal handling is now handled through ptrace in
315
- // the host process
315
+ // the host process.
316
316
sys::unregisterHandlers ();
317
317
prepareAndRunBenchmark (PipeFiles[0 ], Key);
318
318
// The child process terminates in the above function, so we should never
@@ -371,7 +371,7 @@ class SubProcessFunctionExecutorImpl
371
371
int ChildExitCode = WEXITSTATUS (ChildStatus);
372
372
if (ChildExitCode == 0 ) {
373
373
// The child exited succesfully, read counter values and return
374
- // success
374
+ // success.
375
375
auto CounterValueOrErr = Counter->readOrError ();
376
376
if (!CounterValueOrErr)
377
377
return CounterValueOrErr.takeError ();
@@ -387,7 +387,7 @@ class SubProcessFunctionExecutorImpl
387
387
388
388
return Error::success ();
389
389
}
390
- // The child exited, but not successfully
390
+ // The child exited, but not successfully.
391
391
return make_error<Failure>(
392
392
" Child benchmarking process exited with non-zero exit code: " +
393
393
childProcessExitCodeToString (ChildExitCode));
@@ -423,7 +423,7 @@ class SubProcessFunctionExecutorImpl
423
423
// user inspect a core dump.
424
424
disableCoreDumps ();
425
425
426
- // The following occurs within the benchmarking subprocess
426
+ // The following occurs within the benchmarking subprocess.
427
427
pid_t ParentPID = getppid ();
428
428
429
429
Expected<int > CounterFileDescriptorOrError =
@@ -436,7 +436,7 @@ class SubProcessFunctionExecutorImpl
436
436
437
437
// Glibc versions greater than 2.35 automatically call rseq during
438
438
// initialization. Unmapping the region that glibc sets up for this causes
439
- // segfaults in the program Unregister the rseq region so that we can safely
439
+ // segfaults in the program. Unregister the rseq region so that we can safely
440
440
// unmap it later
441
441
#ifdef GLIBC_INITS_RSEQ
442
442
long RseqDisableOutput =
@@ -559,7 +559,7 @@ BenchmarkRunner::getRunnableConfiguration(
559
559
}
560
560
561
561
// Assemble enough repetitions of the snippet so we have at least
562
- // MinInstructios instructions.
562
+ // MinInstructions instructions.
563
563
if (BenchmarkPhaseSelector >
564
564
BenchmarkPhaseSelectorE::PrepareAndAssembleSnippet) {
565
565
auto Snippet =
@@ -636,9 +636,10 @@ std::pair<Error, Benchmark> BenchmarkRunner::runConfiguration(
636
636
}
637
637
assert (BenchmarkResult.MinInstructions > 0 && " invalid MinInstructions" );
638
638
for (BenchmarkMeasure &BM : *NewMeasurements) {
639
- // Scale the measurements by instruction .
639
+ // Scale the measurements by the number of instructions .
640
640
BM.PerInstructionValue /= BenchmarkResult.MinInstructions ;
641
- // Scale the measurements by snippet.
641
+ // Scale the measurements by the number of times the entire snippet is
642
+ // repeated.
642
643
BM.PerSnippetValue /=
643
644
std::ceil (BenchmarkResult.MinInstructions /
644
645
static_cast <double >(BenchmarkResult.Key .Instructions .size ()));
0 commit comments