From owner-svn-src-all@FreeBSD.ORG Thu Mar 12 10:34:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 319F4106564A; Thu, 12 Mar 2009 10:34:17 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2018E8FC0A; Thu, 12 Mar 2009 10:34:17 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2CAYH0L028117; Thu, 12 Mar 2009 10:34:17 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2CAYHSK028116; Thu, 12 Mar 2009 10:34:17 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200903121034.n2CAYHSK028116@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 12 Mar 2009 10:34:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189735 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2009 10:34:17 -0000 Author: bms Date: Thu Mar 12 10:34:16 2009 New Revision: 189735 URL: http://svn.freebsd.org/changeset/base/189735 Log: Make semaphore debugging output more useful. PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545 MFC after: 5 days Submitted by: Philip Semanchuk Modified: head/sys/kern/uipc_sem.c Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Thu Mar 12 09:56:15 2009 (r189734) +++ head/sys/kern/uipc_sem.c Thu Mar 12 10:34:16 2009 (r189735) @@ -548,6 +548,8 @@ int ksem_open(struct thread *td, struct ksem_open_args *uap) { + DP((">>> ksem_open start, pid=%d\n", (int)td->td_proc->p_pid)); + if ((uap->oflag & ~(O_CREAT | O_EXCL)) != 0) return (EINVAL); return (ksem_create(td, uap->name, uap->idp, uap->mode, uap->value, @@ -708,12 +710,14 @@ kern_sem_wait(struct thread *td, semid_t struct ksem *ks; int error; - DP((">>> kern_sem_wait entered!\n")); + DP((">>> kern_sem_wait entered! pid=%d\n", (int)td->td_proc->p_pid)); error = ksem_get(td, id, &fp); if (error) return (error); ks = fp->f_data; mtx_lock(&sem_lock); + DP((">>> kern_sem_wait critical section entered! pid=%d\n", + (int)td->td_proc->p_pid)); #ifdef MAC error = mac_posixsem_check_wait(td->td_ucred, fp->f_cred, ks); if (error) { @@ -750,11 +754,13 @@ kern_sem_wait(struct thread *td, semid_t goto err; } ks->ks_value--; + DP(("kern_sem_wait value post-decrement = %d\n", ks->ks_value)); error = 0; err: mtx_unlock(&sem_lock); fdrop(fp, td); - DP(("<<< kern_sem_wait leaving, error = %d\n", error)); + DP(("<<< kern_sem_wait leaving, pid=%d, error = %d\n", + (int)td->td_proc->p_pid, error)); return (error); }