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

Side by Side Diff: delta_performer.cc

Issue 3119031: AU: clean up logs (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: Created 10 years, 4 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | subprocess.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "update_engine/delta_performer.h" 5 #include "update_engine/delta_performer.h"
6 #include <endian.h> 6 #include <endian.h>
7 #include <errno.h> 7 #include <errno.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <cstring> 9 #include <cstring>
10 #include <string> 10 #include <string>
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 ssize_t total_operations = manifest_.install_operations_size() + 186 ssize_t total_operations = manifest_.install_operations_size() +
187 manifest_.kernel_install_operations_size(); 187 manifest_.kernel_install_operations_size();
188 while (next_operation_num_ < total_operations) { 188 while (next_operation_num_ < total_operations) {
189 const DeltaArchiveManifest_InstallOperation &op = 189 const DeltaArchiveManifest_InstallOperation &op =
190 next_operation_num_ < manifest_.install_operations_size() ? 190 next_operation_num_ < manifest_.install_operations_size() ?
191 manifest_.install_operations(next_operation_num_) : 191 manifest_.install_operations(next_operation_num_) :
192 manifest_.kernel_install_operations( 192 manifest_.kernel_install_operations(
193 next_operation_num_ - manifest_.install_operations_size()); 193 next_operation_num_ - manifest_.install_operations_size());
194 if (!CanPerformInstallOperation(op)) 194 if (!CanPerformInstallOperation(op))
195 break; 195 break;
196 LOG(INFO) << "Performing operation " << next_operation_num_ << "/" 196 // Log every thousandth operation, and also the first and last ones
197 << total_operations; 197 if ((next_operation_num_ % 1000 == 0) ||
198 (next_operation_num_ + 1 == total_operations)) {
199 LOG(INFO) << "Performing operation " << (next_operation_num_ + 1) << "/"
200 << total_operations;
201 }
198 bool is_kernel_partition = 202 bool is_kernel_partition =
199 (next_operation_num_ >= manifest_.install_operations_size()); 203 (next_operation_num_ >= manifest_.install_operations_size());
200 if (op.type() == DeltaArchiveManifest_InstallOperation_Type_REPLACE || 204 if (op.type() == DeltaArchiveManifest_InstallOperation_Type_REPLACE ||
201 op.type() == DeltaArchiveManifest_InstallOperation_Type_REPLACE_BZ) { 205 op.type() == DeltaArchiveManifest_InstallOperation_Type_REPLACE_BZ) {
202 if (!PerformReplaceOperation(op, is_kernel_partition)) { 206 if (!PerformReplaceOperation(op, is_kernel_partition)) {
203 LOG(ERROR) << "Failed to perform replace operation " 207 LOG(ERROR) << "Failed to perform replace operation "
204 << next_operation_num_; 208 << next_operation_num_;
205 return -EINVAL; 209 return -EINVAL;
206 } 210 }
207 } else if (op.type() == DeltaArchiveManifest_InstallOperation_Type_MOVE) { 211 } else if (op.type() == DeltaArchiveManifest_InstallOperation_Type_MOVE) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 utils::PWriteAll(fd, &zeros[0], end_byte - begin_byte, begin_byte)); 429 utils::PWriteAll(fd, &zeros[0], end_byte - begin_byte, begin_byte));
426 } 430 }
427 431
428 // Update buffer. 432 // Update buffer.
429 buffer_offset_ += operation.data_length(); 433 buffer_offset_ += operation.data_length();
430 RemoveBufferHeadBytes(&buffer_, operation.data_length()); 434 RemoveBufferHeadBytes(&buffer_, operation.data_length());
431 return true; 435 return true;
432 } 436 }
433 437
434 } // namespace chromeos_update_engine 438 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « no previous file | subprocess.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698