From owner-freebsd-stable@FreeBSD.ORG Sun Apr 8 21:12:22 2012 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 964AC106564A for ; Sun, 8 Apr 2012 21:12:22 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4494D8FC14 for ; Sun, 8 Apr 2012 21:12:22 +0000 (UTC) Received: by iahk25 with SMTP id k25so6939224iah.13 for ; Sun, 08 Apr 2012 14:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=joFqpyoIFY3nbm+1XJwS/6FzG/nndH9CKfAigpEg9Ww=; b=IqgUtSTmTChX/4ee2c1jliUKzjy/cisYYwg2jzZ28R4RVZwXZA+VLb+mmtIr10H/4G f/LqsQDKUFhxVX2hede09dboBAhV10GaFp9mbWYUlVhoKOwClNtk6PqKAxE64d6A4BbX quG1Olf4TeDBRdjDdE3nOVWSfZR2r1WpB3G2k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-gm-message-state; bh=joFqpyoIFY3nbm+1XJwS/6FzG/nndH9CKfAigpEg9Ww=; b=fFbU5XzH0gFDH88SnCDVmqndy73jx5AdvDvOI6ukFZquZLMu/8KEshtcHug65/HKSq AsEOSGhXnuwiKiwBqAAQ1FsqlPSsMLA9MRTi8Ei/PVIOBWQr7bzFyzbglCOVZdERUzk2 wTa8l58GSXGao9EI8lNVudxGZ6BGeYnQe5xFL3Y45I9tK2ZvOz11sSCG2XsBYn1mUbcE b68WfBFSNDkc69H9svwLNIlOiTHehXLhznJthHkj5Z55TkJANTViCsQmkhhvCjs4BiEx npFYU8kib44yiunuV9YozgMDvrKV+5Ukyao/yGlas2DaalGXDsqnSGHrWtSLbSZXBuf8 6JfA== Received: by 10.50.46.167 with SMTP id w7mr3301697igm.73.1333919541734; Sun, 08 Apr 2012 14:12:21 -0700 (PDT) Received: from DataIX.net (adsl-99-181-142-73.dsl.klmzmi.sbcglobal.net. [99.181.142.73]) by mx.google.com with ESMTPS id re5sm12965939igb.0.2012.04.08.14.12.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 Apr 2012 14:12:21 -0700 (PDT) Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q38LCJdV062812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Apr 2012 17:12:19 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Received: (from jhellenthal@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q38LCIju062811; Sun, 8 Apr 2012 17:12:18 -0400 (EDT) (envelope-from jhellenthal@DataIX.net) Date: Sun, 8 Apr 2012 17:12:18 -0400 From: Jason Hellenthal To: Mikolaj Golub Message-ID: <20120408211218.GA62178@DataIX.net> References: <201204061632.q36GWTT2017212@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201204061632.q36GWTT2017212@svn.freebsd.org> X-Gm-Message-State: ALoCoQl1w2s8KcU5EDljJhfCqz+MJ8AxQ0ibk5aC6dgVKG8BE4OXM3McqquXPB9mDTlTRO2vTbjb Cc: stable@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233953 - stable/8/usr.bin/procstat X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 21:12:22 -0000 This commit in action does not seem to be doing the correct thing even though it does report an error when kern.proc.pathname is not known. Running procstat -a -b produces: [...] 1848 ksh 803500 /bin/ksh procstat: sysctl: kern.proc.pathname: 2208: No such file or directory 2210 ksh 803500 /bin/ksh [...] While procstat -a produces: [...] 1848 1846 1848 1848 1848 1 jhellenthal wait FreeBSD ELF32 ksh 2208 1814 2208 2208 0 1 jhellenthal select FreeBSD ELF32 xterm 2210 2208 2210 2210 2210 1 jhellenthal wait FreeBSD ELF32 ksh [...] If process 2208 can be seen during (procstat -a) I do not see a reason to bailout and print an error when (-b) is used. Just print the orrelease as (0) and print the rest of the information that should be seen... Could someone have a closer look at this? On Fri, Apr 06, 2012 at 04:32:29PM +0000, Mikolaj Golub wrote: > Author: trociny > Date: Fri Apr 6 16:32:29 2012 > New Revision: 233953 > URL: http://svn.freebsd.org/changeset/base/233953 > > Log: > MFC r233390: > > When displaying binary information show also osreldate. > > Suggested by: kib > > Modified: > stable/8/usr.bin/procstat/procstat.1 > stable/8/usr.bin/procstat/procstat_bin.c > Directory Properties: > stable/8/usr.bin/procstat/ (props changed) > > Modified: stable/8/usr.bin/procstat/procstat.1 > ============================================================================== > --- stable/8/usr.bin/procstat/procstat.1 Fri Apr 6 16:31:29 2012 (r233952) > +++ stable/8/usr.bin/procstat/procstat.1 Fri Apr 6 16:32:29 2012 (r233953) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 7, 2010 > +.Dd March 23, 2012 > .Dt PROCSTAT 1 > .Os > .Sh NAME > @@ -98,6 +98,8 @@ Display the process ID, command, and pat > process ID > .It COMM > command > +.It OSREL > +osreldate for process binary > .It PATH > path to process binary (if available) > .El > > Modified: stable/8/usr.bin/procstat/procstat_bin.c > ============================================================================== > --- stable/8/usr.bin/procstat/procstat_bin.c Fri Apr 6 16:31:29 2012 (r233952) > +++ stable/8/usr.bin/procstat/procstat_bin.c Fri Apr 6 16:32:29 2012 (r233953) > @@ -42,11 +42,11 @@ void > procstat_bin(pid_t pid, struct kinfo_proc *kipp) > { > char pathname[PATH_MAX]; > - int error, name[4]; > + int error, osrel, name[4]; > size_t len; > > if (!hflag) > - printf("%5s %-16s %-53s\n", "PID", "COMM", "PATH"); > + printf("%5s %-16s %8s %s\n", "PID", "COMM", "OSREL", "PATH"); > > name[0] = CTL_KERN; > name[1] = KERN_PROC; > @@ -64,7 +64,19 @@ procstat_bin(pid_t pid, struct kinfo_pro > if (len == 0 || strlen(pathname) == 0) > strcpy(pathname, "-"); > > + name[2] = KERN_PROC_OSREL; > + > + len = sizeof(osrel); > + error = sysctl(name, 4, &osrel, &len, NULL, 0); > + if (error < 0 && errno != ESRCH) { > + warn("sysctl: kern.proc.osrel: %d", pid); > + return; > + } > + if (error < 0) > + return; > + > printf("%5d ", pid); > printf("%-16s ", kipp->ki_comm); > + printf("%8d ", osrel); > printf("%s\n", pathname); > } > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" -- ;s =;