Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Replace a few noisy/secondary/rarely useful LOGs with VLOGs #565

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions centipede.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions testing/centipede_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -473,7 +477,6 @@ static std::vector<ByteArray> RunWithFunctionFilter(
FunctionFilterMock mock(env);
MockFactory factory(mock);
CentipedeMain(env, factory);
LOG(INFO) << mock.observed_inputs_.size();
std::vector<ByteArray> res(mock.observed_inputs_.begin(),
mock.observed_inputs_.end());
std::sort(res.begin(), res.end());
Expand Down Expand Up @@ -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();
Expand Down