Date: Sat, 7 Apr 2001 22:13:25 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Dima Dorfman <dima@unixfreak.org> Cc: Brian Somers <brian@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/ps ps.c Message-ID: <Pine.BSF.4.21.0104072154160.64097-100000@besplex.bde.org> In-Reply-To: <20010407080412.E21673E09@bazooka.unixfreak.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 7 Apr 2001, Dima Dorfman wrote: > Bruce Evans <bde@zeta.org.au> writes: > > This stomps on PR 26057, which contains more complete fixes. It's > > not clear whether the bug is the non-removal of the sess column and > > the sess keyword or the removal of the e_sess pointer. > > This particular commit doesn't really hurt anything. We just need to > decide whether there should be an e_sess (or ki_sess, now) pointer or > not. PR 26057, which you mention, contains a patch to add it back. > Although mckusick did explicitly say he was removing it in his > kproc_info commit, he didn't provide rationale. > > So, the question is: do we want a `sess' column? Maybe not by default, but I think we want it. Linux ps (at least according to a RedHat ps.1 dated 1996/12/19) has a "session ID" (with short keyword "o" and long keyword "session"). It doesn't seem to anything corresponding to "tsess". I think BSD ps was just abusing the session pointers as unique IDs. The terminal session pointer is also printed by pstat(8). It works there because it is read out of a tty struct. Larger pointers makes abusing pointers for IDs more of a hack than before. pstat(8) simply converts them to u_longs and prints them using %8lx format (%p format is no good since it is uncontrollable). On alphas, the values take more like 16 characters than 8 to print and the formatting is messed up. ps(1) is more careful. It prints only the trailing v->width characters. The width was 6 for sess and tsess. Now it only prints 2 pointers (the ones for "nwchan" and "paddr"). It uses width 6 for these too. This makes the values shown by ps for pointers almost useless for locating the pointers in kmem and not even necessarily unique as IDs either -- even on i386's kernel addresses are no longer unique in the last 6 nybbles. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0104072154160.64097-100000>