From owner-freebsd-questions Sat Sep 2 14:53:29 2000 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id 83CB737B423 for ; Sat, 2 Sep 2000 14:53:23 -0700 (PDT) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=root) by scientia.demon.co.uk with esmtp (Exim 3.16 #1) id 13VKfs-000C5P-00; Sat, 02 Sep 2000 22:18:04 +0100 Received: (from ben@localhost) by strontium.scientia.demon.co.uk (8.9.3/8.9.3) id WAA45609; Sat, 2 Sep 2000 22:18:04 +0100 (BST) (envelope-from ben) Date: Sat, 2 Sep 2000 22:18:04 +0100 From: Ben Smithurst To: Zhihui Zhang Cc: freebsd-questions@freebsd.org Subject: Re: Questions (context switch, X, processes) Message-ID: <20000902221804.Q72445@strontium.scientia.demon.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Zhihui Zhang wrote: > (1) How to display the number of context switches the system have > performed so far? vmstat -s | grep context > (2) How to display the number of processes the sysem have created so far? I don't think you can. If you really need this, it would be trivial to add a counter incremented after the line "p2 = newproc" in fork1() in kern_fork.c, which you can then set up to be accessed via a sysctl call. Perhaps this would be an interesting thing to add to the standard vmstat -s output. Alfred Perlstein recently added a sysctl to access the current number of open files: SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD, &nfiles, 0, "System-wide number of open files"); This shows how simple adding a new sysctl is. So I'm guessing you'd just need to add something like static int fork_count = 0; SYSCTL_INT(_kern, OID_AUTO, fork_count, CTLFLAG_RD, &fork_count, 0, "Number of forks since boot time"); in kern_fork.c, and increment fork_count where I suggested above. I'd be interested in knowing if this works. :-) > (3) I want to use exceed on a laptop in windows. The laptop running exceed > will be X server. How to configure a FreeBSD box to open a X on it? I > assume that there is no need to install X server on FreeBSD box, but only > X client is needed. correct, you should just be able to set DISPLAY=laptop-hostname.whatever:0.0 or something like that. -- Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message