diff options
author | Aiden Grossman <agrossman154@yahoo.com> | 2024-02-17 16:13:29 -0800 |
---|---|---|
committer | Aiden Grossman <agrossman154@yahoo.com> | 2024-02-17 16:13:29 -0800 |
commit | db8b76dbb07d4053a4e44baf1518c9ea0d84c844 (patch) | |
tree | 8daff056ede3516f16a95548d8bc6637baa800d4 | |
parent | fbce244299524fc3d736cce9d25b4262303b45d5 (diff) | |
download | llvm-db8b76dbb07d4053a4e44baf1518c9ea0d84c844.zip llvm-db8b76dbb07d4053a4e44baf1518c9ea0d84c844.tar.gz llvm-db8b76dbb07d4053a4e44baf1518c9ea0d84c844.tar.bz2 |
[NFC][llvm-exegesis] Clean up BenchmarkRunner comments
There were a couple things in the comments of BenchmarkRunner.cpp (and
maybe other files, I can't really remember) that were bugging me. This
patch fixes a couple of minor issues specifically in BenchmarkRunner
like typos and makes a couple instances more clear.
-rw-r--r-- | llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp index a8bc438..5c9848f 100644 --- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp @@ -309,10 +309,10 @@ private: } if (ParentOrChildPID == 0) { - // We are in the child process, close the write end of the pipe + // We are in the child process, close the write end of the pipe. close(PipeFiles[1]); // Unregister handlers, signal handling is now handled through ptrace in - // the host process + // the host process. sys::unregisterHandlers(); prepareAndRunBenchmark(PipeFiles[0], Key); // The child process terminates in the above function, so we should never @@ -371,7 +371,7 @@ private: int ChildExitCode = WEXITSTATUS(ChildStatus); if (ChildExitCode == 0) { // The child exited succesfully, read counter values and return - // success + // success. auto CounterValueOrErr = Counter->readOrError(); if (!CounterValueOrErr) return CounterValueOrErr.takeError(); @@ -387,7 +387,7 @@ private: return Error::success(); } - // The child exited, but not successfully + // The child exited, but not successfully. return make_error<Failure>( "Child benchmarking process exited with non-zero exit code: " + childProcessExitCodeToString(ChildExitCode)); @@ -423,7 +423,7 @@ private: // user inspect a core dump. disableCoreDumps(); - // The following occurs within the benchmarking subprocess + // The following occurs within the benchmarking subprocess. pid_t ParentPID = getppid(); Expected<int> CounterFileDescriptorOrError = @@ -436,7 +436,7 @@ private: // Glibc versions greater than 2.35 automatically call rseq during // initialization. Unmapping the region that glibc sets up for this causes -// segfaults in the program Unregister the rseq region so that we can safely +// segfaults in the program. Unregister the rseq region so that we can safely // unmap it later #ifdef GLIBC_INITS_RSEQ long RseqDisableOutput = @@ -559,7 +559,7 @@ BenchmarkRunner::getRunnableConfiguration( } // Assemble enough repetitions of the snippet so we have at least - // MinInstructios instructions. + // MinInstructions instructions. if (BenchmarkPhaseSelector > BenchmarkPhaseSelectorE::PrepareAndAssembleSnippet) { auto Snippet = @@ -636,9 +636,10 @@ std::pair<Error, Benchmark> BenchmarkRunner::runConfiguration( } assert(BenchmarkResult.MinInstructions > 0 && "invalid MinInstructions"); for (BenchmarkMeasure &BM : *NewMeasurements) { - // Scale the measurements by instruction. + // Scale the measurements by the number of instructions. BM.PerInstructionValue /= BenchmarkResult.MinInstructions; - // Scale the measurements by snippet. + // Scale the measurements by the number of times the entire snippet is + // repeated. BM.PerSnippetValue /= std::ceil(BenchmarkResult.MinInstructions / static_cast<double>(BenchmarkResult.Key.Instructions.size())); |