Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2549)

Unified Diff: delta_diff_generator.cc

Issue 4499003: AU: reduce logging when generating delta update (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | topological_sort.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: delta_diff_generator.cc
diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc
index b2d4c69025746af126cedc8aa326ca6808ed45ed..1344c348de26f9f2017e10dee109075306b8c6b4 100644
--- a/delta_diff_generator.cc
+++ b/delta_diff_generator.cc
@@ -111,8 +111,6 @@ bool AddInstallOpToBlocksVector(
vector<Block>* blocks,
const Graph& graph,
Vertex::Index vertex) {
- LOG(INFO) << "AddInstallOpToBlocksVector(" << vertex << "), "
- << graph[vertex].file_name;
// See if this is already present.
TEST_AND_RETURN_FALSE(operation.dst_extents_size() > 0);
@@ -135,7 +133,6 @@ bool AddInstallOpToBlocksVector(
}
for (uint64_t block = extent.start_block();
block < (extent.start_block() + extent.num_blocks()); block++) {
- LOG(INFO) << "ext: " << i << " block: " << block;
if ((*blocks)[block].*access_type != Vertex::kInvalidIndex) {
LOG(FATAL) << "Block " << block << " is already "
<< past_participle << " by "
@@ -323,6 +320,7 @@ bool ReadUnwrittenBlocks(const vector<Block>& blocks,
for (vector<Extent>::const_iterator it = extents.begin();
it != extents.end(); ++it) {
vector<Block>::size_type blocks_read = 0;
+ float printed_progress = -1;
while (blocks_read < it->num_blocks()) {
const int copy_block_cnt =
min(buf.size() / kBlockSize,
@@ -339,7 +337,13 @@ bool ReadUnwrittenBlocks(const vector<Block>& blocks,
TEST_AND_RETURN_FALSE(err == BZ_OK);
blocks_read += copy_block_cnt;
blocks_copied_count += copy_block_cnt;
- LOG(INFO) << "progress: " << ((float)blocks_copied_count)/block_count;
+ float current_progress =
+ static_cast<float>(blocks_copied_count) / block_count;
+ if (printed_progress + 0.1 < current_progress ||
+ blocks_copied_count == block_count) {
+ LOG(INFO) << "progress: " << current_progress;
+ printed_progress = current_progress;
+ }
}
}
BZ2_bzWriteClose(&err, bz_file, 0, NULL, NULL);
@@ -747,9 +751,6 @@ bool DeltaDiffGenerator::CutEdges(Graph* graph,
(*graph)[it->first].out_edges[it->second].extents;
// Choose some scratch space
scratch_blocks_used += graph_utils::EdgeWeight(*graph, *it);
- LOG(INFO) << "using " << graph_utils::EdgeWeight(*graph, *it)
- << " scratch blocks ("
- << scratch_blocks_used << ")";
cuts.back().tmp_extents =
scratch_allocator.Allocate(graph_utils::EdgeWeight(*graph, *it));
// create vertex to copy original->scratch
@@ -993,17 +994,13 @@ bool AssignBlockForAdjoiningCuts(
blocks_needed += cut_blocks_needed;
cuts_blocks_needed[&*it] = cut_blocks_needed;
}
- LOG(INFO) << "Need to find " << blocks_needed << " blocks for "
- << cuts.size() << " cuts";
-
+
// Find enough blocks
ExtentRanges scratch_ranges;
// Each block that's supplying temp blocks and the corresponding blocks:
typedef vector<pair<Vertex::Index, ExtentRanges> > SupplierVector;
SupplierVector block_suppliers;
uint64_t scratch_blocks_found = 0;
- LOG(INFO) << "scan from " << (*reverse_op_indexes)[old_dst] + 1
- << " to " << op_indexes->size();
for (vector<Vertex::Index>::size_type i = (*reverse_op_indexes)[old_dst] + 1,
e = op_indexes->size(); i < e; ++i) {
Vertex::Index test_node = (*op_indexes)[i];
@@ -1036,8 +1033,6 @@ bool AssignBlockForAdjoiningCuts(
scratch_ranges.AddRanges(ranges);
block_suppliers.push_back(make_pair(test_node, ranges));
scratch_blocks_found += ranges.blocks();
- LOG(INFO) << "Adding " << ranges.blocks() << " blocks. Now have "
- << scratch_ranges.blocks();
if (scratch_ranges.blocks() >= blocks_needed)
break;
}
@@ -1084,7 +1079,6 @@ bool AssignBlockForAdjoiningCuts(
op->clear_dst_extents();
DeltaDiffGenerator::StoreExtents(real_extents, op->mutable_dst_extents());
}
- LOG(INFO) << "Done subbing in for cut set";
return true;
}
« no previous file with comments | « no previous file | topological_sort.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698