summaryrefslogtreecommitdiffstats
path: root/tools/battor_agent
diff options
context:
space:
mode:
authorshess <shess@chromium.org>2016-01-22 09:56:12 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-22 17:58:27 +0000
commit07fbdfb23f9b20157776fe37fb504de60f960dc2 (patch)
treebbfa91b4ded36692ee7990f90a4eab6106f5bf29 /tools/battor_agent
parentfb588aec392fbb5e729b9c0b2c5eb97e7ffba4d1 (diff)
downloadchromium_src-07fbdfb23f9b20157776fe37fb504de60f960dc2.zip
chromium_src-07fbdfb23f9b20157776fe37fb504de60f960dc2.tar.gz
chromium_src-07fbdfb23f9b20157776fe37fb504de60f960dc2.tar.bz2
Revert of tools/battor_agent: Adds a tool to find connected BattOrs (patchset #3 id:40001 of https://codereview.chromium.org/1611533002/ )
Reason for revert: buildbot failure in Chromium GPU on Android Debug (Nexus 6) [918/3714] LINK battor_agent ... obj/tools/battor_agent/libbattor_agent_lib.a(obj/tools/battor_agent/battor_agent_lib.battor_finder.o):battor_finder.cc:function battor::BattOrFinder::FindBattOr(): error: undefined reference to 'device::SerialDeviceEnumerator::Create()' Original issue's description: > tools/battor_agent: Adds a tool to find connected BattOrs > > This tool will also be used by the Chromium trace controller to find > any connected BattOrs. > > BUG=542837 > > Committed: https://crrev.com/22f5284d4b0e007cb59effaefa7dbd82717eca79 > Cr-Commit-Position: refs/heads/master@{#370985} TBR=zhenw@chromium.org,nednguyen@google.com,sky@chromium.org,charliea@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=542837 Review URL: https://codereview.chromium.org/1623563002 Cr-Commit-Position: refs/heads/master@{#370992}
Diffstat (limited to 'tools/battor_agent')
-rw-r--r--tools/battor_agent/BUILD.gn2
-rw-r--r--tools/battor_agent/DEPS1
-rw-r--r--tools/battor_agent/battor_agent.gyp2
-rw-r--r--tools/battor_agent/battor_agent_bin.cc24
-rw-r--r--tools/battor_agent/battor_finder.cc39
-rw-r--r--tools/battor_agent/battor_finder.h23
6 files changed, 4 insertions, 87 deletions
diff --git a/tools/battor_agent/BUILD.gn b/tools/battor_agent/BUILD.gn
index 1a057f3..2f6dd28 100644
--- a/tools/battor_agent/BUILD.gn
+++ b/tools/battor_agent/BUILD.gn
@@ -28,8 +28,6 @@ source_set("battor_agent_lib") {
"battor_connection_impl.cc",
"battor_connection_impl.h",
"battor_error.h",
- "battor_finder.cc",
- "battor_finder.h",
"battor_sample_converter.cc",
"battor_sample_converter.h",
]
diff --git a/tools/battor_agent/DEPS b/tools/battor_agent/DEPS
index b40de52..67358f38 100644
--- a/tools/battor_agent/DEPS
+++ b/tools/battor_agent/DEPS
@@ -1,5 +1,4 @@
include_rules = [
"+device/serial",
- "+mojo/public",
"+net/base",
] \ No newline at end of file
diff --git a/tools/battor_agent/battor_agent.gyp b/tools/battor_agent/battor_agent.gyp
index c34c5cd..051f66d 100644
--- a/tools/battor_agent/battor_agent.gyp
+++ b/tools/battor_agent/battor_agent.gyp
@@ -35,8 +35,6 @@
'battor_connection_impl.cc',
'battor_connection_impl.h',
'battor_error.h',
- 'battor_finder.cc',
- 'battor_finder.h',
'battor_sample_converter.cc',
'battor_sample_converter.h',
],
diff --git a/tools/battor_agent/battor_agent_bin.cc b/tools/battor_agent/battor_agent_bin.cc
index 93036e2..360146d 100644
--- a/tools/battor_agent/battor_agent_bin.cc
+++ b/tools/battor_agent/battor_agent_bin.cc
@@ -19,7 +19,6 @@
#include "base/threading/thread.h"
#include "tools/battor_agent/battor_agent.h"
#include "tools/battor_agent/battor_error.h"
-#include "tools/battor_agent/battor_finder.h"
using std::cout;
using std::endl;
@@ -48,11 +47,12 @@ void PrintSupportsExplicitClockSync() {
cout << battor::BattOrAgent::SupportsExplicitClockSync() << endl;
}
-// Retrieves argument argnum from the argument list, or an empty string if the
-// argument doesn't exist.
+// Retrieves argument argnum from the argument list, printing the usage
+// guidelines and exiting with an error code if the argument doesn't exist.
std::string GetArg(int argnum, int argc, char* argv[]) {
if (argnum >= argc) {
- return std::string();
+ PrintUsage();
+ exit(1);
}
return argv[argnum];
@@ -89,10 +89,6 @@ class BattOrAgentBin : public BattOrAgent::Listener {
// Runs the BattOr binary and returns the exit code.
int Run(int argc, char* argv[]) {
std::string cmd = GetArg(1, argc, argv);
- if (cmd.empty()) {
- PrintUsage();
- exit(1);
- }
// SupportsExplicitClockSync doesn't need to use the serial connection, so
// handle it separately.
@@ -102,18 +98,6 @@ class BattOrAgentBin : public BattOrAgent::Listener {
}
std::string path = GetArg(2, argc, argv);
- // If no path is specified, see if we can find a BattOr and use that.
- if (path.empty())
- path = BattOrFinder::FindBattOr();
-
- // If we don't have any BattOr to use, exit.
- if (path.empty()) {
- cout << "Unable to find a BattOr, and no explicit BattOr path was "
- "specified."
- << endl;
- exit(1);
- }
-
SetUp(path);
if (cmd == "StartTracing") {
diff --git a/tools/battor_agent/battor_finder.cc b/tools/battor_agent/battor_finder.cc
deleted file mode 100644
index b0e32db..0000000
--- a/tools/battor_agent/battor_finder.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "tools/battor_agent/battor_finder.h"
-
-#include "device/serial/serial.mojom.h"
-#include "device/serial/serial_device_enumerator.h"
-#include "mojo/public/cpp/bindings/array.h"
-
-namespace battor {
-
-namespace {
-
-// The USB display name prefix that all BattOrs have.
-const char kBattOrDisplayNamePrefix[] = "BattOr";
-
-} // namespace
-
-// Returns the path of the first BattOr that we find.
-std::string BattOrFinder::FindBattOr() {
- scoped_ptr<device::SerialDeviceEnumerator> serial_device_enumerator =
- device::SerialDeviceEnumerator::Create();
-
- mojo::Array<device::serial::DeviceInfoPtr> devices =
- serial_device_enumerator->GetDevices();
-
- for (size_t i = 0; i < devices.size(); i++) {
- std::string display_name = devices[i]->display_name.get();
-
- if (display_name.find(kBattOrDisplayNamePrefix) != std::string::npos) {
- return devices[i]->path;
- }
- }
-
- return std::string();
-}
-
-} // namespace battor
diff --git a/tools/battor_agent/battor_finder.h b/tools/battor_agent/battor_finder.h
deleted file mode 100644
index fe6fa79..0000000
--- a/tools/battor_agent/battor_finder.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef TOOLS_BATTOR_AGENT_BATTOR_FINDER_H_
-#define TOOLS_BATTOR_AGENT_BATTOR_FINDER_H_
-
-#include <string>
-
-#include "base/macros.h"
-
-namespace battor {
-
-class BattOrFinder {
- public:
- static std::string FindBattOr();
-
- DISALLOW_COPY_AND_ASSIGN(BattOrFinder);
-};
-
-} // namespace battor
-
-#endif // TOOLS_BATTOR_AGENT_BATTOR_FINDER_H_