monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FreeBSD - HELP!


From: Rory Toma
Subject: Re: FreeBSD - HELP!
Date: 10 Sep 2002 18:28:16 -0700

Allright, I'm almost there. Monit now at least compiles and runs on
FreeBSD, although the the proc stuff does not work yet. However, I have
a configure question. Now that we re-arranged, I do not know how to add
"-lkvm" to the linker line. How do I do this?


On Tue, 2002-09-10 at 06:35, Christian Hopp wrote:
> On Mon, 9 Sep 2002 address@hidden wrote:
> 
> > Not quite yet, however I believe if I get it fixed for one of the compile
> > errors, it will be fixed for all. I'm going to work more on it tomorrow.
> > Now, back to Monday Night Football.
> 
> The season has started this weekend, or?
> 
> Unfortunately here is another missing code part.  Its down there in
> the mail.  The function culcru is used in part where the cpu time is
> gathered.
> 
> I hope it helps...
> 
> Christian
> 
> 
> ---SNIP---
> /* Found in libgtop-1.0.13/sysdeps/freebsd/proctime.c */
> 
> /* Taken from /usr/src/sys/kern/kern_resource.c */
> 
> /*
>  * Transform the running time and tick information in proc p into user,
>  * system, and interrupt time usage.
>  */
> 
> static void calcru(struct proc *p, struct timeval *up, struct timeval *sp,
>                  struct timeval *ip)
> {
>   quad_t totusec;
>   u_quad_t u, st, ut, it, tot;
> #if (__FreeBSD_version < 300003)
>   long sec, usec;
> #endif
>   struct timeval tv;
> 
>   st = p->p_sticks;
>   ut = p->p_uticks;
>   it = p->p_iticks;
> 
>   tot = st + ut + it;
>   if (tot == 0) {
>     st = 1;
>     tot = 1;
>   }
> 
> #if (defined __FreeBSD__) && (__FreeBSD_version >= 300003)
> 
>   /* This was changed from a `struct timeval' into a `u_int64_t'
>    * on FreeBSD 3.0 and renamed p_rtime -> p_runtime.
>    */
> 
>   totusec = (u_quad_t) p->p_runtime;
> #else
>   sec = p->p_rtime.tv_sec;
>   usec = p->p_rtime.tv_usec;
> 
>   totusec = (quad_t)sec * 1000000 + usec;
> #endif
> 
>   if(totusec < 0) {
>     /* XXX no %qd in kernel.  Truncate. */
>     fprintf (stderr, "calcru: negative time: %ld usec\n",
>            (long)totusec);
>     totusec = 0;
>   }
> 
> 
>   u = totusec;
>   st = (u * st) / tot;
>   sp->tv_sec = st / 1000000;
>   sp->tv_usec = st % 1000000;
>   ut = (u * ut) / tot;
>   up->tv_sec = ut / 1000000;
>   up->tv_usec = ut % 1000000;
> 
>   if(ip != NULL) {
>     it = (u * it) / tot;
>     ip->tv_sec = it / 1000000;
>     ip->tv_usec = it % 1000000;
>   }
> }
> ---SNAP---
> 
> 
> 
> 
> -- 
> Christian Hopp                                email: address@hidden
> Institut für Elektrische Informationstechnik             fon: +49-5323-72-2113
> Technische Universität Clausthal                         fax: +49-5323-72-3197
>   pgpkey: https://www.iei.tu-clausthal.de/pgp-keys/chopp.key.asc  (2001-11-22)
> 
> 
> 
> 
> _______________________________________________
> Monit-dev mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/monit-dev
> 
-- 
Rory Toma               address@hidden
VP of Run Level 5       http://www.trs80.net
Digeo Digital           http://www.digeo.com

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]