diff options
author | Bryan Cantrill <bryan@joyent.com> | 2013-04-02 13:52:19 -0700 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2013-04-12 12:00:00 -0700 |
commit | f971a3462face662ae8ef220a18a98354d625d54 (patch) | |
tree | 5df66b69056387f6e3dd5e158930a663daab92dc /usr/src/lib/libproc/common/Psyscall.c | |
parent | abc79d9dd51e98eafb6fc25b4a0b4f66bef40b00 (diff) | |
download | illumos-joyent-f971a3462face662ae8ef220a18a98354d625d54.tar.gz |
3673 core dumping is abysmally slow
3671 left behind enemy lines, agent LWP can go rogue
3670 add visibility into agent LWP's spymaster
Reviewed by: Keith M Wesolowski <keith.wesolowski@joyent.com>
Reviewed by: Joshua M. Clulow <jmc@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/lib/libproc/common/Psyscall.c')
-rw-r--r-- | usr/src/lib/libproc/common/Psyscall.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/usr/src/lib/libproc/common/Psyscall.c b/usr/src/lib/libproc/common/Psyscall.c index a6cc285251..af2f229641 100644 --- a/usr/src/lib/libproc/common/Psyscall.c +++ b/usr/src/lib/libproc/common/Psyscall.c @@ -22,8 +22,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ + /* - * Copyright (c) 2013, Joyent Inc. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include <stdio.h> @@ -61,7 +62,7 @@ Pabort_agent(struct ps_prochandle *P) int sysnum = P->status.pr_lwp.pr_syscall; int stop; - dprintf("agent LWP is asleep in syscall %d\n", sysnum); + dprintf("agent LWP is stopped or asleep in syscall %d\n", sysnum); (void) Pstop(P, 0); stop = Psysexit(P, sysnum, TRUE); @@ -147,11 +148,16 @@ Pcreate_agent(struct ps_prochandle *P) P->agentctlfd = fd; /* - * If the agent is currently asleep in a system call, attempt - * to abort the system call so it's ready to serve. + * If the agent is currently asleep in a system call or stopped on + * system call entry, attempt to abort the system call so it's ready to + * serve. */ - if (P->status.pr_lwp.pr_flags & PR_ASLEEP) { - dprintf("Pcreate_agent: aborting agent syscall\n"); + if ((P->status.pr_lwp.pr_flags & PR_ASLEEP) || + ((P->status.pr_lwp.pr_flags & PR_STOPPED) && + P->status.pr_lwp.pr_why == PR_SYSENTRY)) { + dprintf("Pcreate_agent: aborting agent syscall; lwp is %s\n", + (P->status.pr_lwp.pr_flags & PR_ASLEEP) ? + "asleep" : "stopped"); Pabort_agent(P); } |