Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
/usr/sbin/wracct -i id_list [-t record_type] {process | task}
The wracct utility allows the administrator to invoke the extended accounting system, if active, to write intermediate records representing the resource usage of a selected set of processes or tasks. For tasks, a record_type option is also supported, allowing the administrator to request the writing of:
an interval record, which reflects task usage since a previous interval record (or since task creation if there is no interval record), or
a partial record, which reflects usage since task creation.
The following options are supported: -i id_list
Select the IDs of the tasks or processes to write records for. Specify id_list as a comma- or space-separated list of IDs, presented as a single argument. For some shells, this requires appropriate quoting of the argument.
Select type of record to write for the selected task or process. For tasks, record_type can be partial or interval. partial is the default type, and the only type available for process records.
The following operands are supported: process
Treat the given ID as a process ID for the purposes of constructing and writing an extended accounting record.
Treat the given ID as a task ID for the purposes of constructing and writing an extended accounting record.
Example 1 Writing a Partial Record
Write a partial record for all active sendmail processes.
# /usr/sbin/wracct -i "`pgrep sendmail`" process
Example 2 Writing an Interval Record
Write an interval record for the task with ID 182.
# /usr/sbin/wracct -t interval -i 182 task
The following exit values are returned: 0
Successful completion.
An error occurred.
Invalid command line options were specified.
Pertinent components of extended accounting facility are not active.
Extended accounting data files.
acctadm(1M), attributes(5)