ja(1)                                                                    ja(1)


NAME
     ja - starts and stops user job accounting information

SYNOPSIS
     ja [-a ash] [-c] [-d] [-D level] [-e] [-f] [-g gid] [-h] [-j jid] [-J]
     [l] [m] [-M marks] [-n names] [-o] [-p projid] [-r] [-s] [-t] [-u uid]
     [file]

DESCRIPTION
     The ja command provides job-related accounting information.  This
     information is taken from the job accounting file to which the kernel
     writes, provided that job accounting is enabled.  The job accounting file
     can be either the file you provide or the default, described in the
     following.  ja provides information only about terminated processes.  The
     login shell and the current ja command being executed are active
     processes and are not reported by ja.  See ps(1) for information about
     active processes.

     To enable job accounting, use the ja command.  You may specify only the
     mark option (-m) and the optional file name when enabling.  If the job
     accounting file does not exist, ja creates it.  If the file does exist,
     accounting information is appended to the existing file.  If job
     accounting is already enabled and the optional filename specified is a
     file other than the currently active job accounting file, the newly
     specified file becomes the job accounting file.

     If you do not specify the optional filename, the ACCT_TMPDIR environment
     variable must be set to a directory.  A default name of the following
     form is then used:

          $ACCT_TMPDIR/.jacct<jid>

     The ACCT_TMPDIR environment variable is not exported in at(1) or
     crontab(1) jobs.  You must specify the job accounting filename in the
     at(1) or crontab(1) commands; otherwise, ja will abort.

     On normal termination of job accounting (-t specified), ja removes the
     default job accounting file and disables job accounting.  If you specify
     the optional filename when enabling, specify the same name when
     terminating.  The optional job accounting file is not deleted by the ja
     command.

     The ja command lets you mark the positions of various commands
     (processes) by writing the position of the next accounting record to be
     processed to standard output.  You can use these marks when generating
     reports to restrict the information reported.

     There are four groups of options you can use with the ja command:
          Report selection options
            -c, -f, -o, -s
          Record selection options
            -a ash, -g gid, -j jid, -M marks, -n names, -p projid, and -u uid


          Report modifier options
            -d, -e, -h, -J, -l
          Special options (debug, mark, raw, and disable)
            -D, -m, -r, and -t

   Report Selection Options
     The ja command can produce different types of reports by using the -c,
     -f, -o, and -s options.  The report-selection options are first
     summarized and then described in detail.

     In summary, the report selection options are as follows:

     -c   Produces the command report (-c and -o are mutually exclusive).

     -f   Produces the command flow report.

     -o   Produces the other (alternative) command report (-o and -c are
          mutually exclusive).

     -s   Produces the summary report.

     Described in detail, the report selection options are as follows:

     -c   Produces a command report.  The following fields are reported when
          you specify the -c option with the -l option or with the -l and -h
          options.  These fields provide statistics about individual
          processes.

            Command Name             First 16 characters of the name of the
                                     command that was executed.

            Started At               Start time of the process.

            Elapsed Seconds          Elapsed time of the process.

            User CPU Seconds         Amount of CPU time the process consumed
                                     while it was executing in user mode.

            Sys CPU Seconds          Amount of CPU time the process consumed
                                     while it was executing in system mode.

            Run Queue Wait Secs      Amount of time the process waits for the
                                     CPU.

            Blk I/O Wait Secs        Amount of time the process waits for
                                     block I/O completion.

            Raw I/O Wait Secs        Amount of time the process waits for raw
                                     I/O completion.


            CPU MEM Avg Mbytes       (-l) Average amount of memory that this
                                     process used.  This value is calculated
                                     by dividing the memory integral by the
                                     total CPU time (system + user CPU time).
                                     For more information on memory integrals,
                                     see the IRIX Admin: Resource
                                     Administration manual.

            Characters Read          (-l) Number of characters in Mbytes read
                                     by the read, reada, and lio_listio system
                                     calls (see read(2), reada(2), and
                                     lio_listio(3)).

            Characters Written       (-l) Number of characters in Mbytes
                                     written by the write,  writea, and
                                     lio_listio system calls (see write(2),
                                     writea(2), and lio_listio(3)).

            Blocks Read              (-l) Number of blocks read by the read,
                                     reada, and lio_listio system calls (see
                                     read(2), reada(2), and lio_listio(3)).

            Blocks Written           (-l) Number of blocks written by the
                                     write, writea, and lio_listio system
                                     calls (see writea(2), writea(2), and
                                     lio_listio(3)).

            Logical I/O Read         (-l) Number of logical I/O read requests
                                     that the process performed.  A logical
                                     I/O request is performed each time a
                                     process calls a read or reada system
                                     call.

            Logical I/O Written      (-l) Number of logical I/O write requests
                                     that the process performed.  A logical
                                     I/O write request is performed each time
                                     a process calls a write or writea system
                                     call.

            CoreMem HiValue          (-h) (-l) Maximum amount of core memory
                                     the process used at any one time.  The
                                     value is reported in Kbytes.

            VirtMem HiValue          (-h) (-l) Maximum amount of virtual
                                     memory the process used at any one time.
                                     The value is reported in Kbytes.

            Ex St                    (-l) Lower 8 bits from the exit status of
                                     the process.  See wait(2) for more
                                     information.


            Ni                       (-l) The last nice value of the process;
                                     reported when the total CPU time (user +
                                     system CPU time) is less than 1 second.
                                     If the total CPU time is greater than or
                                     equal to 1 second, the minimum nice value
                                     at 1 second and onward is listed.  The
                                     minimum nice value corresponds to the
                                     highest priority the process was niced.

            Fl                       (-l) Accounting flag.  The following
                                     values are available:

                                     F      The process forked but did not
                                            execute.

                                     S      The process used superuser
                                            privileges.

                                     The accounting flags are defined in
                                     /usr/include/sys/acct.h.

            SBUs                     System billing unit (SBU) for the
                                     process.  The system administrator
                                     configures SBU calculations.  For more
                                     information, see the IRIX Admin: Resource
                                     Administration manual.

     -f     Produces a command flow report.  This report provides information
            on the parent/child relationships of processes and, if you specify
            the -l option, CPU user and system time (in seconds).

     -o     Produces an alternative (other) command report.  The -o option
            report contains the following fields, which show statistics about
            individual processes.

            Command Name              First 16 characters of the name of the
                                      command that was executed.

            Started At                Start time of the process.

            Elapsed Seconds           Elapsed time of the process.

            Proc ID                   Process ID of the current process.

            Parent ProcID             Process ID of the parent process.

            Number of Swaps           Number of swaps for the current process.

            CoreMem HiWater           Maximum amount of core memory the
                                      process used at any one time.  The value
                                      is reported in Kbytes.


            VirtMem HiWater           Maximum amount of virtual memory the
                                      process used at any one time.  The value
                                      is reported in Kbytes.

     -s     Produces a summary report.  The -s option report contains the
            following fields, which provide accumulated usage statistics for
            the reporting period.

            Job Accounting Filename       Name of the file to which the kernel
                                          writes the ja accounting records.

            Operating System              Operating system name, node name,
                                          release, version, and hardware type.

            User Name (ID)                Name and user ID of the real user.

            Group Name (ID)               Name and group ID of the real group.

            Project Name (ID)             Project name and project number that
                                          this process uses.  Multiple project
                                          ID usage is listed, but not
                                          individual projects.

            Array Session Handle          Array Session Handle associated with
                                          these processes.

            Job ID                        Job ID associated with these
                                          processes.

            Report Starts                 Starting time of the process that
                                          began first during the reporting
                                          period.

            Report Ends                   Ending time of the process that was
                                          the last to complete during the
                                          reporting period.

            Elapsed Time                  Duration of the reporting period in
                                          seconds (the difference between the
                                          report ending and starting times).

            User CPU Time                 Total CPU time (in seconds) used
                                          during the reporting period while
                                          the processes were in user mode.

            System CPU Time               Total CPU time (in seconds) used
                                          during the reporting period while
                                          the processes were in system mode.

            Run Queue Wait Time           Total time (in seconds) during the
                                          reporting period while the processes
                                          were waiting for the CPU.


            Block I/O Wait Time           Total time (in seconds) during the
                                          reporting period while the processes
                                          were waiting for block I/O
                                          completion.

            Raw I/O Wait Time             Total time (in seconds) during the
                                          reporting period while the processes
                                          were waiting for raw I/O completion.

            CPU Time Core Memory Integral (Mbyte-seconds)
                                          Sum of the core memory integrals for
                                          all processes.  For more information
                                          on memory integrals, see the IRIX
                                          Admin: Resource Administration
                                          manual.

            CPU Time Virtual Memory Integral (Mbyte-seconds)
                                          Sum of the virtual memory integrals
                                          for all processes.

            Maximum Core Memory Used (Mbytes)
                                          Largest single high-water core
                                          memory usage value among the
                                          processes within the job (not an
                                          aggregate total).

            Maximum Virtual Memory Used (Mbytes)
                                          Largest single high-water virtual
                                          memory usage value among the
                                          processes within the job (not an
                                          aggregate total).

            Characters Read               Total number of characters read by
                                          the read(2), reada(2), and
                                          lio_listio(3) system calls by all
                                          processes in the reporting period.

            Characters Written            Total number of characters written
                                          by the write(2), writea(2), and
                                          lio_listio(3) system calls by all
                                          processes in the reporting period.

            Blocks Read                   Total number of blocks read by the
                                          read(2), reada(2), and lio_listio(3)
                                          system calls by all processes in the
                                          reporting period.

            Blocks Written                Total number of characters written
                                          by the write(2), writea(2), and
                                          lio_listio(3) system calls by all
                                          processes in the reporting period.


            Logical I/O Read Requests     Total number of read(2) and reada(2)
                                          system calls executed by all
                                          processes in the reporting period.

            Logical I/O Write Requests    Total number of write(2) and
                                          writea(2) system calls executed by
                                          all processes in the reporting
                                          period.

            Number of Commands            Total number of commands that
                                          completed during the reporting
                                          period.

            System Billing Units          Sum of the system billing units
                                          (SBUs) of all processes.

   Mark and Disable Options
     The mark and disable options are as follows:

     -m     Writes the position of the next accounting record to standard
            output.  This can be used to mark various positions within the job
            accounting file for later use with the -M option.  The position
            marked is the byte offset of the current end-of-information of the
            job accounting file.  (-m cannot be used with the report selection
            and modifier options nor with the -t disable option.)

     -t     Disables (terminates) job accounting.  (-m and -t are mutually
            exclusive).

   Record Selection Options
     -a ash    Report is for this array session handle (ash) only.

     -g gid    Report is for this group identifier (gid) or group name only.

     -j jid    Report is for this job identifier (jid) only.

     -u uid    Report is for this user identifier (uid) or user name only.

     -n names  Shows only commands matching names patterns that may be regular
               expressions, as in regcmp(3G).

     -p projid Report is for this project identifier (projid) or project name
               only.

     -M marks  Shows only commands within the marked range.  This can be a
               list of ranges with each list item having the following form:

               .                   First command preceding current position

               m1                  First command following mark


               m1:                 All commands between the mark and EOF

               m1:m2               All commands between the two marks

               :m1                 All commands between BOF and the mark

               :                   All commands between BOF and EOF (default)

               See the -m option for information on how to obtain marks.  The
               -M option must be used with the -c option.

   Report Modifier Options
     Report modifier options must be used with at least one report selection
     option.  The report modifier options are as follows:

     -d     Reports on NQS and tape usage.

     -e     Generates an extended summary report; you must use -e with the -s
            option.  The following are descriptions of fields produced by
            specifying the -e option with the -s option.  These fields provide
            additional accumulated statistics for the reporting period:

            Number of Swaps        Number of times the processes were swapped
                                   out of memory.

     -h     Provides the largest amount of core and virtual memory the process
            used at one time in 1K units.  Used only with both the -c and -l
            options.

     -J     Includes information about start and end of job records in the
            report when used with the -c option.  Includes summary information
            about record types when used with the -s option.

     -l     Provides additional information when used with the -c or -f
            options.

     -r     Raw mode, no headers are printed.

     -D     Enables debugging for the ja command.  Valid values are 1 through
            4.  Debugging is off by default.  A debug level greater than one
            provides program flow information.  A debug level greater than
            three provides additional information about records which are
            skipped over due to the requested ja record selection options.

EXAMPLES
     Examples 1 and 2 show the usage of the -m and -M options with standard
     shell and Korn shell variables.

     Example 1:


          ja                #enable job accounting
               .
               .  (Miscellaneous commands)
               .
          m1=`ja -m`        #mark job accounting file's current position
               .
               .  (Commands of special interest)
               .
          m2=`ja -m`        #mark job accounting file's current position
               .
               .  (Miscellaneous commands)
               .
          ja -cM $m1:$m2   #print command report from mark m1 to mark m2
          ja -st           #print summary report for entire session and disable
                            job accounting

     Example 2:

          ja            #enable job accounting
               .
               .  (Miscellaneous commands)
               .
          m1=`ja -m`    #mark job accounting file's current position
               .
               .  (Commands of special interest)
               .
          ja -cM $m1:   #print command report from mark to EOF
               .
               .  (Miscellaneous commands)
               .
          ja -st        #print summary report for entire session and disable
                         job accounting

     Example 3:

     This example shows example output when you use the -c option.

          Job Accounting - Command Report
          ===============================

          Command  Started Elapsed User CPU Sys CPU Run Queue  Blk I/O   Raw I/O
           Name     At     Seconds Seconds  Seconds Wait Secs Wait Secs Wait Secs SBU's
          ======= ======== ======= ======== ======= ========= ========= ========= =====
          # CFG ON(  1) (    6)  18:13:39 01/23/2000  System: bugatti 6.5-ALPHA-1286745 IP27
          ja      18:13:38    0.32     0.31    0.01      0.00      0.00      0.00  0.00
          who     18:13:46    0.03     0.00    0.01      0.01      0.02      0.00  0.00
          pwd     18:13:49    0.03     0.00    0.01      0.02      0.01      0.00  0.00
          ja      18:14:05    0.02     0.00    0.01      0.01      0.00      0.00  0.00


     The # CFG ON output line is a configuration record written when job
     accounting was enabled via the ja command.  This record contains the
     daemon accounting types enabled, record accounting types enabled, last
     system boot-time, and system identification information.

     Example 4:

     The following example shows the output of the -s option:

          Job CSA Accounting - Summary Report
          ====================================

          Job Accounting File Name         : /tmp/ja.username
          Operating System                 : IRIX64 snow 6.5 10120733 IP27
          User Name (ID)                   : username (10320)
          Group Name (ID)                  : resmgmt (16061)
          Project Name (ID)                : CSA(40)
          Array Session Handle             : 0x000000000000034b
          Job ID                           : 0x310
          Report Starts                    : 01/23/00 18:13:38
          Report Ends                      : 01/23/00 18:17:05
          Elapsed Time                     :          207      Seconds
          User CPU Time                    :            0.9340 Seconds
          System CPU Time                  :            0.0643 Seconds
          Run Queue Wait Time              :            0.6463 Seconds
          Block I/O Wait Time              :            0.1888 Seconds
          Raw I/O Wait Time                :            0.1323 Seconds
          CPU Time Core Memory Integral    :            0.4305 Mbyte-seconds
          CPU Time Virtual Memory Integral :            4.3298 Mbyte-seconds
          Maximum Core Memory Used         :            0.1094 Mbytes
          Maximum Virtual Memory Used      :           38.0000 Mbytes
          Characters Read                  :            0.0603 Mbytes
          Characters Written               :            0.0023 Mbytes
          Blocks Read                      :            7
          Blocks Written                   :            0
          Logical I/O Read Requests        :           35
          Logical I/O Write Requests       :           42
          Number of Commands               :            7
          System Billing Units             :            0.0000


SEE ALSO
     at(1), crontab(1), csa(1M), csacom(1), sh(1), read(2), reada(2), wait(2),
     write(2), writea(2), lio_listio(3).


                                                                       Page 10