Modified: trunk/Tools/Scripts/webkitpy/port/darwin.py (245823 => 245824)
--- trunk/Tools/Scripts/webkitpy/port/darwin.py 2019-05-28 21:02:38 UTC (rev 245823)
+++ trunk/Tools/Scripts/webkitpy/port/darwin.py 2019-05-28 21:04:44 UTC (rev 245824)
@@ -160,20 +160,33 @@
def sample_process(self, name, pid, target_host=None):
host = target_host or self.host
tempdir = host.filesystem.mkdtemp()
+ temp_tailspin_file_path = host.filesystem.join(str(tempdir), "{0}-{1}-tailspin-temp.txt".format(name, pid))
command = [
- '/usr/sbin/spindump',
- pid,
- 10,
- 10,
- '-file',
- DarwinPort.spindump_file_path(host, name, pid, str(tempdir)),
+ '/usr/bin/tailspin',
+ 'save',
+ '-n',
+ temp_tailspin_file_path,
]
if host.platform.is_mac():
command = ['/usr/bin/sudo', '-n'] + command
+
exit_status = host.executive.run_command(command, return_exit_code=True)
- if exit_status:
+ if not exit_status: # Symbolicate tailspin log using spindump
try:
host.executive.run_command([
+ '/usr/sbin/spindump',
+ '-i',
+ temp_tailspin_file_path,
+ '-file',
+ DarwinPort.tailspin_file_path(host, name, pid, str(tempdir)),
+ ])
+ host.filesystem.move_to_base_host(DarwinPort.tailspin_file_path(host, name, pid, str(tempdir)),
+ DarwinPort.tailspin_file_path(self.host, name, pid, self.results_directory()))
+ except IOError as e:
+ _log.warning('Unable to symbolicate tailspin log of process:' + str(e))
+ else: # Tailspin failed, run sample instead
+ try:
+ host.executive.run_command([
'/usr/bin/sample',
pid,
10,
@@ -185,9 +198,6 @@
DarwinPort.sample_file_path(self.host, name, pid, self.results_directory()))
except ScriptError as e:
_log.warning('Unable to sample process:' + str(e))
- else:
- host.filesystem.move_to_base_host(DarwinPort.spindump_file_path(host, name, pid, str(tempdir)),
- DarwinPort.spindump_file_path(self.host, name, pid, self.results_directory()))
host.filesystem.rmtree(str(tempdir))
@staticmethod
@@ -195,8 +205,8 @@
return host.filesystem.join(directory, "{0}-{1}-sample.txt".format(name, pid))
@staticmethod
- def spindump_file_path(host, name, pid, directory):
- return host.filesystem.join(directory, "{0}-{1}-spindump.txt".format(name, pid))
+ def tailspin_file_path(host, name, pid, directory):
+ return host.filesystem.join(directory, "{0}-{1}-tailspin.txt".format(name, pid))
def look_for_new_samples(self, unresponsive_processes, start_time):
sample_files = {}
Modified: trunk/Tools/Scripts/webkitpy/port/darwin_testcase.py (245823 => 245824)
--- trunk/Tools/Scripts/webkitpy/port/darwin_testcase.py 2019-05-28 21:02:38 UTC (rev 245823)
+++ trunk/Tools/Scripts/webkitpy/port/darwin_testcase.py 2019-05-28 21:04:44 UTC (rev 245824)
@@ -98,18 +98,20 @@
port = self.make_port(host)
self.assertEqual(port.path_to_crash_logs(), '/Users/mock/Library/Logs/DiagnosticReports')
- def test_spindump(self):
+ def test_tailspin(self):
def logging_run_command(args):
print(args)
port = self.make_port()
- port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt'] = 'Spindump file'
+ port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin-temp.txt'] = 'Temporary tailspin output file'
+ port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin.txt'] = 'Symbolocated tailspin file'
port.host.executive = MockExecutive2(run_command_fn=logging_run_command)
- expected_stdout = "['/usr/bin/sudo', '-n', '/usr/sbin/spindump', 42, 10, 10, '-file', '/__im_tmp/tmp_0_/test-42-spindump.txt']\n"
+ expected_stdout = "['/usr/bin/sudo', '-n', '/usr/bin/tailspin', 'save', '-n', '/__im_tmp/tmp_0_/test-42-tailspin-temp.txt']\n['/usr/sbin/spindump', '-i', '/__im_tmp/tmp_0_/test-42-tailspin-temp.txt', '-file', '/__im_tmp/tmp_0_/test-42-tailspin.txt']\n"
OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42], expected_stdout=expected_stdout)
- self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-spindump.txt'], 'Spindump file')
- self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt'])
+ self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-tailspin.txt'], 'Symbolocated tailspin file')
+ self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin-temp.txt'])
+ self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin.txt'])
def test_sample_process(self):
Modified: trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py (245823 => 245824)
--- trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py 2019-05-28 21:02:38 UTC (rev 245823)
+++ trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py 2019-05-28 21:04:44 UTC (rev 245824)
@@ -45,21 +45,23 @@
with self.assertRaises(RuntimeError):
port.path_to_crash_logs()
- def test_spindump(self):
+ def test_tailspin(self):
def logging_run_command(args):
print(args)
port = self.make_port()
- port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt'] = 'Spindump file'
+ port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin-temp.txt'] = 'Temporary tailspin output file'
+ port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin.txt'] = 'Symbolocated tailspin file'
port.host.executive = MockExecutive2(run_command_fn=logging_run_command)
- expected_stdout = "['/usr/sbin/spindump', 42, 10, 10, '-file', '/__im_tmp/tmp_0_/test-42-spindump.txt']\n"
+ expected_stdout = "['/usr/bin/tailspin', 'save', '-n', '/__im_tmp/tmp_0_/test-42-tailspin-temp.txt']\n['/usr/sbin/spindump', '-i', '/__im_tmp/tmp_0_/test-42-tailspin-temp.txt', '-file', '/__im_tmp/tmp_0_/test-42-tailspin.txt']\n"
OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42], expected_stdout=expected_stdout)
- self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-spindump.txt'], 'Spindump file')
- self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt'])
+ self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-tailspin.txt'], 'Symbolocated tailspin file')
+ self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin-temp.txt'])
+ self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-tailspin.txt'])
def test_sample_process(self):
def logging_run_command(args):
- if args[0] == '/usr/sbin/spindump':
+ if args[0] == '/usr/bin/tailspin':
return 1
print(args)
return 0
@@ -74,7 +76,7 @@
def test_sample_process_exception(self):
def throwing_run_command(args):
- if args[0] == '/usr/sbin/spindump':
+ if args[0] == '/usr/bin/tailspin':
return 1
raise ScriptError('MOCK script error')