From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 15 06:24:44 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7765D16A4CE for ; Tue, 15 Feb 2005 06:24:44 +0000 (GMT) Received: from smtp.ucla.edu (smtp.ucla.edu [169.232.48.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4004743D53 for ; Tue, 15 Feb 2005 06:24:44 +0000 (GMT) (envelope-from ashcs@ucla.edu) Received: from mail.ucla.edu (mail.ucla.edu [169.232.48.135]) by smtp.ucla.edu (8.13.1/8.13.1) with ESMTP id j1F6Oh7S017347 for ; Mon, 14 Feb 2005 22:24:43 -0800 Received: from ash (s226-88.resnet.ucla.edu [164.67.226.88]) (authenticated bits=0) by mail.ucla.edu (8.13.3/8.13.3) with ESMTP id j1F6OhBq007508 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Mon, 14 Feb 2005 22:24:43 -0800 Message-ID: <000801c51327$0e2bf020$58e243a4@ash> From: "Ashwin Chandra" To: Date: Mon, 14 Feb 2005 22:24:50 -0800 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Probable-Spam: no X-Spam-Hits: 1.054 X-Spam-Score: * X-Scanned-By: smtp.ucla.edu Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Kernel monitor, the return X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2005 06:24:44 -0000 In trying to create a simple kernel thread that prints out all the = processes data and stack size, i still get a panic fault (vm_fault on no = entry) at the printf statement...ive narrowed it down to the ru_idrss = variable that is causing the problem, im not sure why. I thought maybe I = was not locking properly or obseriving correct mutexes, but I have tried = everything. If anyone knows why the fault is occurring at the printf, = please let me know. =3D) Ash static void kern_print(void) { struct proc *p; sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); if(p->p_state =3D=3D PRS_NORMAL) { PROC_LOCK(p); printf("%d %d\n", (int)p->p_stats->p_ru.ru_isrss, = (int)p->p_stats->p_ru.ru_idrss); PROC_UNLOCK(p); } PROC_UNLOCK(p); } sx_sunlock(&allproc_lock); }