~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/Documentation/callchain-overhead-calculation.txt

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/perf/Documentation/callchain-overhead-calculation.txt (Version linux-6.12-rc7) and /tools/perf/Documentation/callchain-overhead-calculation.txt (Version policy-sample)


  1 Overhead calculation                              
  2 --------------------                              
  3 The overhead can be shown in two columns as 'C    
  4 perf collects callchains.  The 'self' overhead    
  5 adding all period values of the entry - usuall    
  6 This is the value that perf shows traditionall    
  7 'self' overhead values should be 100%.            
  8                                                   
  9 The 'children' overhead is calculated by addin    
 10 the child functions so that it can show the to    
 11 higher level functions even if they don't dire    
 12 'Children' here means functions that are calle    
 13 function.                                         
 14                                                   
 15 It might be confusing that the sum of all the     
 16 values exceeds 100% since each of them is alre    
 17 'self' overhead of its child functions.  But w    
 18 can find which function has the most overhead     
 19 spread over the children.                         
 20                                                   
 21 Consider the following example; there are thre    
 22                                                   
 23 -----------------------                           
 24 void foo(void) {                                  
 25     /* do something */                            
 26 }                                                 
 27                                                   
 28 void bar(void) {                                  
 29     /* do something */                            
 30     foo();                                        
 31 }                                                 
 32                                                   
 33 int main(void) {                                  
 34     bar()                                         
 35     return 0;                                     
 36 }                                                 
 37 -----------------------                           
 38                                                   
 39 In this case 'foo' is a child of 'bar', and 'b    
 40 child of 'main' so 'foo' also is a child of 'm    
 41 'main' is a parent of 'foo' and 'bar', and 'ba    
 42                                                   
 43 Suppose all samples are recorded in 'foo' and     
 44 recorded with callchains the output will show     
 45 in the usual (self-overhead-only) output of pe    
 46                                                   
 47 ----------------------------------                
 48 Overhead  Symbol                                  
 49 ........  .....................                   
 50   60.00%  foo                                     
 51           |                                       
 52           --- foo                                 
 53               bar                                 
 54               main                                
 55               __libc_start_main                   
 56                                                   
 57   40.00%  bar                                     
 58           |                                       
 59           --- bar                                 
 60               main                                
 61               __libc_start_main                   
 62 ----------------------------------                
 63                                                   
 64 When the --children option is enabled, the 'se    
 65 child functions (i.e. 'foo' and 'bar') are add    
 66 calculate the 'children' overhead.  In this ca    
 67 displayed as:                                     
 68                                                   
 69 -------------------------------------------       
 70 Children      Self  Symbol                        
 71 ........  ........  ....................          
 72  100.00%     0.00%  __libc_start_main             
 73           |                                       
 74           --- __libc_start_main                   
 75                                                   
 76  100.00%     0.00%  main                          
 77           |                                       
 78           --- main                                
 79               __libc_start_main                   
 80                                                   
 81  100.00%    40.00%  bar                           
 82           |                                       
 83           --- bar                                 
 84               main                                
 85               __libc_start_main                   
 86                                                   
 87   60.00%    60.00%  foo                           
 88           |                                       
 89           --- foo                                 
 90               bar                                 
 91               main                                
 92               __libc_start_main                   
 93 -------------------------------------------       
 94                                                   
 95 In the above output, the 'self' overhead of 'f    
 96 'children' overhead of 'bar', 'main' and '\_\_    
 97 Likewise, the 'self' overhead of 'bar' (40%) w    
 98 'children' overhead of 'main' and '\_\_libc_st    
 99                                                   
100 So '\_\_libc_start_main' and 'main' are shown     
101 same (100%) 'children' overhead (even though t    
102 overhead) and they are the parents of 'foo' an    
103                                                   
104 Since v3.16 the 'children' overhead is shown b    
105 is sorted by its values. The 'children' overhe    
106 specifying --no-children option on the command    
107 'report.children = false' or 'top.children = f    
108 file.                                             
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php