The real aim, btw, of moving to sysctl was to allow top (and the other utilities) without any extra privilege -- be it setuid, setgid kmem, etc. This had a number of added benefits, including allowing the policy for process/information visibility to be determined entirely in the kernel (required for our modular access control framework in TrustedBSD), let it run in jail, gradually deprecate kvm for statistics reporting, etc.
Robert N M Watson FreeBSD Core Team, TrustedBSD Project [EMAIL PROTECTED] NAI Labs, Safeport Network Services On Tue, 2 Apr 2002, Robert Watson wrote: > Doesn't top already run in Jail on -CURRENT? Thomas Moestl did this work > a while back, exposing the necessary information to support most of our > userland monitoring tools using sysctl rather than kvm: > > last pid: 32655; load averages: 0.05, 0.09, 0.07 up 7+14:52:51 09:50:01 > 2 processes: 1 running, 1 sleeping > CPU states: 4.7% user, 0.0% nice, 2.3% system, 1.2% interrupt, 91.8% idle > Mem: 61M Active, 21M Inact, 32M Wired, 6932K Cache, 22M Buf, 888K Free > Swap: 261M Total, 52M Used, 209M Free, 20% Inuse > > PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND > 32652 root 96 0 1956K 1080K RUN 0:00 0.00% 0.00% top > 32650 root 20 0 1448K 996K pause 0:00 0.00% 0.00% tcsh > > In general, new "features" for top go into the cross-platform vendor top > code, but features to improve FreeBSD-specific information extraction go > into our local tree. What exactly does -j do? > > Robert N M Watson FreeBSD Core Team, TrustedBSD Project > [EMAIL PROTECTED] NAI Labs, Safeport Network Services > > On Mon, 1 Apr 2002, Jon Ringuette wrote: > > > Sorry to bother everyone here but I have a quick question (or I guess > > what I hope is a quick question). I have made some modifications to > > src/usr.bin/machine.c to allow TOP to run in a jail (I have mostly just > > taken out kvm_read's ) and zero'd out alot of information that is not > > available to TOP in a jail ie . Total memory usage / swap usage / cpu > > usage etc.. I would like to add an option -j to top and have it check > > for that option to do this (sort of a really lightweight top if this > > option is used). Would this be of interest to anymore for me to submit > > a patch and if so how should I go about adding the -j option should I > > make a copy of the top.c into src/usr.bin/top or contact the auther of > > top to see about submitting it to him? I'm not sure if this would be > > useful to anyone outside of the FreeBSD community is the reason I am a > > bit iffy about doing that. If someone could point me in the right > > direction to do this the correct way I would be very grateful, I really > > want to code but I'm not sure where and how i should do it :) > > > > -jon > > iMeme > > > > > > > > To Unsubscribe: send mail to [EMAIL PROTECTED] > > with "unsubscribe freebsd-hackers" in the body of the message > > > > > To Unsubscribe: send mail to [EMAIL PROTECTED] > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message