File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -268,4 +268,21 @@ bool UseExplicitIterationCounts() {
268268 !FindInCommandLine (" --benchmark_list_tests" );
269269}
270270
271+ bool FleetbenchReporter::ReportContext (
272+ const benchmark::BenchmarkReporter::Context& context) {
273+ reporter_->SetOutputStream (&this ->GetOutputStream ());
274+ reporter_->SetErrorStream (&this ->GetErrorStream ());
275+ bool result = reporter_->ReportContext (context);
276+ if (absl::GetFlag (FLAGS_L1_data_size).has_value () ||
277+ absl::GetFlag (FLAGS_L2_size).has_value () ||
278+ absl::GetFlag (FLAGS_L3_size).has_value ()) {
279+ auto & err = this ->GetErrorStream ();
280+ err << " Effective CPU Cache Sizes:\n " ;
281+ err << " L1 Data " << GetCacheSize (1 , " Data" ) / 1024 << " KiB\n " ;
282+ err << " L2 " << GetCacheSize (2 ) / 1024 << " KiB\n " ;
283+ err << " L3 " << GetCacheSize (3 ) / 1024 << " KiB\n " ;
284+ }
285+ return result;
286+ }
287+
271288} // namespace fleetbench
Original file line number Diff line number Diff line change @@ -117,12 +117,7 @@ class FleetbenchReporter : public benchmark::BenchmarkReporter {
117117 reporter_->ReportRunsConfig (min_time, has_explicit_iters, iters);
118118 }
119119
120- bool ReportContext (
121- const benchmark::BenchmarkReporter::Context& context) override {
122- reporter_->SetOutputStream (&this ->GetOutputStream ());
123- reporter_->SetErrorStream (&this ->GetErrorStream ());
124- return reporter_->ReportContext (context);
125- }
120+ bool ReportContext (const benchmark::BenchmarkReporter::Context&) override ;
126121
127122 void Finalize () override { reporter_->Finalize (); }
128123
You can’t perform that action at this time.
0 commit comments