Title: [204727] trunk/Tools
Revision
204727
Author
clo...@igalia.com
Date
2016-08-22 10:26:22 -0700 (Mon, 22 Aug 2016)

Log Message

[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):

Modified Paths

Removed Paths

Diff

Modified: trunk/Tools/ChangeLog (204726 => 204727)


--- trunk/Tools/ChangeLog	2016-08-22 17:23:39 UTC (rev 204726)
+++ trunk/Tools/ChangeLog	2016-08-22 17:26:22 UTC (rev 204727)
@@ -1,3 +1,21 @@
+2016-08-22  Carlos Alberto Lopez Perez  <clo...@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  <jbed...@apple.com>
 
         check-webkit-style does not work with Lambda functions in C++

Deleted: trunk/Tools/Scripts/process-linux-coredump (204726 => 204727)


--- trunk/Tools/Scripts/process-linux-coredump	2016-08-22 17:23:39 UTC (rev 204726)
+++ trunk/Tools/Scripts/process-linux-coredump	2016-08-22 17:26:22 UTC (rev 204727)
@@ -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 = ""
-        if not data:
-            break
-        coredump.write(data)
-    coredump.close()
-    return 0
-
-if __name__ == '__main__':
-    sys.exit(main(*sys.argv[1:]))

Modified: trunk/Tools/Scripts/webkitpy/port/efl.py (204726 => 204727)


--- trunk/Tools/Scripts/webkitpy/port/efl.py	2016-08-22 17:23:39 UTC (rev 204726)
+++ trunk/Tools/Scripts/webkitpy/port/efl.py	2016-08-22 17:26:22 UTC (rev 204727)
@@ -142,7 +142,7 @@
         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.

Modified: trunk/Tools/Scripts/webkitpy/port/gtk.py (204726 => 204727)


--- trunk/Tools/Scripts/webkitpy/port/gtk.py	2016-08-22 17:23:39 UTC (rev 204726)
+++ trunk/Tools/Scripts/webkitpy/port/gtk.py	2016-08-22 17:26:22 UTC (rev 204727)
@@ -216,7 +216,7 @@
 
     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.

Modified: trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log.py (204726 => 204727)


--- trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log.py	2016-08-22 17:23:39 UTC (rev 204726)
+++ trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log.py	2016-08-22 17:26:22 UTC (rev 204727)
@@ -31,16 +31,15 @@
 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 @@
         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
 

Modified: trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py (204726 => 204727)


--- trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py	2016-08-22 17:23:39 UTC (rev 204726)
+++ trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py	2016-08-22 17:26:22 UTC (rev 204727)
@@ -41,11 +41,10 @@
         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):
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to