procfs_status.c (170472) | procfs_status.c (172207) |
---|---|
1/*- 2 * Copyright (c) 1993 Jan-Simon Pendry 3 * Copyright (c) 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 20 unchanged lines hidden (view full) --- 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 34 * 35 * From: 36 * $Id: procfs_status.c,v 3.1 1993/12/15 09:40:17 jsp Exp $ | 1/*- 2 * Copyright (c) 1993 Jan-Simon Pendry 3 * Copyright (c) 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 20 unchanged lines hidden (view full) --- 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 34 * 35 * From: 36 * $Id: procfs_status.c,v 3.1 1993/12/15 09:40:17 jsp Exp $ |
37 * $FreeBSD: head/sys/fs/procfs/procfs_status.c 170472 2007-06-09 21:48:44Z attilio $ | 37 * $FreeBSD: head/sys/fs/procfs/procfs_status.c 172207 2007-09-17 05:31:39Z jeff $ |
38 */ 39 40#include <sys/param.h> 41#include <sys/kernel.h> 42#include <sys/systm.h> 43#include <sys/exec.h> 44#include <sys/lock.h> 45#include <sys/mutex.h> --- 61 unchanged lines hidden (view full) --- 107 sbuf_printf(sb, "%ssldr", sep); 108 sep = ","; 109 } 110 SESS_UNLOCK(sess); 111 if (*sep != ',') { 112 sbuf_printf(sb, "noflags"); 113 } 114 | 38 */ 39 40#include <sys/param.h> 41#include <sys/kernel.h> 42#include <sys/systm.h> 43#include <sys/exec.h> 44#include <sys/lock.h> 45#include <sys/mutex.h> --- 61 unchanged lines hidden (view full) --- 107 sbuf_printf(sb, "%ssldr", sep); 108 sep = ","; 109 } 110 SESS_UNLOCK(sess); 111 if (*sep != ',') { 112 sbuf_printf(sb, "noflags"); 113 } 114 |
115 PROC_SLOCK(p); | |
116#ifdef KSE 117 if (p->p_flag & P_SA) 118 wmesg = "-kse- "; 119 else 120#endif 121 { 122 tdfirst = FIRST_THREAD_IN_PROC(p); 123 if (tdfirst->td_wchan != NULL) { 124 KASSERT(tdfirst->td_wmesg != NULL, 125 ("wchan %p has no wmesg", tdfirst->td_wchan)); 126 wmesg = tdfirst->td_wmesg; 127 } else 128 wmesg = "nochan"; 129 } 130 | 115#ifdef KSE 116 if (p->p_flag & P_SA) 117 wmesg = "-kse- "; 118 else 119#endif 120 { 121 tdfirst = FIRST_THREAD_IN_PROC(p); 122 if (tdfirst->td_wchan != NULL) { 123 KASSERT(tdfirst->td_wmesg != NULL, 124 ("wchan %p has no wmesg", tdfirst->td_wchan)); 125 wmesg = tdfirst->td_wmesg; 126 } else 127 wmesg = "nochan"; 128 } 129 |
131 if (p->p_sflag & PS_INMEM) { | 130 if (p->p_flag & P_INMEM) { |
132 struct timeval start, ut, st; 133 | 131 struct timeval start, ut, st; 132 |
133 PROC_SLOCK(p); |
|
134 calcru(p, &ut, &st); 135 PROC_SUNLOCK(p); 136 start = p->p_stats->p_start; 137 timevaladd(&start, &boottime); 138 sbuf_printf(sb, " %jd,%ld %jd,%ld %jd,%ld", 139 (intmax_t)start.tv_sec, start.tv_usec, 140 (intmax_t)ut.tv_sec, ut.tv_usec, 141 (intmax_t)st.tv_sec, st.tv_usec); | 134 calcru(p, &ut, &st); 135 PROC_SUNLOCK(p); 136 start = p->p_stats->p_start; 137 timevaladd(&start, &boottime); 138 sbuf_printf(sb, " %jd,%ld %jd,%ld %jd,%ld", 139 (intmax_t)start.tv_sec, start.tv_usec, 140 (intmax_t)ut.tv_sec, ut.tv_usec, 141 (intmax_t)st.tv_sec, st.tv_usec); |
142 } else { 143 PROC_SUNLOCK(p); | 142 } else |
144 sbuf_printf(sb, " -1,-1 -1,-1 -1,-1"); | 143 sbuf_printf(sb, " -1,-1 -1,-1 -1,-1"); |
145 } | |
146 147 sbuf_printf(sb, " %s", wmesg); 148 149 cr = p->p_ucred; 150 151 sbuf_printf(sb, " %lu %lu %lu", 152 (u_long)cr->cr_uid, 153 (u_long)cr->cr_ruid, --- 72 unchanged lines hidden --- | 144 145 sbuf_printf(sb, " %s", wmesg); 146 147 cr = p->p_ucred; 148 149 sbuf_printf(sb, " %lu %lu %lu", 150 (u_long)cr->cr_uid, 151 (u_long)cr->cr_ruid, --- 72 unchanged lines hidden --- |