Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Feb 2005 16:44:15 +0200
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        Ashwin Chandra <ashcs@ucla.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Kernel Monitor?
Message-ID:  <20050214144415.GA747@pm514-9.comsys.ntu-kpi.kiev.ua>
In-Reply-To: <000c01c5126f$354f81c0$58e243a4@ash>
References:  <000c01c5126f$354f81c0$58e243a4@ash>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 14, 2005 at 12:28:47AM -0800, Ashwin Chandra wrote:

>   FOREACH_PROC_IN_SYSTEM(p) {
>     mtx_lock(&Giant);
>     PROC_LOCK(p);
>     printf("%d %d\n", (int)p->p_stats->p_ru.ru_isrss, (int)p->p_stats->p_ru.ru_idrss);
>     PROC_UNLOCK(p);
>     mtx_unlock(&Giant);
>   }

Addition to my previous letter.  I'm not sure about Giant, but statclock()
is the only one place where ru_isrss and ru_idrss are modified, so I
think it should be enough to get sched_lock before fetching ru_isrss
and ru_idrss.  Also check locks in getrusage().



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