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

TOMOYO Linux Cross Reference
Linux/arch/x86/include/asm/ftrace.h

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 /arch/x86/include/asm/ftrace.h (Architecture m68k) and /arch/i386/include/asm-i386/ftrace.h (Architecture i386)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 #ifndef _ASM_X86_FTRACE_H                         
  3 #define _ASM_X86_FTRACE_H                         
  4                                                   
  5 #include <asm/ptrace.h>                           
  6                                                   
  7 #ifdef CONFIG_FUNCTION_TRACER                     
  8 #ifndef CC_USING_FENTRY                           
  9 # error Compiler does not support fentry?         
 10 #endif                                            
 11 # define MCOUNT_ADDR            ((unsigned lon    
 12 #define MCOUNT_INSN_SIZE        5 /* sizeof mc    
 13                                                   
 14 /* Ignore unused weak functions which will hav    
 15 #ifdef CONFIG_HAVE_FENTRY                         
 16 # include <asm/ibt.h>                             
 17 /* Add offset for endbr64 if IBT enabled */       
 18 # define FTRACE_MCOUNT_MAX_OFFSET       ENDBR_    
 19 #endif                                            
 20                                                   
 21 #ifdef CONFIG_DYNAMIC_FTRACE                      
 22 #define ARCH_SUPPORTS_FTRACE_OPS 1                
 23 #endif                                            
 24                                                   
 25 #ifndef __ASSEMBLY__                              
 26 extern void __fentry__(void);                     
 27                                                   
 28 static inline unsigned long ftrace_call_adjust    
 29 {                                                 
 30         /*                                        
 31          * addr is the address of the mcount c    
 32          * recordmcount does the necessary off    
 33          */                                       
 34         return addr;                              
 35 }                                                 
 36                                                   
 37 #ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS       
 38 struct ftrace_regs {                              
 39         struct pt_regs          regs;             
 40 };                                                
 41                                                   
 42 static __always_inline struct pt_regs *           
 43 arch_ftrace_get_regs(struct ftrace_regs *fregs    
 44 {                                                 
 45         /* Only when FL_SAVE_REGS is set, cs w    
 46         if (!fregs->regs.cs)                      
 47                 return NULL;                      
 48         return &fregs->regs;                      
 49 }                                                 
 50                                                   
 51 #define ftrace_regs_set_instruction_pointer(fr    
 52         do { (fregs)->regs.ip = (_ip); } while    
 53                                                   
 54 #define ftrace_regs_get_instruction_pointer(fr    
 55         ((fregs)->regs.ip)                        
 56                                                   
 57 #define ftrace_regs_get_argument(fregs, n) \      
 58         regs_get_kernel_argument(&(fregs)->reg    
 59 #define ftrace_regs_get_stack_pointer(fregs) \    
 60         kernel_stack_pointer(&(fregs)->regs)      
 61 #define ftrace_regs_return_value(fregs) \         
 62         regs_return_value(&(fregs)->regs)         
 63 #define ftrace_regs_set_return_value(fregs, re    
 64         regs_set_return_value(&(fregs)->regs,     
 65 #define ftrace_override_function_with_return(f    
 66         override_function_with_return(&(fregs)    
 67 #define ftrace_regs_query_register_offset(name    
 68         regs_query_register_offset(name)          
 69                                                   
 70 struct ftrace_ops;                                
 71 #define ftrace_graph_func ftrace_graph_func       
 72 void ftrace_graph_func(unsigned long ip, unsig    
 73                        struct ftrace_ops *op,     
 74 #else                                             
 75 #define FTRACE_GRAPH_TRAMP_ADDR FTRACE_GRAPH_A    
 76 #endif                                            
 77                                                   
 78 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS    
 79 /*                                                
 80  * When a ftrace registered caller is tracing     
 81  * also set by a register_ftrace_direct() call    
 82  * differentiated in the ftrace_caller trampol    
 83  * place the direct caller in the ORIG_AX part    
 84  * tells the ftrace_caller that there's a dire    
 85  */                                               
 86 static inline void                                
 87 __arch_ftrace_set_direct_caller(struct pt_regs    
 88 {                                                 
 89         /* Emulate a call */                      
 90         regs->orig_ax = addr;                     
 91 }                                                 
 92 #define arch_ftrace_set_direct_caller(fregs, a    
 93         __arch_ftrace_set_direct_caller(&(freg    
 94 #endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CA    
 95                                                   
 96 #ifdef CONFIG_DYNAMIC_FTRACE                      
 97                                                   
 98 struct dyn_arch_ftrace {                          
 99         /* No extra data needed for x86 */        
100 };                                                
101                                                   
102 #endif /*  CONFIG_DYNAMIC_FTRACE */               
103 #endif /* __ASSEMBLY__ */                         
104 #endif /* CONFIG_FUNCTION_TRACER */               
105                                                   
106                                                   
107 #ifndef __ASSEMBLY__                              
108                                                   
109 void prepare_ftrace_return(unsigned long ip, u    
110                            unsigned long frame    
111                                                   
112 #if defined(CONFIG_FUNCTION_TRACER) && defined    
113 extern void set_ftrace_ops_ro(void);              
114 #else                                             
115 static inline void set_ftrace_ops_ro(void) { }    
116 #endif                                            
117                                                   
118 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME           
119 static inline bool arch_syscall_match_sym_name    
120 {                                                 
121         /*                                        
122          * Compare the symbol name with the sy    
123          * "__x64_sys", "__ia32_sys", "__do_sy    
124          */                                       
125         return !strcmp(sym + 3, name + 3) ||      
126                 (!strncmp(sym, "__x64_", 6) &&    
127                 (!strncmp(sym, "__ia32_", 7) &    
128                 (!strncmp(sym, "__do_sys", 8)     
129 }                                                 
130                                                   
131 #ifndef COMPILE_OFFSETS                           
132                                                   
133 #if defined(CONFIG_FTRACE_SYSCALLS) && defined    
134 #include <linux/compat.h>                         
135                                                   
136 /*                                                
137  * Because ia32 syscalls do not map to x86_64     
138  * this screws up the trace output when tracin    
139  * Instead of reporting bogus syscalls, just d    
140  *                                                
141  * If the user really wants these, then they s    
142  * raw syscall tracepoints with filtering.        
143  */                                               
144 #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS 1       
145 static inline bool arch_trace_is_compat_syscal    
146 {                                                 
147         return in_32bit_syscall();                
148 }                                                 
149 #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA3    
150 #endif /* !COMPILE_OFFSETS */                     
151 #endif /* !__ASSEMBLY__ */                        
152                                                   
153 #ifndef __ASSEMBLY__                              
154 #ifdef CONFIG_FUNCTION_GRAPH_TRACER               
155 struct fgraph_ret_regs {                          
156         unsigned long ax;                         
157         unsigned long dx;                         
158         unsigned long bp;                         
159 };                                                
160                                                   
161 static inline unsigned long fgraph_ret_regs_re    
162 {                                                 
163         return ret_regs->ax;                      
164 }                                                 
165                                                   
166 static inline unsigned long fgraph_ret_regs_fr    
167 {                                                 
168         return ret_regs->bp;                      
169 }                                                 
170 #endif /* ifdef CONFIG_FUNCTION_GRAPH_TRACER *    
171 #endif                                            
172                                                   
173 #endif /* _ASM_X86_FTRACE_H */                    
174                                                   

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