From owner-cvs-all Sat Apr 7 5:15:35 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id D066537B424; Sat, 7 Apr 2001 05:15:29 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id WAA30035; Sat, 7 Apr 2001 22:15:24 +1000 Date: Sat, 7 Apr 2001 22:13:25 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Dima Dorfman Cc: Brian Somers , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/ps ps.c In-Reply-To: <20010407080412.E21673E09@bazooka.unixfreak.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 7 Apr 2001, Dima Dorfman wrote: > Bruce Evans 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