[EFL][GTK] Script process-linux-coredump is not needed, switch back to use the kernel...
authorclopez@igalia.com <clopez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2016 17:26:22 +0000 (17:26 +0000)
committerclopez@igalia.com <clopez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2016 17:26:22 +0000 (17:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=160927

Reviewed by Daniel Bates.

* Scripts/process-linux-coredump: Removed.
* Scripts/webkitpy/port/efl.py:
(EflPort._get_crash_log):
* Scripts/webkitpy/port/gtk.py:
(GtkPort._get_crash_log):
* Scripts/webkitpy/port/linux_get_crash_log.py:
(GDBCrashLogGenerator.__init__):
(GDBCrashLogGenerator.generate_crash_log):
* Scripts/webkitpy/port/linux_get_crash_log_unittest.py:
(GDBCrashLogGeneratorTest.test_generate_crash_log):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204727 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/process-linux-coredump [deleted file]
Tools/Scripts/webkitpy/port/efl.py
Tools/Scripts/webkitpy/port/gtk.py
Tools/Scripts/webkitpy/port/linux_get_crash_log.py
Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py

index 322685a..5e7c235 100644 (file)
@@ -1,3 +1,21 @@
+2016-08-22  Carlos Alberto Lopez Perez  <clopez@igalia.com>
+
+        [EFL][GTK] Script process-linux-coredump is not needed, switch back to use the kernel core dumper instead.
+        https://bugs.webkit.org/show_bug.cgi?id=160927
+
+        Reviewed by Daniel Bates.
+
+        * Scripts/process-linux-coredump: Removed.
+        * Scripts/webkitpy/port/efl.py:
+        (EflPort._get_crash_log):
+        * Scripts/webkitpy/port/gtk.py:
+        (GtkPort._get_crash_log):
+        * Scripts/webkitpy/port/linux_get_crash_log.py:
+        (GDBCrashLogGenerator.__init__):
+        (GDBCrashLogGenerator.generate_crash_log):
+        * Scripts/webkitpy/port/linux_get_crash_log_unittest.py:
+        (GDBCrashLogGeneratorTest.test_generate_crash_log):
+
 2016-08-22  Jonathan Bedard  <jbedard@apple.com>
 
         check-webkit-style does not work with Lambda functions in C++
diff --git a/Tools/Scripts/process-linux-coredump b/Tools/Scripts/process-linux-coredump
deleted file mode 100755 (executable)
index 0588551..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2016 Igalia S.L.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-import os
-import sys
-
-# This script is meant to be invoked by the kernel's core_pattern hook. It
-# takes one argument on command-line: the full path of the coredump file to
-# which the coredump data should be saved.
-
-def main(full_path):
-    coredump = open(full_path, 'wb')
-    while True:
-        data = sys.stdin.read()
-        if not data:
-            break
-        coredump.write(data)
-    coredump.close()
-    return 0
-
-if __name__ == '__main__':
-    sys.exit(main(*sys.argv[1:]))
index 556e329..6a3ca33 100644 (file)
@@ -142,7 +142,7 @@ class EflPort(Port):
         return command
 
     def _get_crash_log(self, name, pid, stdout, stderr, newer_than):
-        return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self.path_to_script("process-linux-coredump"), self._path_to_driver).generate_crash_log(stdout, stderr)
+        return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self._path_to_driver).generate_crash_log(stdout, stderr)
 
     def test_expectations_file_position(self):
         # EFL port baseline search path is efl -> wk2 -> generic (as efl-wk2 and efl baselines are merged), so port test expectations file is at third to last position.
index 0333280..3d80a0b 100644 (file)
@@ -216,7 +216,7 @@ class GtkPort(Port):
 
     def _get_crash_log(self, name, pid, stdout, stderr, newer_than):
         name = "WebKitWebProcess" if name == "WebProcess" else name
-        return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self.path_to_script("process-linux-coredump"), self._path_to_driver).generate_crash_log(stdout, stderr)
+        return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self._path_to_driver).generate_crash_log(stdout, stderr)
 
     def test_expectations_file_position(self):
         # GTK port baseline search path is gtk -> wk2 -> generic (as gtk-wk2 and gtk baselines are merged), so port test expectations file is at third to last position.
index 30b8ea4..c5e620c 100644 (file)
@@ -31,16 +31,15 @@ import subprocess
 import os
 
 class GDBCrashLogGenerator(object):
-    def __init__(self, name, pid, newer_than, filesystem, process_coredump_script_path, path_to_driver):
+    def __init__(self, name, pid, newer_than, filesystem, path_to_driver):
         self.name = name
         self.pid = pid
         self.newer_than = newer_than
         self._filesystem = filesystem
-        self._process_coredump_script_path = process_coredump_script_path
         self._path_to_driver = path_to_driver
 
     def _get_gdb_output(self, coredump_path):
-        process_name = os.path.join(os.path.dirname(str(self._path_to_driver())), self.name)
+        process_name = self._filesystem.join(os.path.dirname(str(self._path_to_driver())), self.name)
         cmd = ['gdb', '-ex', 'thread apply all bt 1024', '--batch', process_name, coredump_path]
         proc = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
         stdout, stderr = proc.communicate()
@@ -78,11 +77,11 @@ class GDBCrashLogGenerator(object):
         if not crash_log:
             if not log_directory:
                 log_directory = "/path/to/coredumps"
-            process_coredump_script_path = self._process_coredump_script_path
+            core_pattern = self._filesystem.join(log_directory, "core-pid_%p.dump")
             crash_log = """\
 Coredump %(expected_crash_dump_filename)s not found. To enable crash logs:
 
-- run this command as super-user: echo "|%(process_coredump_script_path)s %(log_directory)s/core-pid_%%p.dump" > /proc/sys/kernel/core_pattern
+- run this command as super-user: echo "%(core_pattern)s" > /proc/sys/kernel/core_pattern
 - enable core dumps: ulimit -c unlimited
 - set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=%(log_directory)s
 
index d3ba52a..cbd431a 100644 (file)
@@ -41,11 +41,10 @@ class GDBCrashLogGeneratorTest(unittest.TestCase):
         if sys.platform.startswith('win'):
             return
 
-        process_coredump_script_path = "/path/to/coredump-processor"
-        generator = GDBCrashLogGenerator('DumpRenderTree', 28529, newer_than=None, filesystem=MockFileSystem({'/path/to/coredumps': ''}), process_coredump_script_path=process_coredump_script_path, path_to_driver=None)
+        generator = GDBCrashLogGenerator('DumpRenderTree', 28529, newer_than=None, filesystem=MockFileSystem({'/path/to/coredumps': ''}), path_to_driver=None)
 
         core_directory = os.environ.get('WEBKIT_CORE_DUMPS_DIRECTORY', '/path/to/coredumps')
-        core_pattern = "|%s %s/core-pid_%%p.dump" % (process_coredump_script_path, core_directory)
+        core_pattern = generator._filesystem.join(core_directory, "core-pid_%p.dump")
         mock_empty_crash_log = """\
 crash log for DumpRenderTree (pid 28529):