Skip to content

Commit

Permalink
Log command name with GPU parse errors.
Browse files Browse the repository at this point in the history
This should make it easier to debug when there's an issue.

BUG=

Review URL: https://codereview.chromium.org/554783002

Cr-Commit-Position: refs/heads/master@{#293842}
  • Loading branch information
jbauman2 authored and Commit bot committed Sep 9, 2014
1 parent 4cd276b commit 834bb95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 4 additions & 7 deletions gpu/command_buffer/service/cmd_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ error::Error CommandParser::ProcessCommand() {

CommandHeader header = buffer_[get].value_header;
if (header.size == 0) {
DVLOG(1) << "Error: zero sized command in command buffer";
LOG(ERROR) << "Parse error: zero sized command in command buffer";
return error::kInvalidSize;
}

if (static_cast<int>(header.size) + get > entry_count_) {
DVLOG(1) << "Error: get offset out of bounds";
LOG(ERROR) << "Parse error: get offset out of bounds";
return error::kOutOfBounds;
}

Expand All @@ -66,9 +66,6 @@ error::Error CommandParser::ProcessCommand() {
error::Error result = handler_->DoCommand(
header.command, header.size - 1, buffer_ + get);

// TODO(gman): If you want to log errors this is the best place to catch them.
// It seems like we need an official way to turn on a debug mode and
// get these errors.
if (error::IsError(result)) {
ReportError(header.command, result);
}
Expand All @@ -82,8 +79,8 @@ error::Error CommandParser::ProcessCommand() {

void CommandParser::ReportError(unsigned int command_id,
error::Error result) {
DVLOG(1) << "Error: " << result << " for Command "
<< handler_->GetCommandName(command_id);
LOG(ERROR) << "Error: " << result << " for Command "
<< handler_->GetCommandName(command_id);
}

// Processes all the commands, while the buffer is not empty. Stop if an error
Expand Down
2 changes: 0 additions & 2 deletions gpu/command_buffer/service/gpu_scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ void GpuScheduler::PutChanged() {
command_buffer_->SetGetOffset(static_cast<int32>(parser_->get()));

if (error::IsError(error)) {
LOG(ERROR) << "[" << decoder_ << "] "
<< "GPU PARSE ERROR: " << error;
command_buffer_->SetContextLostReason(decoder_->GetContextLostReason());
command_buffer_->SetParseError(error);
break;
Expand Down

0 comments on commit 834bb95

Please sign in to comment.