Changeset 153721 in webkit
- Timestamp:
- Aug 5, 2013, 1:26:29 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r153651 r153721 1 2013-08-05 Brian Holt <brian.holt@samsung.com> 2 3 [GTK] Implement leak checking with valgrind 4 https://bugs.webkit.org/show_bug.cgi?id=118785 5 6 Reviewed by Dirk Pranke. 7 8 Launch the DRT under Valgrind to generate xml files with details 9 of leaks found. 10 11 * Scripts/webkitpy/layout_tests/run_webkit_tests.py: 12 (parse_args): 13 * Scripts/webkitpy/port/gtk.py: 14 (GtkPort.__init__): 15 (GtkPort.default_timeout_ms): Allow extra time to run under 16 Valgrind. 17 (GtkPort.setup_environ_for_server): Pass Valgrind instructions 18 using environment variables. 19 1 20 2013-08-02 Mario Sanchez Prada <mario.prada@samsung.com> 2 21 -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
r151462 r153721 111 111 help="Use the complex text code path for all text (Mac OS X and Windows only)"), 112 112 optparse.make_option("-l", "--leaks", action="store_true", default=False, 113 help="Enable leaks checking (Mac OS X only)"),113 help="Enable leaks checking (Mac OS X and Gtk+ only)"), 114 114 optparse.make_option("-g", "--guard-malloc", action="store_true", default=False, 115 115 help="Enable Guard Malloc (Mac OS X only)"), -
trunk/Tools/Scripts/webkitpy/port/gtk.py
r153439 r153721 1 1 # Copyright (C) 2010 Google Inc. All rights reserved. 2 # Copyright (C) 2013 Samsung Electronics. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 29 30 import os 30 31 import subprocess 32 import uuid 31 33 32 34 from webkitpy.common.memoized import memoized … … 45 47 self._pulseaudio_sanitizer = PulseAudioSanitizer() 46 48 49 if self.get_option("leaks"): 50 if not self.get_option("wrapper"): 51 raise ValueError('use --wrapper=\"valgrind\" for memory leak detection on GTK') 52 47 53 def warn_if_bug_missing_in_test_expectations(self): 48 54 return not self.get_option('webkit_test_runner') … … 58 64 59 65 def default_timeout_ms(self): 66 # Starting an application under Valgrind takes a lot longer than normal 67 # so increase the timeout (empirically 10x is enough to avoid timeouts). 68 multiplier = 10 if self.get_option("leaks") else 1 60 69 if self.get_option('configuration') == 'Debug': 61 return 12 * 100062 return 6 * 100070 return multiplier * 12 * 1000 71 return multiplier * 6 * 1000 63 72 64 73 def setup_test_run(self): … … 80 89 environment['AUDIO_RESOURCES_PATH'] = self.path_from_webkit_base('Source', 'WebCore', 'platform', 'audio', 'resources') 81 90 self._copy_value_from_environ_if_set(environment, 'WEBKIT_OUTPUTDIR') 91 if self.get_option("leaks"): 92 # Turn off GLib memory optimisations https://wiki.gnome.org/Valgrind. 93 environment['G_SLICE'] = 'always-malloc' 94 environment['G_DEBUG'] = 'gc-friendly' 95 xmlfilename = "".join(("drt-%p-", uuid.uuid1().hex, "-leaks.xml")) 96 xmlfile = os.path.join(self.results_directory(), xmlfilename) 97 environment['VALGRIND_OPTS'] = \ 98 "--tool=memcheck " \ 99 "--num-callers=40 " \ 100 "--demangle=no " \ 101 "--trace-children=no " \ 102 "--smc-check=all-non-file " \ 103 "--leak-check=yes " \ 104 "--leak-resolution=high " \ 105 "--show-possibly-lost=no " \ 106 "--show-reachable=no " \ 107 "--leak-check=full " \ 108 "--undef-value-errors=no " \ 109 "--gen-suppressions=all " \ 110 "--xml=yes " \ 111 "--xml-file=\"%s\" " % (xmlfile) 82 112 return environment 83 113
Note:
See TracChangeset
for help on using the changeset viewer.