From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 14 08:28:45 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 120CD16A4CE for ; Mon, 14 Feb 2005 08:28:45 +0000 (GMT) Received: from smtp.ucla.edu (smtp.ucla.edu [169.232.46.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA45C43D3F for ; Mon, 14 Feb 2005 08:28:44 +0000 (GMT) (envelope-from ashcs@ucla.edu) Received: from mail.ucla.edu (mail.ucla.edu [169.232.46.135]) by smtp.ucla.edu (8.13.1/8.13.1) with ESMTP id j1E8Sicr021333 for ; Mon, 14 Feb 2005 00:28:44 -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 j1E8Shh6006417 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Mon, 14 Feb 2005 00:28:44 -0800 Message-ID: <000c01c5126f$354f81c0$58e243a4@ash> From: "Ashwin Chandra" To: Date: Mon, 14 Feb 2005 00:28:47 -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: 0.517 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? 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: Mon, 14 Feb 2005 08:28:45 -0000 Hi everyone, Im having issues with the following code running as a kernel thread. = when i do the prinft (which i traced with kgdb) it crashes...but those = two variables that i print out, are fine if i do comparisons or store = them into variables...only printing them causes a panic. anyone have any = ideas in what im doing wrong? static void kernmon(void); static void kernmon_thread(void); static void kern_print(void); static struct kproc_desc kernmon_kp =3D { "kernmon", kernmon_thread, NULL }; SYSINIT(kernmon, SI_SUB_KERN_MON, SI_ORDER_FIRST, kproc_start, = &kernmon_kp) static void kernmon(void) { kern_print(); } static void kernmon_thread(void) { int nowake =3D 0; for (;;) { kernmon(); tsleep(&nowake, curthread->td_priority, "-", 7*hz); } } static void kern_print(void) { struct proc *p; FOREACH_PROC_IN_SYSTEM(p) { mtx_lock(&Giant); 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); mtx_unlock(&Giant); } }