Bug 27923

Summary: run-webkit-tests should not invoke "ps" repeatedly on Mac OS X
Product: WebKit Reporter: Mark Rowe (bdash) <mrowe>
Component: Tools / TestsAssignee: Mark Rowe (bdash) <mrowe>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, darin, ddkilzer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
mrowe: review-
With support for Tiger ddkilzer: review+

Mark Rowe (bdash)
Reported Saturday, August 1, 2009 8:46:34 PM UTC
run-webkit-tests invokes "ps" repeatedly in an attempt to detect whether DumpRenderTree is in the process of crashing but being kept alive while ReportCrash generates a crash log. It's invoked in a manner that spawns a subshell, which makes things even slower.
Attachments
Patch (7.91 KB, patch)
2009-08-01 12:56 PDT, Mark Rowe (bdash)
mrowe: review-
With support for Tiger (11.87 KB, patch)
2009-08-01 18:24 PDT, Mark Rowe (bdash)
ddkilzer: review+
Mark Rowe (bdash)
Comment 1 Saturday, August 1, 2009 8:56:32 PM UTC
Sam Weinig
Comment 2 Saturday, August 1, 2009 9:01:06 PM UTC
Comment on attachment 33939 [details] Patch Looks good, one issue below. > +++ b/WebKitTools/DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport.c > @@ -0,0 +1,17 @@ > +#include <sys/sysctl.h> > + > +int processIsCrashing(int pid) > +{ > + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid }; > + struct kinfo_proc info; > + size_t bufferSize = sizeof(info); > + if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &info, &bufferSize, 0, 0)) { > + perror("sysctl"); > + return 0; > + } > + > + struct extern_proc proc = info.kp_proc; > + > + // The process is crashing if it is waiting to exit, is not a zombie, and has a non-zero exit code. > + return proc.p_stat != SZOMB && (proc.p_flag & P_WEXIT) && proc.p_xstat; > +} This file needs a license. Otherwise, r=me.
Mark Rowe (bdash)
Comment 3 Saturday, August 1, 2009 9:05:37 PM UTC
Landed in r46676.
Mark Rowe (bdash)
Comment 4 Saturday, August 1, 2009 9:14:04 PM UTC
Bah, Tiger doesn't have swig.
Mark Rowe (bdash)
Comment 5 Saturday, August 1, 2009 9:14:59 PM UTC
Rolled out in r46678. Will have to do some thinking to find an approach that works on Tiger too.
Mark Rowe (bdash)
Comment 6 Sunday, August 2, 2009 2:24:10 AM UTC
Created attachment 33944 [details] With support for Tiger
David Kilzer (:ddkilzer)
Comment 7 Sunday, August 2, 2009 2:33:48 AM UTC
Comment on attachment 33944 [details] With support for Tiger r=me
David Kilzer (:ddkilzer)
Comment 8 Sunday, August 2, 2009 2:35:31 AM UTC
(In reply to comment #7) > (From update of attachment 33944 [details]) > r=me WebKitTools/DumpRenderTree/mac/PerlSupport/Makefile needs a license, too.
Mark Rowe (bdash)
Comment 9 Sunday, August 2, 2009 2:41:15 AM UTC
Landed in r46682.
Note You need to log in before you can comment on or make changes to this bug.