Changeset 30849 in webkit
- Timestamp:
- Mar 6, 2008 10:55:02 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r30848 r30849 1 2008-03-06 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Darin 4 5 Add a timedWait() method to ThreadCondition 6 7 * JavaScriptCore.exp: 8 9 * wtf/Threading.h: 10 11 * wtf/ThreadingGtk.cpp: 12 (WTF::ThreadCondition::timedWait): 13 14 * wtf/ThreadingNone.cpp: 15 (WTF::ThreadCondition::timedWait): 16 17 * wtf/ThreadingPthreads.cpp: 18 (WTF::ThreadCondition::timedWait): 19 20 * wtf/ThreadingWin.cpp: 21 (WTF::ThreadCondition::timedWait): Needs implementation 22 1 23 2008-03-06 Alexey Proskuryakov <ap@webkit.org> 2 24 -
trunk/JavaScriptCore/JavaScriptCore.exp
r30842 r30849 83 83 __ZN3KJS10throwErrorEPNS_9ExecStateENS_9ErrorTypeE 84 84 __ZN3KJS10throwErrorEPNS_9ExecStateENS_9ErrorTypeEPKc 85 __ZN3KJS10throwErrorEPNS_9ExecStateENS_9ErrorTypeERKNS_7UStringE 85 86 __ZN3KJS11Interpreter11checkSyntaxEPNS_9ExecStateERKNS_7UStringEiPKNS_5UCharEi 86 87 __ZN3KJS11Interpreter21shouldPrintExceptionsEv … … 151 152 __ZN3KJS6parserEv 152 153 __ZN3KJS7CStringD1Ev 154 __ZN3KJS7CStringaSERKS0_ 153 155 __ZN3KJS7UString3Rep4nullE 154 156 __ZN3KJS7UString3Rep7destroyEv 155 157 __ZN3KJS7UString4fromEj 158 __ZN3KJS7UString6appendEPKc 156 159 __ZN3KJS7UString6appendERKS0_ 157 160 __ZN3KJS7UStringC1EPKNS_5UCharEi … … 206 209 __ZN3WTF15ThreadCondition6signalEv 207 210 __ZN3WTF15ThreadCondition9broadcastEv 211 __ZN3WTF15ThreadCondition9timedWaitERNS_5MutexEd 208 212 __ZN3WTF15ThreadConditionC1Ev 209 213 __ZN3WTF15ThreadConditionD1Ev … … 216 220 __ZN3WTF5MutexC1Ev 217 221 __ZN3WTF5MutexD1Ev 222 __ZN3WTF8Collator18setOrderLowerFirstEb 223 __ZN3WTF8CollatorC1EPKc 224 __ZN3WTF8CollatorD1Ev 218 225 __ZN3WTF8fastFreeEPv 219 226 __ZNK3KJS11PropertyMap3getERKNS_10IdentifierE … … 245 252 __ZNK3KJS7UString8toUInt32EPbb 246 253 __ZNK3KJS8JSObject11hasPropertyEPNS_9ExecStateERKNS_10IdentifierE 254 __ZNK3KJS8JSObject11hasPropertyEPNS_9ExecStateEj 247 255 __ZNK3KJS8JSObject12defaultValueEPNS_9ExecStateENS_6JSTypeE 248 256 __ZNK3KJS8JSObject14implementsCallEv … … 259 267 __ZNK3KJS8JSObject9toBooleanEPNS_9ExecStateE 260 268 __ZNK3KJS9ExecState19lexicalGlobalObjectEv 269 __ZNK3WTF8Collator7collateEPKtmS2_m 261 270 __ZTVN3KJS14JSGlobalObjectE 262 271 __ZTVN3KJS14StringInstanceE … … 269 278 _kJSClassDefinitionEmpty 270 279 _kjs_strtod 271 __ZN3WTF8Collator18setOrderLowerFirstEb272 __ZN3WTF8CollatorC1EPKc273 __ZN3WTF8CollatorD1Ev274 __ZNK3WTF8Collator7collateEPKtmS2_m275 __ZN3KJS10throwErrorEPNS_9ExecStateENS_9ErrorTypeERKNS_7UStringE276 __ZNK3KJS8JSObject11hasPropertyEPNS_9ExecStateEj277 __ZN3KJS7UString6appendEPKc278 __ZN3KJS7CStringaSERKS0_ -
trunk/JavaScriptCore/wtf/Threading.h
r30842 r30849 159 159 160 160 void wait(Mutex& mutex); 161 // Returns true if the condition was signaled before the timeout, false if the timeout was reached 162 bool timedWait(Mutex&, double interval); 161 163 void signal(); 162 164 void broadcast(); -
trunk/JavaScriptCore/wtf/ThreadingGtk.cpp
r30842 r30849 177 177 } 178 178 179 bool ThreadCondition::timedWait(Mutex& mutex, double interval) 180 { 181 if (interval < 0.0) { 182 wait(mutex); 183 return true; 184 } 185 186 int intervalSeconds = static_cast<int>(interval); 187 int intervalMicroseconds = static_cast<int>((interval - intervalSeconds) * 1000000.0); 188 189 GTimeVal targetTime; 190 g_get_current_time(&targetTime); 191 192 targetTime.tv_sec += intervalSeconds; 193 targetTime.tv_usec += intervalMicroseconds; 194 if (targetTime.tv_usec > 1000000) { 195 targetTime.tv_usec -= 1000000; 196 targetTime.tv_sec++; 197 } 198 199 return g_cond_timedwait(m_condition, mutex.impl(), &targetTime); 200 } 201 179 202 void ThreadCondition::signal() 180 203 { -
trunk/JavaScriptCore/wtf/ThreadingNone.cpp
r30842 r30849 48 48 ThreadCondition::~ThreadCondition() {} 49 49 void ThreadCondition::wait(Mutex& mutex) {} 50 bool ThreadCondition::timedWait(Mutex& mutex, double interval) { return false; } 50 51 void ThreadCondition::signal() {} 51 52 void ThreadCondition::broadcast() {} -
trunk/JavaScriptCore/wtf/ThreadingPthreads.cpp
r30842 r30849 33 33 34 34 #include <errno.h> 35 #include <time.h> 35 36 36 37 namespace WTF { … … 185 186 ASSERT(false); 186 187 } 187 188 189 bool ThreadCondition::timedWait(Mutex& mutex, double interval) 190 { 191 if (interval < 0.0) { 192 wait(mutex); 193 return true; 194 } 195 196 int intervalSeconds = static_cast<int>(interval); 197 int intervalMicroseconds = static_cast<int>((interval - intervalSeconds) * 1000000.0); 198 199 // Current time comes in sec/microsec 200 timeval currentTime; 201 gettimeofday(¤tTime, NULL); 202 203 // Target time comes in sec/nanosec 204 timespec targetTime; 205 targetTime.tv_sec = currentTime.tv_sec + intervalSeconds; 206 targetTime.tv_nsec = (currentTime.tv_usec + intervalMicroseconds) * 1000; 207 if (targetTime.tv_nsec > 1000000000) { 208 targetTime.tv_nsec -= 1000000000; 209 targetTime.tv_sec++; 210 } 211 212 return pthread_cond_timedwait(&m_condition, &mutex.impl(), &targetTime) == 0; 213 } 214 188 215 void ThreadCondition::signal() 189 216 { -
trunk/JavaScriptCore/wtf/ThreadingWin.cpp
r30842 r30849 284 284 285 285 ::EnterCriticalSection (&cs.m_internalMutex); 286 } 287 288 bool ThreadCondition::timedWait(Mutex& mutex, double interval) 289 { 290 // Empty for now 291 ASSERT(false); 286 292 } 287 293 -
trunk/WebKitTools/ChangeLog
r30818 r30849 1 2008-03-06 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Darin 4 5 Added a cross-platform Watchdog thread to DRT. 6 7 The current watchdog in both DRTWin and DRTMac is Timer based. Therefore, deadlocks and long running 8 main thread hangs still affect DRT. 9 10 By placing the watchdog on a thread and having DRT "check in" after each test, long-running hangs 11 and true deadlocks can be caught. 12 13 There is one hook for platform specific code. As I did my development and testing on Mac, and Mac has 14 `sample` available, the Mac implementation of this hook samples the process before it is killed. 15 16 I arbitrarily chose 30 seconds as the timeout for now - this can be tweaked easily if we find a need. 17 18 * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: 19 * DumpRenderTree/mac/Configurations/Base.xcconfig: Added LINKER_DISPLAYS_MANGLED_NAMES 20 21 * DumpRenderTree/ForwardingHeaders/wtf/Locker.h: Added. 22 * DumpRenderTree/ForwardingHeaders/wtf/Threading.h: Added. 23 24 * DumpRenderTree/Watchdog.cpp: Added. 25 (Watchdog::Watchdog): 26 (Watchdog::~Watchdog): 27 (Watchdog::start): 28 (Watchdog::stop): 29 (Watchdog::checkIn): 30 (Watchdog::setWatchdogInterval): 31 (Watchdog::handleHang): 32 (Watchdog::watchdogThreadStart): 33 (Watchdog::watchdogThread): 34 * DumpRenderTree/Watchdog.h: Added. 35 36 * DumpRenderTree/mac/WatchdogMac.h: Added. 37 * DumpRenderTree/mac/WatchdogMac.mm: Added. 38 (WatchdogMac::handleHang): Sample the process and write it out to a file 39 40 * DumpRenderTree/mac/DumpRenderTree.mm: 41 (dumpRenderTree): Setup and start the watchdog before running any tests 42 (runTest): Checkin with the watchdog after each test 43 1 44 2008-03-05 Alp Toker <alp@atoker.com> 2 45 -
trunk/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
r29396 r30849 35 35 1AC6C84A0D07638600CD3161 /* PluginObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7800D07589B00CD3161 /* PluginObject.cpp */; }; 36 36 1AC6C84B0D07638600CD3161 /* TestObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7810D07589B00CD3161 /* TestObject.cpp */; }; 37 5199B2DA0D7F8A5200CFE8D7 /* WatchdogMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5199B2D90D7F8A5200CFE8D7 /* WatchdogMac.mm */; }; 38 5199B2DF0D7F8A9A00CFE8D7 /* Watchdog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5199B2DD0D7F8A9A00CFE8D7 /* Watchdog.cpp */; }; 39 5199B2E00D7F8A9A00CFE8D7 /* Watchdog.h in Headers */ = {isa = PBXBuildFile; fileRef = 5199B2DE0D7F8A9A00CFE8D7 /* Watchdog.h */; }; 37 40 9340994C08540CAE007F3BC8 /* DumpRenderTreePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */; }; 38 41 9340995108540CAE007F3BC8 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9335435F03D75502008635CE /* WebKit.framework */; }; … … 129 132 1AC6C7810D07589B00CD3161 /* TestObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestObject.cpp; sourceTree = "<group>"; }; 130 133 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; }; 134 5199B2C80D7F876F00CFE8D7 /* WatchdogMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WatchdogMac.h; path = mac/WatchdogMac.h; sourceTree = "<group>"; }; 135 5199B2D90D7F8A5200CFE8D7 /* WatchdogMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WatchdogMac.mm; path = mac/WatchdogMac.mm; sourceTree = "<group>"; }; 136 5199B2DD0D7F8A9A00CFE8D7 /* Watchdog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Watchdog.cpp; sourceTree = "<group>"; }; 137 5199B2DE0D7F8A9A00CFE8D7 /* Watchdog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Watchdog.h; sourceTree = "<group>"; }; 131 138 9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 132 139 9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; }; … … 248 255 BCA18B730C9B08F100114369 /* DumpRenderTreeDraggingInfo.h */, 249 256 BCA18B740C9B08F100114369 /* DumpRenderTreeDraggingInfo.mm */, 257 5199B2DE0D7F8A9A00CFE8D7 /* Watchdog.h */, 258 5199B2DD0D7F8A9A00CFE8D7 /* Watchdog.cpp */, 259 5199B2C80D7F876F00CFE8D7 /* WatchdogMac.h */, 260 5199B2D90D7F8A5200CFE8D7 /* WatchdogMac.mm */, 250 261 BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */, 251 262 BC9D90220C97472E0099A4A3 /* WorkQueue.h */, … … 434 445 BCB284D00CFA83CC007E533E /* PixelDumpSupportCG.h in Headers */, 435 446 BC47412A0D038A4C0072B006 /* JavaScriptThreading.h in Headers */, 447 5199B2E00D7F8A9A00CFE8D7 /* Watchdog.h in Headers */, 436 448 ); 437 449 runOnlyForDeploymentPostprocessing = 0; … … 574 586 BCB284D60CFA83D1007E533E /* PixelDumpSupportMac.mm in Sources */, 575 587 BC4741410D038A570072B006 /* JavaScriptThreadingPthreads.cpp in Sources */, 588 5199B2DA0D7F8A5200CFE8D7 /* WatchdogMac.mm in Sources */, 589 5199B2DF0D7F8A9A00CFE8D7 /* Watchdog.cpp in Sources */, 576 590 ); 577 591 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig
r30701 r30849 15 15 WARNING_CFLAGS = -Wall -W -Wno-unused-parameter 16 16 VALID_ARCHS = ppc7400 ppc970 i386 ppc 17 LINKER_DISPLAYS_MANGLED_NAMES = YES; -
trunk/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
r30666 r30849 45 45 #import "ResourceLoadDelegate.h" 46 46 #import "UIDelegate.h" 47 #import "WatchdogMac.h" 47 48 #import "WorkQueue.h" 48 49 #import "WorkQueueItem.h" … … 70 71 #import <wtf/Assertions.h> 71 72 #import <wtf/RetainPtr.h> 73 #import <wtf/OwnPtr.h> 72 74 73 75 @interface DumpRenderTreeEvent : NSEvent … … 98 100 CFMutableSetRef disallowedURLs = 0; 99 101 CFRunLoopTimerRef waitToDumpWatchdog = 0; 102 OwnPtr<Watchdog> watchdog; 100 103 101 104 // Delegates … … 409 412 startJavaScriptThreads(); 410 413 414 watchdog.set(new WatchdogMac()); 415 watchdog->start(); 416 411 417 if (useLongRunningServerMode(argc, argv)) { 412 418 printSeparators = YES; … … 417 423 runTest(argv[i]); 418 424 } 425 watchdog->stop(); 426 watchdog.clear(); 419 427 420 428 if (threaded) … … 910 918 if (_shouldIgnoreWebCoreNodeLeaks) 911 919 [WebCoreStatistics stopIgnoringWebCoreNodeLeaks]; 920 921 // Check-in with the watchdog after every test is complete 922 watchdog->checkIn(); 912 923 } 913 924
Note: See TracChangeset
for help on using the changeset viewer.