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

TOMOYO Linux Cross Reference
Linux/tools/bootconfig/scripts/ftrace.sh

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/bootconfig/scripts/ftrace.sh (Version linux-6.11.5) and /tools/bootconfig/scripts/ftrace.sh (Version linux-4.16.18)


  1 # SPDX-License-Identifier: GPL-2.0-only           
  2                                                   
  3 clear_trace() { # reset trace output              
  4     echo > trace                                  
  5 }                                                 
  6                                                   
  7 disable_tracing() { # stop trace recording        
  8     echo 0 > tracing_on                           
  9 }                                                 
 10                                                   
 11 enable_tracing() { # start trace recording        
 12     echo 1 > tracing_on                           
 13 }                                                 
 14                                                   
 15 reset_tracer() { # reset the current tracer       
 16     echo nop > current_tracer                     
 17 }                                                 
 18                                                   
 19 reset_trigger_file() {                            
 20     # remove action triggers first                
 21     grep -H ':on[^:]*(' $@ |                      
 22     while read line; do                           
 23         cmd=`echo $line | cut -f2- -d: | cut -    
 24         file=`echo $line | cut -f1 -d:`           
 25         echo "!$cmd" >> $file                     
 26     done                                          
 27     grep -Hv ^# $@ |                              
 28     while read line; do                           
 29         cmd=`echo $line | cut -f2- -d: | cut -    
 30         file=`echo $line | cut -f1 -d:`           
 31         echo "!$cmd" > $file                      
 32     done                                          
 33 }                                                 
 34                                                   
 35 reset_trigger() { # reset all current setting     
 36     if [ -d events/synthetic ]; then              
 37         reset_trigger_file events/synthetic/*/    
 38     fi                                            
 39     reset_trigger_file events/*/*/trigger         
 40 }                                                 
 41                                                   
 42 reset_events_filter() { # reset all current se    
 43     grep -v ^none events/*/*/filter |             
 44     while read line; do                           
 45         echo 0 > `echo $line | cut -f1 -d:`       
 46     done                                          
 47 }                                                 
 48                                                   
 49 reset_ftrace_filter() { # reset all triggers i    
 50     if [ ! -f set_ftrace_filter ]; then           
 51       return 0                                    
 52     fi                                            
 53     echo > set_ftrace_filter                      
 54     grep -v '^#' set_ftrace_filter | while rea    
 55         tr=`echo $t | cut -d: -f2`                
 56         if [ "$tr" = "" ]; then                   
 57             continue                              
 58         fi                                        
 59         if ! grep -q "$t" set_ftrace_filter; t    
 60                 continue;                         
 61         fi                                        
 62         name=`echo $t | cut -d: -f1 | cut -d'     
 63         if [ $tr = "enable_event" -o $tr = "di    
 64             tr=`echo $t | cut -d: -f2-4`          
 65             limit=`echo $t | cut -d: -f5`         
 66         else                                      
 67             tr=`echo $t | cut -d: -f2`            
 68             limit=`echo $t | cut -d: -f3`         
 69         fi                                        
 70         if [ "$limit" != "unlimited" ]; then      
 71             tr="$tr:$limit"                       
 72         fi                                        
 73         echo "!$name:$tr" > set_ftrace_filter     
 74     done                                          
 75 }                                                 
 76                                                   
 77 disable_events() {                                
 78     echo 0 > events/enable                        
 79 }                                                 
 80                                                   
 81 clear_synthetic_events() { # reset all current    
 82     grep -v ^# synthetic_events |                 
 83     while read line; do                           
 84         echo "!$line" >> synthetic_events         
 85     done                                          
 86 }                                                 
 87                                                   
 88 initialize_ftrace() { # Reset ftrace to initia    
 89 # As the initial state, ftrace will be set to     
 90 # no events, no triggers, no filters, no funct    
 91 # no probes, and tracing on.                      
 92     disable_tracing                               
 93     reset_tracer                                  
 94     reset_trigger                                 
 95     reset_events_filter                           
 96     reset_ftrace_filter                           
 97     disable_events                                
 98     [ -f set_event_pid ] && echo > set_event_p    
 99     [ -f set_ftrace_pid ] && echo > set_ftrace    
100     [ -f set_ftrace_notrace ] && echo > set_ft    
101     [ -f set_graph_function ] && echo | tee se    
102     [ -f stack_trace_filter ] && echo > stack_    
103     [ -f kprobe_events ] && echo > kprobe_even    
104     [ -f uprobe_events ] && echo > uprobe_even    
105     [ -f synthetic_events ] && echo > syntheti    
106     [ -f snapshot ] && echo 0 > snapshot          
107     clear_trace                                   
108     enable_tracing                                
109 }                                                 
                                                      

~ [ 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