summaryrefslogtreecommitdiffstats
path: root/courgette
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-21 20:40:58 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-21 20:40:58 +0000
commit18cca2018b2159c6efdde226d1c2695aba4a62aa (patch)
treea0dd28779624db09bdfaf54d23c1ddd5b72c84c5 /courgette
parent3cd3202a53d2fbb2944a61c9286ff74b3ea6671b (diff)
downloadchromium_src-18cca2018b2159c6efdde226d1c2695aba4a62aa.zip
chromium_src-18cca2018b2159c6efdde226d1c2695aba4a62aa.tar.gz
chromium_src-18cca2018b2159c6efdde226d1c2695aba4a62aa.tar.bz2
Convert LOG(INFO) to VLOG(1) - courgette/.
This eliminates the custom logging code as VLOG is per-module configurable. I did preserve the distinct log level numbers in the VLOG statements. BUG=none TEST=none Review URL: http://codereview.chromium.org/3904002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63407 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette')
-rw-r--r--courgette/adjustment_method.cc59
-rw-r--r--courgette/adjustment_method_2.cc79
-rw-r--r--courgette/assembly_program.cc11
-rw-r--r--courgette/disassembler.cc12
-rw-r--r--courgette/encoded_program.cc20
-rw-r--r--courgette/ensemble_create.cc47
-rw-r--r--courgette/simple_delta.cc6
-rw-r--r--courgette/third_party/bsdiff_create.cc32
8 files changed, 109 insertions, 157 deletions
diff --git a/courgette/adjustment_method.cc b/courgette/adjustment_method.cc
index e82d669..435e44a 100644
--- a/courgette/adjustment_method.cc
+++ b/courgette/adjustment_method.cc
@@ -23,17 +23,6 @@
namespace courgette {
-// We have three discretionary information logging levels for algorithm
-// development. For now just configure with #defines.
-// TODO(sra): make dependent of some configurable setting.
-#define NO_LOG DLOG_IF(INFO, false)
-// #define ALOG1 LOG(INFO)
-// #define ALOG2 LOG(INFO)
-// #define ALOG3 LOG(INFO)
-#define ALOG1 NO_LOG
-#define ALOG2 NO_LOG
-#define ALOG3 NO_LOG
-
////////////////////////////////////////////////////////////////////////////////
class NullAdjustmentMethod : public AdjustmentMethod {
@@ -242,14 +231,14 @@ class AssignmentProblem {
TrySolveNode(node);
}
- ALOG1 << unsolved_.size() << " unsolved items";
+ VLOG(2) << unsolved_.size() << " unsolved items";
return true;
}
private:
void AddToQueue(Node* node) {
if (node->length_ >= 10) {
- ALOG3 << "Length clipped " << ToString(node->prev_);
+ VLOG(4) << "Length clipped " << ToString(node->prev_);
return;
}
if (node->in_queue_) {
@@ -274,7 +263,7 @@ class AssignmentProblem {
node->edges_in_frequency_order.pop_front();
}
if (skipped > 0)
- ALOG3 << "Skipped " << skipped << " at " << ToString(node);
+ VLOG(4) << "Skipped " << skipped << " at " << ToString(node);
}
void TrySolveNode(Node* p_node) {
@@ -292,7 +281,7 @@ class AssignmentProblem {
Node* m_node = FindModelNode(p_node);
if (m_node == NULL) {
- ALOG1 << "Can't find model node";
+ VLOG(2) << "Can't find model node";
unsolved_.insert(p_node);
return;
}
@@ -302,8 +291,8 @@ class AssignmentProblem {
SkipCommittedLabels(m_node);
if (m_node->edges_in_frequency_order.empty()) {
- ALOG3 << "Punting, no elements left in model vs "
- << p_node->edges_in_frequency_order.size();
+ VLOG(4) << "Punting, no elements left in model vs "
+ << p_node->edges_in_frequency_order.size();
unsolved_.insert(p_node);
return;
}
@@ -312,9 +301,9 @@ class AssignmentProblem {
if (p_match->count_ > 1.1 * m_match->count_ ||
m_match->count_ > 1.1 * p_match->count_) {
- ALOG2 << "Tricky distribution "
- << p_match->count_ << ":" << m_match->count_ << " "
- << ToString(p_match) << " vs " << ToString(m_match);
+ VLOG(3) << "Tricky distribution "
+ << p_match->count_ << ":" << m_match->count_ << " "
+ << ToString(p_match) << " vs " << ToString(m_match);
return;
}
@@ -325,7 +314,7 @@ class AssignmentProblem {
LabelInfo* m_label_info = m_match->in_edge_;
int m_index = p_label_info->label_->index_;
if (m_index != Label::kNoIndex) {
- ALOG1 << "Cant use unassigned label from model " << m_index;
+ VLOG(2) << "Cant use unassigned label from model " << m_index;
unsolved_.insert(p_node);
return;
}
@@ -338,7 +327,7 @@ class AssignmentProblem {
void Assign(LabelInfo* p_info, LabelInfo* m_info) {
AssignOne(p_info, m_info);
- ALOG3 << "Assign " << ToString(p_info) << " := " << ToString(m_info);
+ VLOG(4) << "Assign " << ToString(p_info) << " := " << ToString(m_info);
// Now consider unassigned adjacent addresses
TryExtendAssignment(p_info, m_info);
}
@@ -386,8 +375,8 @@ class AssignmentProblem {
break;
}
- ALOG3 << " Extending assignment -> "
- << ToString(p_info_next) << " := " << ToString(m_info_next);
+ VLOG(4) << " Extending assignment -> "
+ << ToString(p_info_next) << " := " << ToString(m_info_next);
AssignOne(p_info_next, m_info_next);
@@ -426,8 +415,8 @@ class AssignmentProblem {
}
AssignOne(p_info_prev, m_info_prev);
- ALOG3 << " Extending assignment <- " << ToString(p_info_prev) << " := "
- << ToString(m_info_prev);
+ VLOG(4) << " Extending assignment <- " << ToString(p_info_prev) << " := "
+ << ToString(m_info_prev);
p_info_prev = p_info_prev_prev;
m_info_prev = m_info_prev_prev;
@@ -459,10 +448,8 @@ class AssignmentProblem {
break;
AssignOne(p_info, m_info);
- ALOG3 << " Extending assignment seq"
- << "[+" << p_pos - p_pos_start << "]"
- << " -> "
- << ToString(p_info) << " := " << ToString(m_info);
+ VLOG(4) << " Extending assignment seq[+" << p_pos - p_pos_start
+ << "] -> " << ToString(p_info) << " := " << ToString(m_info);
++p_pos;
++m_pos;
@@ -497,10 +484,8 @@ class AssignmentProblem {
break;
AssignOne(p_info, m_info);
- ALOG3 << " Extending assignment seq"
- << "[-" << p_pos_start - p_pos << "]"
- << " <- "
- << ToString(p_info) << " := " << ToString(m_info);
+ VLOG(4) << " Extending assignment seq[-" << p_pos_start - p_pos
+ << "] <- " << ToString(p_info) << " := " << ToString(m_info);
--p_pos;
--m_pos;
@@ -523,13 +508,13 @@ class AssignmentProblem {
LabelInfo* p_label = node->in_edge_;
LabelInfo* m_label = p_label->assignment_;
if (m_label == NULL) {
- ALOG1 << "Expected assigned prefix";
+ VLOG(2) << "Expected assigned prefix";
return NULL;
}
Node::Edges::iterator e = m_parent->edges_.find(m_label);
if (e == m_parent->edges_.end()) {
- ALOG2 << "Expected defined edge in parent";
+ VLOG(3) << "Expected defined edge in parent";
return NULL;
}
@@ -589,7 +574,7 @@ class GraphAdjuster : public AdjustmentMethod {
~GraphAdjuster() {}
bool Adjust(const AssemblyProgram& model, AssemblyProgram* program) {
- LOG(INFO) << "GraphAdjuster::Adjust";
+ VLOG(1) << "GraphAdjuster::Adjust";
prog_ = program;
model_ = &model;
debug_label_index_gen_ = 0;
diff --git a/courgette/adjustment_method_2.cc b/courgette/adjustment_method_2.cc
index 244b3a0..cdc5b97 100644
--- a/courgette/adjustment_method_2.cc
+++ b/courgette/adjustment_method_2.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,8 +12,6 @@
#include <string>
#include <vector>
-#include <iostream>
-
#include "base/basictypes.h"
#include "base/format_macros.h"
#include "base/logging.h"
@@ -153,31 +151,6 @@ low-scoring assignments in the approximation for large equivalence classes.
namespace courgette {
namespace adjustment_method_2 {
-// We have three discretionary information logging levels for algorithm
-// development. For now just configure with #defines.
-// TODO(sra): make dependent of some configurable setting.
-struct LogToCout {
- LogToCout() {}
- ~LogToCout() { std::cout << std::endl; }
- std::ostream& stream() { return std::cout; }
-};
-#define LOG_TO_COUT (LogToCout().stream())
-#define NO_LOG DLOG_IF(INFO, false)
-
-#if 0 // Log to log file.
-#define ALOG1 LOG(INFO)
-#define ALOG2 LOG(INFO)
-#define ALOG3 LOG(INFO)
-#elif 0 // Log to stdout.
-#define ALOG1 LOG_TO_COUT
-#define ALOG2 LOG_TO_COUT
-#define ALOG3 LOG_TO_COUT
-#else // Log to nowhere.
-#define ALOG1 NO_LOG
-#define ALOG2 NO_LOG
-#define ALOG3 NO_LOG
-#endif
-
////////////////////////////////////////////////////////////////////////////////
class AssignmentCandidates;
@@ -348,14 +321,14 @@ class AssignmentCandidates {
}
void Print(int max) {
- ALOG1 << "score " << TopScore() << " " << ToString(program_info_)
- << " := ?";
+ VLOG(2) << "score " << TopScore() << " " << ToString(program_info_)
+ << " := ?";
if (!pending_updates_.empty())
- ALOG1 << pending_updates_.size() << " pending";
+ VLOG(2) << pending_updates_.size() << " pending";
int count = 0;
for (Queue::iterator q = queue_.begin(); q != queue_.end(); ++q) {
if (++count > max) break;
- ALOG1 << " " << q->first << " " << ToString(q->second);
+ VLOG(2) << " " << q->first << " " << ToString(q->second);
}
}
@@ -828,8 +801,8 @@ class AssignmentProblem {
AssignmentProblem(const Trace& trace, size_t model_end)
: trace_(trace),
model_end_(model_end) {
- ALOG1 << "AssignmentProblem::AssignmentProblem " << model_end << ", "
- << trace.size();
+ VLOG(2) << "AssignmentProblem::AssignmentProblem " << model_end << ", "
+ << trace.size();
}
bool Solve() {
@@ -845,10 +818,8 @@ class AssignmentProblem {
AddPatternsNeedingUpdatesToQueues();
patterns_needing_updates_.clear();
- while (FindAndAssignBestLeader()) {
- NO_LOG << "Updated " << patterns_needing_updates_.size() << " patterns";
+ while (FindAndAssignBestLeader())
patterns_needing_updates_.clear();
- }
PrintActivePatterns();
return true;
@@ -874,11 +845,11 @@ class AssignmentProblem {
SingleUsePatternQueue;
void PrintPatternsHeader() const {
- ALOG1 << shingle_instances_.size() << " instances "
- << trace_.size() << " trace length "
- << patterns_.size() << " shingle indexes "
- << single_use_pattern_queue_.size() << " single use patterns "
- << active_non_single_use_patterns_.size() << " active patterns";
+ VLOG(2) << shingle_instances_.size() << " instances "
+ << trace_.size() << " trace length "
+ << patterns_.size() << " shingle indexes "
+ << single_use_pattern_queue_.size() << " single use patterns "
+ << active_non_single_use_patterns_.size() << " active patterns";
}
void PrintActivePatterns() const {
@@ -887,7 +858,7 @@ class AssignmentProblem {
p != active_non_single_use_patterns_.end();
++p) {
const ShinglePattern* pattern = *p;
- ALOG1 << ToString(pattern, 10);
+ VLOG(2) << ToString(pattern, 10);
}
}
@@ -902,7 +873,7 @@ class AssignmentProblem {
p != patterns_.end();
++p) {
const ShinglePattern& pattern = p->second;
- ALOG1 << ToString(&pattern, 10);
+ VLOG(2) << ToString(&pattern, 10);
}
}
@@ -911,7 +882,7 @@ class AssignmentProblem {
p != shingle_instances_.end();
++p) {
const Shingle& instance = *p;
- ALOG1 << ToString(&instance) << " " << ToString(instance.pattern());
+ VLOG(2) << ToString(&instance) << " " << ToString(instance.pattern());
}
}
@@ -1093,10 +1064,10 @@ class AssignmentProblem {
LabelInfo* model_info = model_instance->at(i);
if ((model_info->assignment_ == NULL) !=
(program_info->assignment_ == NULL)) {
- ALOG1 << "ERROR " << i
- << "\n\t" << ToString(pattern, 10)
- << "\n\t" << ToString(program_instance)
- << "\n\t" << ToString(model_instance);
+ VLOG(2) << "ERROR " << i
+ << "\n\t" << ToString(pattern, 10)
+ << "\n\t" << ToString(program_instance)
+ << "\n\t" << ToString(model_instance);
}
if (!program_info->assignment_ && !model_info->assignment_) {
sums[program_info][model_info] += score;
@@ -1139,8 +1110,8 @@ class AssignmentProblem {
LOG_ASSERT(model_info->is_model_);
LOG_ASSERT(!program_info->is_model_);
- ALOG2 << "Assign " << ToString(program_info)
- << " := " << ToString(model_info);
+ VLOG(3) << "Assign " << ToString(program_info)
+ << " := " << ToString(model_info);
ShingleSet affected_shingles;
AddAffectedPositions(model_info, &affected_shingles);
@@ -1254,7 +1225,7 @@ class Adjuster : public AdjustmentMethod {
~Adjuster() {}
bool Adjust(const AssemblyProgram& model, AssemblyProgram* program) {
- LOG(INFO) << "Adjuster::Adjust";
+ VLOG(1) << "Adjuster::Adjust";
prog_ = program;
model_ = &model;
return Finish();
@@ -1297,8 +1268,8 @@ class Adjuster : public AdjustmentMethod {
base::Time start_time = base::Time::Now();
AssignmentProblem a(model, model_end);
a.Solve();
- LOG(INFO) << " Adjuster::Solve "
- << (base::Time::Now() - start_time).InSecondsF();
+ VLOG(1) << " Adjuster::Solve "
+ << (base::Time::Now() - start_time).InSecondsF();
}
void ReferenceLabel(Trace* trace, Label* label, bool is_model) {
diff --git a/courgette/assembly_program.cc b/courgette/assembly_program.cc
index a0575a1..e160d767 100644
--- a/courgette/assembly_program.cc
+++ b/courgette/assembly_program.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -218,7 +218,7 @@ void AssemblyProgram::AssignRemainingIndexes(RVAToLabel* labels) {
}
}
- LOG(INFO) << used << " of " << labels->size() << " labels pre-assigned";
+ VLOG(1) << used << " of " << labels->size() << " labels pre-assigned";
// Are there any unused labels that happen to be adjacent following a used
// label?
@@ -282,10 +282,9 @@ void AssemblyProgram::AssignRemainingIndexes(RVAToLabel* labels) {
}
}
- LOG(INFO) << " fill"
- << " forward " << fill_forward_count << " "
- << " backward " << fill_backward_count << " "
- << " infill " << fill_infill_count;
+ VLOG(1) << " fill forward " << fill_forward_count
+ << " backward " << fill_backward_count
+ << " infill " << fill_infill_count;
}
typedef void (EncodedProgram::*DefineLabelMethod)(int index, RVA value);
diff --git a/courgette/disassembler.cc b/courgette/disassembler.cc
index 57831cd..b3b5577 100644
--- a/courgette/disassembler.cc
+++ b/courgette/disassembler.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -117,10 +117,10 @@ void DisassemblerWin32X86::ParseRel32RelocsFromSections() {
std::sort(rel32_locations_.begin(), rel32_locations_.end());
#if COURGETTE_HISTOGRAM_TARGETS
- LOG(INFO) << "abs32_locations_ " << abs32_locations_.size();
- LOG(INFO) << "rel32_locations_ " << rel32_locations_.size();
- LOG(INFO) << "abs32_target_rvas_ " << abs32_target_rvas_.size();
- LOG(INFO) << "rel32_target_rvas_ " << rel32_target_rvas_.size();
+ VLOG(1) << "abs32_locations_ " << abs32_locations_.size()
+ << "\nrel32_locations_ " << rel32_locations_.size()
+ << "\nabs32_target_rvas_ " << abs32_target_rvas_.size()
+ << "\nrel32_target_rvas_ " << rel32_target_rvas_.size();
int common = 0;
std::map<RVA, int>::iterator abs32_iter = abs32_target_rvas_.begin();
@@ -137,7 +137,7 @@ void DisassemblerWin32X86::ParseRel32RelocsFromSections() {
++rel32_iter;
}
}
- LOG(INFO) << "common " << common;
+ VLOG(1) << "common " << common;
#endif
}
diff --git a/courgette/encoded_program.cc b/courgette/encoded_program.cc
index 56290c77..4c84e05 100644
--- a/courgette/encoded_program.cc
+++ b/courgette/encoded_program.cc
@@ -233,16 +233,16 @@ void EncodedProgram::AddMakeRelocs() {
}
void EncodedProgram::DebuggingSummary() {
- LOG(INFO) << "EncodedProgram Summary";
- LOG(INFO) << " image base " << image_base_;
- LOG(INFO) << " abs32 rvas " << abs32_rva_.size();
- LOG(INFO) << " rel32 rvas " << rel32_rva_.size();
- LOG(INFO) << " ops " << ops_.size();
- LOG(INFO) << " origins " << origins_.size();
- LOG(INFO) << " copy_counts " << copy_counts_.size();
- LOG(INFO) << " copy_bytes " << copy_bytes_.size();
- LOG(INFO) << " abs32_ix " << abs32_ix_.size();
- LOG(INFO) << " rel32_ix " << rel32_ix_.size();
+ VLOG(1) << "EncodedProgram Summary"
+ << "\n image base " << image_base_
+ << "\n abs32 rvas " << abs32_rva_.size()
+ << "\n rel32 rvas " << rel32_rva_.size()
+ << "\n ops " << ops_.size()
+ << "\n origins " << origins_.size()
+ << "\n copy_counts " << copy_counts_.size()
+ << "\n copy_bytes " << copy_bytes_.size()
+ << "\n abs32_ix " << abs32_ix_.size()
+ << "\n rel32_ix " << rel32_ix_.size();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/courgette/ensemble_create.cc b/courgette/ensemble_create.cc
index 48126e4..b155106 100644
--- a/courgette/ensemble_create.cc
+++ b/courgette/ensemble_create.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -113,14 +113,14 @@ Status FindGenerators(Ensemble* old_ensemble, Ensemble* new_ensemble,
base::Time start_find_time = base::Time::Now();
old_ensemble->FindEmbeddedElements();
new_ensemble->FindEmbeddedElements();
- LOG(INFO) << "done FindEmbeddedElements "
- << (base::Time::Now() - start_find_time).InSecondsF();
+ VLOG(1) << "done FindEmbeddedElements "
+ << (base::Time::Now() - start_find_time).InSecondsF();
std::vector<Element*> old_elements(old_ensemble->elements());
std::vector<Element*> new_elements(new_ensemble->elements());
- LOG(INFO) << "old has " << old_elements.size() << " elements";
- LOG(INFO) << "new has " << new_elements.size() << " elements";
+ VLOG(1) << "old has " << old_elements.size() << " elements";
+ VLOG(1) << "new has " << new_elements.size() << " elements";
DifferenceEstimator difference_estimator;
std::vector<DifferenceEstimator::Base*> bases;
@@ -130,9 +130,8 @@ Status FindGenerators(Ensemble* old_ensemble, Ensemble* new_ensemble,
bases.push_back(
difference_estimator.MakeBase(old_elements[i]->region()));
}
- LOG(INFO) << "done make bases "
- << (base::Time::Now() - start_bases_time).InSecondsF()
- << "s";
+ VLOG(1) << "done make bases "
+ << (base::Time::Now() - start_bases_time).InSecondsF() << "s";
for (size_t new_index = 0; new_index < new_elements.size(); ++new_index) {
Element* new_element = new_elements[new_index];
@@ -165,14 +164,14 @@ Status FindGenerators(Ensemble* old_ensemble, Ensemble* new_ensemble,
DifferenceEstimator::Base* old_base = bases[old_index];
size_t difference = difference_estimator.Measure(old_base, new_subject);
- LOG(INFO) << "Compare " << old_element->Name()
- << " to " << new_element->Name()
- << " --> " << difference
- << " in " << (base::Time::Now() - start_compare).InSecondsF()
- << "s";
+ VLOG(1) << "Compare " << old_element->Name()
+ << " to " << new_element->Name()
+ << " --> " << difference
+ << " in " << (base::Time::Now() - start_compare).InSecondsF()
+ << "s";
if (difference == 0) {
- LOG(INFO) << "Skip " << new_element->Name()
- << " - identical to " << old_element->Name();
+ VLOG(1) << "Skip " << new_element->Name()
+ << " - identical to " << old_element->Name();
best_difference = 0;
best_old_element = NULL;
break;
@@ -184,9 +183,9 @@ Status FindGenerators(Ensemble* old_ensemble, Ensemble* new_ensemble,
}
if (best_old_element) {
- LOG(INFO) << "Matched " << best_old_element->Name()
- << " to " << new_element->Name()
- << " --> " << best_difference;
+ VLOG(1) << "Matched " << best_old_element->Name()
+ << " to " << new_element->Name()
+ << " --> " << best_difference;
TransformationPatchGenerator* generator =
MakeGenerator(best_old_element, new_element);
if (generator)
@@ -194,9 +193,9 @@ Status FindGenerators(Ensemble* old_ensemble, Ensemble* new_ensemble,
}
}
- LOG(INFO) << "done FindGenerators "
- << "found " << generators->size() << " in "
- << (base::Time::Now() - start_find_time).InSecondsF() << "s";
+ VLOG(1) << "done FindGenerators found " << generators->size()
+ << " in " << (base::Time::Now() - start_find_time).InSecondsF()
+ << "s";
return C_OK;
}
@@ -213,7 +212,7 @@ void FreeGenerators(std::vector<TransformationPatchGenerator*>* generators) {
Status GenerateEnsemblePatch(SourceStream* base,
SourceStream* update,
SinkStream* final_patch) {
- LOG(INFO) << "start GenerateEnsemblePatch";
+ VLOG(1) << "start GenerateEnsemblePatch";
base::Time start_time = base::Time::Now();
Region old_region(base->Buffer(), base->Remaining());
@@ -406,8 +405,8 @@ Status GenerateEnsemblePatch(SourceStream* base,
if (!patch_streams.CopyTo(final_patch))
return C_STREAM_ERROR;
- LOG(INFO) << "done GenerateEnsemblePatch "
- << (base::Time::Now() - start_time).InSecondsF() << "s";
+ VLOG(1) << "done GenerateEnsemblePatch "
+ << (base::Time::Now() - start_time).InSecondsF() << "s";
return C_OK;
}
diff --git a/courgette/simple_delta.cc b/courgette/simple_delta.cc
index 71038fd..37b910d 100644
--- a/courgette/simple_delta.cc
+++ b/courgette/simple_delta.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -33,8 +33,8 @@ Status ApplySimpleDelta(SourceStream* old, SourceStream* delta,
Status GenerateSimpleDelta(SourceStream* old, SourceStream* target,
SinkStream* delta) {
- LOG(INFO) << "GenerateSimpleDelta "
- << old->Remaining() << " " << target->Remaining();
+ VLOG(1) << "GenerateSimpleDelta " << old->Remaining()
+ << " " << target->Remaining();
return BSDiffStatusToStatus(CreateBinaryPatch(old, target, delta));
}
diff --git a/courgette/third_party/bsdiff_create.cc b/courgette/third_party/bsdiff_create.cc
index 6f93720..a06e862 100644
--- a/courgette/third_party/bsdiff_create.cc
+++ b/courgette/third_party/bsdiff_create.cc
@@ -203,7 +203,7 @@ BSDiffStatus CreateBinaryPatch(SourceStream* old_stream,
SinkStream* patch_stream)
{
base::Time start_bsdiff_time = base::Time::Now();
- LOG(INFO) << "Start bsdiff";
+ VLOG(1) << "Start bsdiff";
size_t initial_patch_stream_length = patch_stream->Length();
SinkStreamSet patch_streams;
@@ -236,8 +236,8 @@ BSDiffStatus CreateBinaryPatch(SourceStream* old_stream,
base::Time q_start_time = base::Time::Now();
qsufsort(I, V, old, oldsize);
- LOG(INFO) << " done qsufsort "
- << (base::Time::Now() - q_start_time).InSecondsF();
+ VLOG(1) << " done qsufsort "
+ << (base::Time::Now() - q_start_time).InSecondsF();
V.clear();
const uint8* newbuf = new_stream->Buffer();
@@ -398,9 +398,9 @@ BSDiffStatus CreateBinaryPatch(SourceStream* old_stream,
control_stream_seeks->WriteVarint32Signed(seek_adjustment);
++control_length;
#ifdef DEBUG_bsmedberg
- LOG(INFO) << StringPrintf(
- "Writing a block: copy: %-8u extra: %-8u seek: %+-9d",
- copy_count, extra_count, seek_adjustment);
+ VLOG(1) << StringPrintf("Writing a block: copy: %-8u extra: %-8u seek: "
+ "%+-9d", copy_count, extra_count,
+ seek_adjustment);
#endif
lastscan = scan - lenb; // Include the backward extension in seed.
@@ -427,17 +427,15 @@ BSDiffStatus CreateBinaryPatch(SourceStream* old_stream,
size_t diff_skips_length = diff_skips->Length();
patch_streams.CopyTo(patch_stream);
- LOG(INFO) << "Control tuples: " << control_length
- << " copy bytes: " << diff_bytes_length
- << " mistakes: " << diff_bytes_nonzero
- << " (skips: " << diff_skips_length << ")"
- << " extra bytes: " << extra_bytes_length;
-
- LOG(INFO) << "Uncompressed bsdiff patch size "
- << patch_stream->Length() - initial_patch_stream_length;
-
- LOG(INFO) << "End bsdiff "
- << (base::Time::Now() - start_bsdiff_time).InSecondsF();
+ VLOG(1) << "Control tuples: " << control_length
+ << " copy bytes: " << diff_bytes_length
+ << " mistakes: " << diff_bytes_nonzero
+ << " (skips: " << diff_skips_length << ")"
+ << " extra bytes: " << extra_bytes_length;
+ << "\nUncompressed bsdiff patch size "
+ << patch_stream->Length() - initial_patch_stream_length;
+ << "\nEnd bsdiff "
+ << (base::Time::Now() - start_bsdiff_time).InSecondsF();
return OK;
}