Chromium Code Reviews| Index: tools/battor_agent/battor_agent.cc |
| diff --git a/tools/battor_agent/battor_agent.cc b/tools/battor_agent/battor_agent.cc |
| index dc5a521a6f6abf591ac728d47be537568fc9e649..5f18c7bdf072f05343f67cdf8be160e1344ded42 100644 |
| --- a/tools/battor_agent/battor_agent.cc |
| +++ b/tools/battor_agent/battor_agent.cc |
| @@ -246,6 +246,9 @@ void BattOrAgent::OnBytesSent(bool success) { |
| num_read_attempts_ = 1; |
| PerformAction(Action::READ_GIT_HASH); |
| return; |
| + case Action::RESET: |
| + CompleteCommand(BATTOR_ERROR_NONE); |
| + return; |
| default: |
| CompleteCommand(BATTOR_ERROR_UNEXPECTED_MESSAGE); |
| } |
| @@ -406,7 +409,8 @@ void BattOrAgent::OnMessageRead(bool success, |
| // Check for the empty frame the BattOr uses to indicate it's done |
| // streaming samples. |
| if (frame.empty()) { |
| - CompleteCommand(BATTOR_ERROR_NONE); |
| + // Proactively reset the BattOr to speed up the next trace. |
|
charliea (OOO until 10-5)
2017/05/09 19:19:06
I think this could be made clearer: for people stu
aschulman
2017/05/12 22:32:03
agreed. I will do this as best as I can.
|
| + PerformAction(Action::RESET); |
| return; |
| } |
| @@ -536,6 +540,10 @@ void BattOrAgent::PerformAction(Action action) { |
| connection_->ReadMessage(BATTOR_MESSAGE_TYPE_CONTROL_ACK); |
| return; |
| + case Action::RESET: |
| + SendControlMessage(BATTOR_CONTROL_MESSAGE_TYPE_RESET, 0, 0); |
| + return; |
| + |
| case Action::INVALID: |
| NOTREACHED(); |
| } |