Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jan 2006 19:30:07 GMT
From:      hotlips Internet admin <hostmaster@GTS.NET>
To:        freebsd-amd64@FreeBSD.org
Subject:   Re: amd64/92412: rcp.rstatd reports bogus packets/per/second info
Message-ID:  <200601301930.k0UJU7bR086383@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR amd64/92412; it has been noted by GNATS.

From: hotlips Internet admin <hostmaster@GTS.NET>
To: sean@mcneil.com (Sean McNeil)
Cc: bug-followup@FreeBSD.org
Subject: Re: amd64/92412: rcp.rstatd reports bogus packets/per/second info
Date: Mon, 30 Jan 2006 14:22:52 -0500 (EST)

 Thus saith Sean McNeil:
 | 
 | 
 | On Jan 30, 2006, at 11:02 AM, hotlips Internet admin wrote:
 | 
 | > Thus saith Sean McNeil:
 | > | On Sun, 2006-01-29 at 07:30 +0000, hotlips Internet admin wrote:
 | > | > The following reply was made to PR amd64/92412; it has been  
 | > noted by GNATS.
 | > | >
 | > | > From: hotlips Internet admin <hostmaster@GTS.NET>
 | > | > To: kris@obsecurity.org (Kris Kennaway)
 | > | > Cc: bug-followup@FreeBSD.org
 | > | > Subject: Re: amd64/92412: rcp.rstatd reports bogus packets/per/ 
 | > second info
 | > | > Date: Sun, 29 Jan 2006 02:25:33 -0500 (EST)
 | > | >
 | > | >  Thus saith Kris Kennaway:
 | > | >  | On Fri, Jan 27, 2006 at 11:59:15AM -0500, hotlips Internet  
 | > admin wrote:
 | > | >  |
 | > | >  | > | > >Description:
 | > | >  | > | > packets/second value reported by rpc.rstatd to remote  
 | > monitor hovers around
 | > | >  | > | > 8000 or so with odd downward spikes approx every 90  
 | > seconds (it's not at
 | > | >  | > | all related to actual interface traffic)
 | > | >  | > | >
 | > | >  | > | > >How-To-Repeat:
 | > | >  | > | > keep displaying rpc.rstatd data from 6.0 system
 | > | >  | > |
 | > | >  | > | How are you using rpc.rstatd and rup?  I don't see a way  
 | > to make rup
 | > | >  | > | display "packets/second", it only gives uptime and load  
 | > average:
 | > | >  | > |
 | > | >  | > | # rup
 | > | >  | > | fbsd-amd64.isc.  10:02am  up   4 days,  14:00,  load  
 | > average: 2.00 2.00 2.00
 | > | >  | >
 | > | >  | > 	Solaris perfmeter, actually.
 | > | >  |
 | > | >  | Do you know how I can query this on FreeBSD?
 | > | >
 | > | >
 | > | >  	oop, wrong (older) diff - use this one below...
 | > |
 | > | The diff would be more readable if you only include useful  
 | > changes and
 | > | eliminate difference caused solely from white space.  For  
 | > instance, with
 | > | diff -ub.
 | >
 | >
 | > 	rup is also broken, sigh - patches below to account for
 | > 	8-btye timevals
 | >
 | >
 | > -- 
 | > Bruce Becker			+1 416 410 0879
 | > GTS Network Administration	Toronto, Ont.
 | > Email:	hostmaster@gts.net
 | >
 | >  --------- 8< --------- 8< --------- 8< --------- 8< --------- 8<  
 | > ---------
 | >
 | > --- rup.c.orig	Sat May 21 05:55:07 2005
 | > +++ rup.c	Mon Jan 30 13:55:34 2006
 | > @@ -93,6 +93,7 @@
 | >  static bool_t
 | >  rstat_reply(caddr_t replyp, struct sockaddr_in *raddrp)
 | >  {
 | > +	long longtime;
 | >  	struct tm *tmp_time;
 | >  	struct tm host_time;
 | >  	struct tm host_uptime;
 | > @@ -118,12 +119,14 @@
 | >
 | >  	printf("%-*s\t", HOST_WIDTH, host);
 | >
 | > -	tmp_time = localtime((time_t *)&host_stat->curtime.tv_sec);
 | > +	longtime = host_stat->curtime.tv_sec;
 | > +	tmp_time = localtime((time_t *)&longtime);
 | >  	host_time = *tmp_time;
 | >
 | 
 | 
 | Just curious, but why not declare a variable as time_t instead of  
 | long?  Seems like that would be more correct.
 | 
 | 
 | >  	host_stat->curtime.tv_sec -= host_stat->boottime.tv_sec;
 | >
 | > -	tmp_time = gmtime((time_t *)&host_stat->curtime.tv_sec);
 | > +	longtime = host_stat->curtime.tv_sec;
 | > +	tmp_time = gmtime((time_t *)&longtime);
 | >  	host_uptime = *tmp_time;
 | >
 | >  	#define updays (host_stat->curtime.tv_sec  / 86400)
 
 
 	it didn't seem to matter because of the "u_int tv_sec"
 	declaration in rstat_timeval in /usr/include/rpcsvc/rstat.h,
 	and the surrounding "(time_t *)&" - it should be as you suggest
 	however
 
 
 	in fact the problem mentioned seems to have been noticed
 	recently and is fixed somewhat more cleanly in current ...
 
 
 Cheers,
 Bruce Becker			+1 416 410 0879
 GTS Network Administration	Toronto, Ont.
 Email:	hostmaster@gts.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601301930.k0UJU7bR086383>