ITEM: RTA000040246

Can the TPROF command be used to measure activity of the entire                 
system for a period of time, without specifying any one command to              
monitor?  ie, can I run TPROF during the execution of a long batch              
application to see what is happening at particular time intervals               
during the batch process?                                                       
Also, is there a rule of thumb to consider for filespace to be                  
consumed by the output of the TPROF command?  Does it grow dynamically          
larger output files if it is run for longer periods of time?  Or                
does it just give a finite set of results regardless of the duration            
of the monitoring?                                                              
---------- ---------- ---------- --------- ---------- ----------                
A:    These are the answers to your questions:                                  
     1.  Yes, TPROF command can be used to measure the activity                 
         of the entire system for a period of time, without                     
         specifying a particular command to monitor.  This command              
         will give you a profile of current system activities.                  
         To do this, follow the following steps:                                
                mkdir tprof                                                     
                cd tprof                                                        
                cp /usr/bin/sleep .                                             
                tprof -p sleep -v -x sleep                             
         After this series of executions, TPROF will profile the                
         sleep command along with all other processes.  The                     
         results will be found in the file "__sleep.all".                       
     2.  We set up the next example to show source code profiling while         
         running TPROF during the execution of a long batch application,        
         you can execute the application in one window, while running           
         TPROF in another one.  We tested this in the following way:            
               Window 1:  compiled source code of test.c with                   
                          the command                                           
                       cc -qlist -g -o test test.c                              
                          then start the application program.                   
               Window 2:  ran TPROF with the command                            
                       tprof -p test -v -k -x sleep                   
     The following is a sample output extracted from the __test.all             
     First report: Individual process report  (edited for length)               
            Process    PID  Total   Kernel   User   Shared  Other               
            =======    ===  =====   ======   ====   ======  =====               
            wait      514  36085    36085      0        0      0                
            test    69471   1870     1676     24      170      0                
      ..X11/bin/X   13269    855      459    183      213      0                
             xant   71308    709      301     68      340      0                
           aixterm  24741    533      102     57      374      0                
            =======    ===  =====    ======   ====   ======  =====              
            Total           50124     46358   1195    2571     0                
     Second report: Overall totals by program name                              
            Process   FREQ  Total   Kernel   User   Shared  Other               
            =======    ===  =====   ======   ====   ======  =====               
             wait        1  36085    36085      0        0    0                 
              bsh      767   3394     3211    179        4    0                 
             test        1   1870     1676     24      170    0                 
            aixterm     12   1636      673    157      806    0                 
          /bin/test    446   1044     1007      2       35    0                 
       ...X11/bin/X      1    855      459    183      213    0                 
     Note:  These outputs were edited to reduce length.                         
     Also, note that the source code "hot list" will be in                      
     We recommend using 'tprof' for short time intervals (a few                 
     minutes maximum at one time).  The reason for this is because              
     'tprof' runs in 'trace', which uses memory buffers that fill up.           
     3.  When we tested 'tprof', the output took approximately                  
         700,000 bytes.  It grows dynamically up to the time                    
         when it runs out of resources (diskspace, memory in                    
         the private data segment), and will give invalid                       
         results.  If 'trace' overruns its buffers, you can get                 
         invalid results.  Check the summary report total                      
         column.  The total number of clock ticks reported should               
         equal *100.                                                   
---------- ---------- ---------- --------- ---------- ----------                
This item was created from library item Q655076      CQGFG                      
Additional search words:                                                        
RISCSYSTEM SOFTWARE SPECIFICS SYS TPROF TUNE                                    

WWQA: ITEM: RTA000040246 ITEM: RTA000040246
Dated: 03/1996 Category: RISCPERF
This HTML file was generated 99/06/24~12:43:15
Comments or suggestions? Contact us