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

Unified Diff: tools/battor_agent/battor_agent.cc

Issue 2859353003: [BattOr] Reduce StartTracing time by about four seconds.
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/battor_agent/battor_agent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « tools/battor_agent/battor_agent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698