Thursday, March 17, 2011

AIX PERFORMANCE TOOLS TPROF VMSTAT SAR AND MPSTAT EXAMPLES

THESE EXAMPLES ARE TAKEN FROM THE MAN PAGE OF THESE COMMANDS


TPROF EXAMPLES


       1Basic global program and thread-level summary . This command will give you details of cpu utilization of each process
$ tprof -x sleep 10
 Mon May 20 00:39:26 2002 System: AIX 5.2 Node: dreaming Machine: 000671894C00
            Starting Command sleep 10
            stopping trace collection.
            Generating sleep.prof
            The resulting sleep.prof file only contains the summary report section.


       2    Global profiling with all options
            $ tprof -skeuj -x sleep 10
            Mon May 20 00:39:26 2002
            System: AIX 5.2 Node: drea
            ming Machine: 000671894C00
            Starting Command sleep 10
            stopping trace collection.
            Generating sleep.prof
            The resulting sleep.prof file contains the summary report and global profile sections.
       3    Single process level profiling
            $ tprof -u -p workload -x workload
            Mon May 20 00:39:26 2002
            System: AIX 5.2 Node: drea
            ming Machine: 000671894C00
            Starting Command workload stopping trace collection.
            Generating workload.prof
            The resulting workload.prof file contains the summary report and the global user mode profile sections, and one process level profile
            section for the process 'workload' that contains only a user mode profile subsection.
       4    Multiple process level profiling
            $ tprof -se -p send,receive -x startall
            Mon May 20 00:39:26 2002
            System: AIX 5.2 Node: dreaming Machine: 000671894C00
            Starting Command startall
            stopping trace collection.
            Generating startall.prof
            The resulting startall.prof file contains the summary report, the global shared library mode profile, and the global kernel extension
            profile sections, and two process level profile sections: one for the process 'send', and one for the process 'receive'. The process
            level sections each contain two subsections: one with shared library profiling information and one with kernel extensions profiling
            information.
       5    Microprofiling and listing annotation
            $ tprof -m ./tcalc -L ./tcalc -u -x ./tcalc
            Mon May 20 00:47:09 2002
            System: AIX 5.2 Node: dreaming Machine: 000671894C00
            Starting Command ./tcalc
            stopping trace collection.
            Generating tcalc.prof
            Generating tcalc.tcalc.c.mprof
            Generating tcalc.tcalc.c.alst
            The resulting tcalc.prof file contains the summary report and the global user mode profile sections. The resulting tcalc.tcalc.c.mprof
            and tcalc.tcalc.c.alst files contain the micro-profiling report and the annotated listing.
       6    For event-based profiling on processor cycles, sampling once every 100 milliseconds, enter:
                    tprof -E -f 100 -Askex sleep 10
            Output similar to the following displays:
                    Starting Command sleep 10
                    stopping trace collection.
                    Tue Apr 26 14:44:02 2005
                    System: AIX 5.3 Node: bigdomino Machine: 00C0046A4C00
                    Generating sleep.trc
                    Generating sleep.prof
                    Generating sleep.syms
       7    For event-based profiling on completed instructions, sampling once every 20,000 completed instructions, enter:
                    tprof -E PM_INST_CMPL -f 20000 -Askex sleep 10
            Output similar to the following displays:
                    Starting Command sleep 10
                    stopping trace collection.
                    Tue Apr 26 14:42:44 2005
                    System: AIX 5.3 Node: bigdomino Machine: 00C0046A4C00
                    Generating sleep.trc
                    Generating sleep.prof
                    Generating sleep.syms
       8    For event-based profiling on emulation interrupts, sampling once every 10,000 events, enter:
                    tprof -E EMULATION -Askex sleep 10
            Output similar to the following displays:
                    Starting Command sleep 10
                    stopping trace collection.
                    Tue Apr 26 14:41:44 2005
                    System: AIX 5.3 Node: bigdomino Machine: 00C0046A4C00
                    Generating sleep.trc
                    Generating sleep.prof
                    Generating sleep.syms
       9    Automated offline mode
            tprof -c -A all -x sleep 10
            Starting Command sleep 10
            stopping trace collection.
            Mon May 20 00:52:52 2002
            System: AIX 5.2 Node: dreaming Machine: 000671894C00
            Generating sleep.ctrc
            Generating sleep.csyms
            Generating sleep.prof
            The resulting sleep.prof file only has a summary report section, while the two cooked files are ready to be re-postprocessed.
       10   Automated offline mode enabling source line collecting.
            $ tprof -A -N -x sleep 10
            Starting Command sleep 10
            stopping trace collection.
            Wed Feb  8 15:12:41 2006
            System: AIX 5.3 Node: aixperformance Machine: 000F9F3D4C00
            Generating sleep.trc
            Generating sleep.prof
            Generating sleep.syms
            The resulting sleep.prof file only contains the summary report section, while sleep.syms contains the source line information.
       11   Automated offline mode enabling source line and instruction collecting.
            $ tprof -A -N -I -r RootString -x sleep 10
            Starting Command sleep 10
            stopping trace collection.
            Wed Feb  8 15:16:37 2006
            System: AIX 5.3 Node: aixperformance Machine: 000F9F3D4C00
            Generating RootString.trc
            Generating RootString.prof
            Generating RootString.syms
            The resulting rootstring.prof file is generated, while rootstring.syms contains the source line information and binary instructions.
       12   Real-time mode enabling Java source line and instructions collecting.
            $ tprof -N -I -x java -Xrunjpa:source=1,instructions=1 HelloAIX
            Thu Feb  9 13:30:38 2006
            System: AIX 5.3 Node: perftdev Machine: 00CEBB4A4C00
            Starting Command java -Xrunvpn_jpa:source=1,instructions=1 HelloAIX
            Hello AIX!
            stopping trace collection.
            Generating java.prof
            The resulting java.prof file is generated, and it contains the JIT source line information as well as JIT instructions.
       13   Processor usage for the vloop_lib_32 program with no shared library and thread-level profiling, no per-processor tracing, and no post
            processing:
            $ tprof -A -n -s -t -r test -x vloop_lib_32 5
            Starting Command vloop_lib_32 5
            stopping trace collection.
            Generating test.trc
            Generating test.syms

EXAMPLES OF SAR


       1    To report system unit activity, enter:
            sar
       2    To report current tty activity for each 2 seconds for the next 40 seconds, enter: sar -y -r 2 20
       3    To watch system unit for 10 minutes and sort data, enter: sar -o temp 60 10
       4    To report processor activity for the first two processors, enter: sar -u -P 0,1
            This produces output similar to the following:
            cpu  %usr  %sys  %wio  %idle
            0      45    45     5      5
            1      27    65     3      5
       5    To report message, semaphore, and processor activity for all processors and system-wide, enter: sar -mu -P ALL
            On a four-processor system, this produces output similar to the following (the last line indicates system-wide statistics for all
            processors):
            cpu  msgs/s  sema/s  %usr  %sys  %wio  %idle
            0      7       2       45    45     5     5
            1      5       0       27    65     3     5
            2      3       0       55    40     1     4
            3      4       1       48    41     4     7
            -     19       3       44    48     3     5
       6    To see physical processor consumed and entitlement consumed for all processors system-wide, run sar command in a shared processor
            logical partition machine, as follows:
            sar -P ALL
            On a two-logical processor system, this produces output similar to the following (the last line indicates system-wide statistics for all
            processors, and the line with cpuid U indicates the system-wide Unused capacity):
            cpu    %usr    %sys    %wio   %idle   physc   %entc
             0        0       0       0     100    0.02     3.1
             1        0       0       0     100    0.00     1.0
             U        -       -       0      96    0.48    96.0
             -        0       0       0     100    0.02     4.0
       7    To report system call, kernel process, and paging activities with separate headers for each of the three lines of data at each iteration
            for every 2 seconds for the next 40 seconds, enter:
            sar -Mckr 2 20
       8    To report all activities with multiple sets of headers for every 2 seconds for the next 40 seconds, enter:
            sar -MA 2 20


VMSTAT EXAMPLES




       1    To display a summary of the statistics since boot, enter:
            vmstat
       2    To display five summaries at 2-second intervals, enter:
            vmstat 2 5
       3    To display a summary of the statistics since boot including statistics for logical disks scdisk13 and scdisk14, enter:
            vmstat scdisk13 scdisk14
       4    To display fork statistics, enter:
            vmstat  -f
       5    To display the count of various events, enter:
            vmstat -s
       6    To display time-stamp next to each column of output of vmstat, enter:
            vmstat -t
       7    To display the I/O oriented view with an alternative set of columns, enter:
            vmstat -I
       8    To display all the VMM statistics available, enter:
            vmstat -vs
       9    To display the large-page section with the alp and flp columns at 8-second intervals, enter:
            vmstat -l 8
       10   To display the VMM statistics specific to a particular page size (in the example, 4 K), enter:
            vmstat -p 4 K
       11   To display the VMM statistics for all page sizes that are supported on the system, enter:
            vmstat -p ALL
            OR
            vmstat -p all
       12   To display only the VMM statistics for a particular page size (in this example, 4K), enter:
            vmstat -P 4K
       13   To display only the per-page breakdown of VMM statistics for all supported page sizes, enter:
            vmstat -P ALL
            OR
            vmstat -P all


MPSTAT EXAMPLES


       1    To see the default set of utilization metrics, type:
            mpstat 1 1
       2    To see the default set of utilization metrics in wide display mode, type:
            mpstat -w 1 1
       3    To see the detailed dispatch & affinity metrics, type:
             mpstat -d 1 1
       4    To see the detailed interrupts report, type:
            mpstat -i 1 1
       5    To see all the statistics, type:
            mpstat -a 1 1
       6    To see simultaneous multi-threading utilization, type:
            mpstat -s 1 1

USEFUL POSTS IN THIS SERIES

No comments:

Post a Comment

LIST OF BLOGS MONTH WISE