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

Commit

Permalink
Replace a few noisy/secondary/rarely useful LOGs with VLOGs
Browse files Browse the repository at this point in the history
Abseil hasn't open-sourced VLOGs: we may roll out our own polyfill.

PiperOrigin-RevId: 521855604
  • Loading branch information
ussuri authored and copybara-github committed Apr 4, 2023
1 parent 7a20b4e commit 47e2a3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
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

0 comments on commit 47e2a3e

Please sign in to comment.