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

Unified Diff: tools/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py

Issue 1254843002: telemetry: Fix killing the perf profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 5 years, 5 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/telemetry/internal/platform/profiler/perf_profiler.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py
diff --git a/tools/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py b/tools/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py
index e63124afddfabd87acd2dee0f079b19b7c0edc74..b9039b4909881b265dc88a302b2315ae5330361b 100644
--- a/tools/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py
+++ b/tools/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py
@@ -41,7 +41,11 @@ class _TCPDumpProfilerAndroid(object):
raise Exception('Unable to find TCPDump. Check your device is rooted '
'and tcpdump is installed at ' +
android_prebuilt_profiler_helper.GetDevicePath('tcpdump'))
- tcpdump_pid = int(tcpdump_pid['tcpdump'])
+ if len(tcpdump_pid['tcpdump']) > 1:
+ raise Exception(
+ 'At most one instance of process tcpdump expected but found pids: '
+ '%s' % tcpdump_pid)
+ tcpdump_pid = int(tcpdump_pid['tcpdump'][0])
self._device.RunShellCommand('kill -term ' + tcpdump_pid)
self._proc.terminate()
host_dump = os.path.join(self._output_path,
« no previous file with comments | « tools/telemetry/telemetry/internal/platform/profiler/perf_profiler.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698