From 47e2a3e6ea749729bc3982294891e627f00fea2e Mon Sep 17 00:00:00 2001 From: Sergey Shevchenko Date: Tue, 4 Apr 2023 13:47:54 -0700 Subject: [PATCH] Replace a few noisy/secondary/rarely useful LOGs with VLOGs Abseil hasn't open-sourced VLOGs: we may roll out our own polyfill. PiperOrigin-RevId: 521855604 --- centipede.cc | 12 +++++++----- testing/centipede_test.cc | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/centipede.cc b/centipede.cc index 6dc29b0..ea5fa03 100644 --- a/centipede.cc +++ b/centipede.cc @@ -174,8 +174,10 @@ int Centipede::ExportCorpusFromLocalDir(const Environment &env, CHECK_OK(appender->Append(input)); ++inputs_added; } - LOG(INFO) << VV(shard) << VV(inputs_added) << VV(inputs_ignored) - << VV(num_shard_bytes) << VV(shard_data.size()); + + VLOG(1) << "Exported: " << VV(shard) << VV(inputs_added) + << VV(inputs_ignored) << VV(num_shard_bytes) + << VV(shard_data.size()); } CHECK_EQ(total_paths, inputs_added + inputs_ignored); return 0; @@ -550,9 +552,9 @@ void Centipede::MergeFromOtherCorpus(std::string_view merge_from_dir, } void Centipede::FuzzingLoop() { - LOG(INFO) << "Shard: " << env_.my_shard_index << "/" << env_.total_shards - << " " << TemporaryLocalDirPath() << " " - << "seed: " << env_.seed << "\n\n\n"; + LOG(INFO) << "\n\nFuzzing: shard: " << env_.my_shard_index << "/" + << env_.total_shards << " " << TemporaryLocalDirPath() << " " + << "seed: " << env_.seed << "\n\n"; { // Execute a dummy input. diff --git a/testing/centipede_test.cc b/testing/centipede_test.cc index b15f215..3e6cc27 100644 --- a/testing/centipede_test.cc +++ b/testing/centipede_test.cc @@ -168,6 +168,8 @@ TEST(Centipede, ShardsAndDistillTest) { env.corpus_dir.push_back(tmp_dir.CreateSubdir("cd1")); env.corpus_dir.push_back(tmp_dir.CreateSubdir("cd2")); + VLOG(1) << "Fuzzing"; + CentipedeMock mock(env); // First round of runs: do the actual fuzzing, compute the features. size_t max_shard_size = 0; @@ -187,6 +189,8 @@ TEST(Centipede, ShardsAndDistillTest) { EXPECT_GT(CountFilesInDir(env.corpus_dir[0]), 128); EXPECT_EQ(CountFilesInDir(env.corpus_dir[1]), 0); + VLOG(1) << "Distilling"; + // Second round of runs. Don't fuzz, only distill. // Don't distill in the last one to test the flag behaviour. env.distill_shards = env.total_shards - 1; @@ -473,7 +477,6 @@ static std::vector RunWithFunctionFilter( FunctionFilterMock mock(env); MockFactory factory(mock); CentipedeMain(env, factory); - LOG(INFO) << mock.observed_inputs_.size(); std::vector res(mock.observed_inputs_.begin(), mock.observed_inputs_.end()); std::sort(res.begin(), res.end()); @@ -653,9 +656,6 @@ TEST(Centipede, UndetectedCrashingInput) { constexpr size_t kCrashingInputIdx = (kNumBatches / 2) * kBatchSize + kCrashingInputIdxInBatch; - LOG(INFO) << VV(kNumBatches) << VV(kBatchSize) - << VV(kCrashingInputIdxInBatch) VV(kCrashingInputIdx); - TempDir temp_dir{test_info_->name()}; Environment env; env.workdir = temp_dir.path();