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

Unified Diff: tools/telemetry/third_party/pyserial/serial/tools/list_ports_linux.py

Issue 325663002: [PowerProfiler] pySerial module serial.tools.list_ports for linux should include the product inform… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing! Created 6 years, 6 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/telemetry/third_party/pyserial/linux-product_info.patch ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/third_party/pyserial/serial/tools/list_ports_linux.py
diff --git a/tools/telemetry/third_party/pyserial/serial/tools/list_ports_linux.py b/tools/telemetry/third_party/pyserial/serial/tools/list_ports_linux.py
index eb315d47d01b8ce43399040836fe2a014cdc3ed1..ecfd158bab7862a50de2120654ccc3022dc8c348 100755
--- a/tools/telemetry/third_party/pyserial/serial/tools/list_ports_linux.py
+++ b/tools/telemetry/third_party/pyserial/serial/tools/list_ports_linux.py
@@ -110,6 +110,14 @@ def describe(device):
sys_dev_path = '/sys/class/tty/%s/device/interface' % (base,)
if os.path.exists(sys_dev_path):
return read_line(sys_dev_path)
+
+ # USB Product Information
+ sys_dev_path = '/sys/class/tty/%s/device' % (base,)
+ if os.path.exists(sys_dev_path):
+ product_name_file = os.path.dirname(os.path.realpath(sys_dev_path)) + "/product"
+ if os.path.exists(product_name_file):
+ return read_line(product_name_file)
+
return base
def hwinfo(device):
« no previous file with comments | « tools/telemetry/third_party/pyserial/linux-product_info.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698