I think Ryan was looking for a kstat, and not using the /proc but you do
get what you want with /proc
There are per zone CPU kstats for zones if you bind a zone to CPUs via
resource controls or via resource pools. If the zones are sharing CPU
with other zones, the CPU kstats you see if for all the zones.
These are the kstats which are visible to callers in the non-global zone
and they will only see these kstats of the CPUs assigned to those zones...
(module:instance:name:class)
- unix:<psetid>:pset:misc
- cpu_info:<processorid>:cpu_info<processorid>:misc
- cpu:<processorid>:sys:misc
- cpu:<processorid>:vm:misc
- cpu_stat:<processorid>:cpu_stat<processorid>:misc
- cpu:<processorid>:intrstat:misc
If you are looking for something like ...
cpu_info:<processorid_zoneid>:cpu_info<processorid>:misc
you are out of luck.
IIRC, there is no kstat for per zone memory usage. There is one for
swap ...
caps:{zoneid}:swapresv_zone_{zoneid}
rickey c weisner wrote:
> prstat -Z ?
>
> ZONEID NLWP SIZE RSS MEMORY TIME CPU ZONE
>
> 5 382 6206M 3575M 14% 1:54:23 0.1% foo2
>
> 2 396 6189M 3581M 14% 2:05:30 0.1% foo7
>
> 7 385 6190M 3567M 14% 2:01:07 0.1% foo3
>
> 8 381 6198M 3581M 14% 1:58:00 0.1% foo5
>
> 6 388 6191M 3588M 14% 2:07:39 0.1% foo4
>
>
> On Wed, Dec 12, 2007 at 12:33:56PM -0500, Matty wrote:
>> Date: Wed, 12 Dec 2007 12:33:56 -0500
>> From: Matty <[EMAIL PROTECTED]>
>> Subject: [zones-discuss] Getting memory and CPU usage per zone
>> To: zones-discuss <[email protected]>
>> Errors-to: [EMAIL PROTECTED]
>> Precedence: list
>> X-BeenThere: [email protected]
>> Delivered-to: [email protected]
>> X-PMX-Version: 5.2.0.264296
>> X-Brightmail-Tracker: AAAAAA==
>> X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on
>> oss-mail1.opensolaris.org
>> X-Original-To: [email protected]
>> X-Mailman-Version: 2.1.9
>> List-Post: <mailto:[email protected]>
>> List-Subscribe: <http://mail.opensolaris.org/mailman/listinfo/zones-discuss>,
>> <mailto:[EMAIL PROTECTED]>
>> List-Unsubscribe:
>> <http://mail.opensolaris.org/mailman/listinfo/zones-discuss>,
>> <mailto:[EMAIL PROTECTED]>
>> List-Archive: <http://mail.opensolaris.org/pipermail/zones-discuss>
>> List-Help: <mailto:[EMAIL PROTECTED]>
>> List-Id: Zones General Discussion <zones-discuss.opensolaris.org>
>> Original-recipient: rfc822;[EMAIL PROTECTED]
>> X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable
>> version=3.2.3
>> X-Spam-Level:
>>
>> Howdy,
>>
>> I am been digging through the kstats on my Nevada build 74 machine,
>> but cannot seem to find a kstat that shows how much memory or CPU is
>> used by a zone. Does anyone happen to know if there is a simple way to
>> programmatically determine this? Are there any plans to add additional
>> per zone kstats?
>>
>> Thanks,
>> - Ryan
>> --
>> UNIX Administrator
>> http://prefetch.net
>> _______________________________________________
>> zones-discuss mailing list
>> [email protected]
>
--
-----------------------------------------------------------------------
______ Joseph Balenzano
/_____/\ ISV Engineering
/____ \\ \ Sun Microsystems Inc.
/_____\ \\ / 2 Stamford Plaza, 12th Floor
/_____/ \/ / / 281 Tresser Blvd
/_____/ / \//\ Stamford, CT 06901
\_____\//\ / /
\_____/ / /\ / [EMAIL PROTECTED]
\_____/ \\ \ Phone/Fax: (203) 653-4186
\_____\ \\
\_____\/
----------------------------------------------------------------------
_______________________________________________
zones-discuss mailing list
[email protected]