From owner-svn-src-user@FreeBSD.ORG Sat Feb 7 13:18:33 2015 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA1FDB45; Sat, 7 Feb 2015 13:18:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D68C680F; Sat, 7 Feb 2015 13:18:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t17DIXqc089147; Sat, 7 Feb 2015 13:18:33 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t17DIXGL089146; Sat, 7 Feb 2015 13:18:33 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201502071318.t17DIXGL089146@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sat, 7 Feb 2015 13:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r278353 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2015 13:18:34 -0000 Author: pho Date: Sat Feb 7 13:18:32 2015 New Revision: 278353 URL: https://svnweb.freebsd.org/changeset/base/278353 Log: Wait longer for gdb to start and improve error handling. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/signal.sh Modified: user/pho/stress2/misc/signal.sh ============================================================================== --- user/pho/stress2/misc/signal.sh Sat Feb 7 13:11:45 2015 (r278352) +++ user/pho/stress2/misc/signal.sh Sat Feb 7 13:18:32 2015 (r278353) @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) { int sig; sscanf(argv[3], "%d", &sig); - + if( syscall(SYS_thr_kill2, pid, id, sig) ) { perror("syscall"); } @@ -200,25 +200,29 @@ sleep 300 > gdbfifo & # Keep the fifo op fifopid=$! gdb ./waitthread < gdbfifo > gdbout 2>&1 & +gdbpid=$! echo "set args 8" > gdbfifo echo "run" > gdbfifo -sleep .2 +sleep .5 pid=`ps | grep -v grep | grep "waitthread 8" | sed 's/^ *//;s/ .*//'` -[ -z "$pid" ] && echo "Could not find pid" && exit 1 -procstat -t $pid > pstat - -t1=`grep fifo pstat | awk '{print $2}'` -t2=`grep umtxn pstat | awk '{print $2}' | tail -1` +if [ -n "$pid" ]; then + procstat -t $pid > pstat -./tkill $pid $t1 5 # SIGTRAP -./tkill $pid $t2 2 # SIGINT + t1=`grep fifo pstat | awk '{print $2}'` + t2=`grep umtxn pstat | awk '{print $2}' | tail -1` -echo "c" > gdbfifo -echo "quit" > gdbfifo + ./tkill $pid $t1 5 # SIGTRAP + ./tkill $pid $t2 2 # SIGINT -kill $fifopid + echo "c" > gdbfifo + echo "quit" > gdbfifo + sleep 1 + grep -q "signal SIGINT" gdbout || echo FAIL +else + echo "Did not find pid for test program waitthread" +fi -grep -q "signal SIGINT" gdbout || echo FAIL +kill $fifopid $gdbpid > /dev/null 2>&1 rm -f gdbfifo gdbout pstat waitthread tkill /tmp/waitthread ps | grep -v grep | grep waitthread | awk '{print $1}' | xargs kill