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

TOMOYO Linux Cross Reference
Linux/arch/loongarch/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/loongarch/include/asm/ftrace.h (Architecture sparc) and /arch/sparc64/include/asm-sparc64/ftrace.h (Architecture sparc64)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 /*                                                
  3  * Copyright (C) 2022 Loongson Technology Corp    
  4  */                                               
  5                                                   
  6 #ifndef _ASM_LOONGARCH_FTRACE_H                   
  7 #define _ASM_LOONGARCH_FTRACE_H                   
  8                                                   
  9 #define FTRACE_PLT_IDX          0                 
 10 #define FTRACE_REGS_PLT_IDX     1                 
 11 #define NR_FTRACE_PLTS          2                 
 12                                                   
 13 #ifdef CONFIG_FUNCTION_TRACER                     
 14                                                   
 15 #define MCOUNT_INSN_SIZE 4              /* siz    
 16                                                   
 17 #ifndef __ASSEMBLY__                              
 18                                                   
 19 #ifndef CONFIG_DYNAMIC_FTRACE                     
 20                                                   
 21 #define mcount _mcount                            
 22 extern void _mcount(void);                        
 23 extern void prepare_ftrace_return(unsigned lon    
 24                                                   
 25 #else                                             
 26                                                   
 27 struct dyn_ftrace;                                
 28 struct dyn_arch_ftrace { };                       
 29                                                   
 30 #define ARCH_SUPPORTS_FTRACE_OPS 1                
 31                                                   
 32 #define ftrace_init_nop ftrace_init_nop           
 33 int ftrace_init_nop(struct module *mod, struct    
 34                                                   
 35 static inline unsigned long ftrace_call_adjust    
 36 {                                                 
 37         return addr;                              
 38 }                                                 
 39                                                   
 40 void prepare_ftrace_return(unsigned long self_    
 41                                                   
 42 #endif /* CONFIG_DYNAMIC_FTRACE */                
 43                                                   
 44 #ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS       
 45 struct ftrace_ops;                                
 46                                                   
 47 struct ftrace_regs {                              
 48         struct pt_regs regs;                      
 49 };                                                
 50                                                   
 51 static __always_inline struct pt_regs *arch_ft    
 52 {                                                 
 53         return &fregs->regs;                      
 54 }                                                 
 55                                                   
 56 static __always_inline unsigned long              
 57 ftrace_regs_get_instruction_pointer(struct ftr    
 58 {                                                 
 59         return instruction_pointer(&fregs->reg    
 60 }                                                 
 61                                                   
 62 static __always_inline void                       
 63 ftrace_regs_set_instruction_pointer(struct ftr    
 64 {                                                 
 65         instruction_pointer_set(&fregs->regs,     
 66 }                                                 
 67                                                   
 68 #define ftrace_regs_get_argument(fregs, n) \      
 69         regs_get_kernel_argument(&(fregs)->reg    
 70 #define ftrace_regs_get_stack_pointer(fregs) \    
 71         kernel_stack_pointer(&(fregs)->regs)      
 72 #define ftrace_regs_return_value(fregs) \         
 73         regs_return_value(&(fregs)->regs)         
 74 #define ftrace_regs_set_return_value(fregs, re    
 75         regs_set_return_value(&(fregs)->regs,     
 76 #define ftrace_override_function_with_return(f    
 77         override_function_with_return(&(fregs)    
 78 #define ftrace_regs_query_register_offset(name    
 79         regs_query_register_offset(name)          
 80                                                   
 81 #define ftrace_graph_func ftrace_graph_func       
 82 void ftrace_graph_func(unsigned long ip, unsig    
 83                        struct ftrace_ops *op,     
 84                                                   
 85 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS    
 86 static inline void                                
 87 __arch_ftrace_set_direct_caller(struct pt_regs    
 88 {                                                 
 89         regs->regs[13] = addr;  /* t1 */          
 90 }                                                 
 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 #endif                                            
 97                                                   
 98 #endif /* __ASSEMBLY__ */                         
 99                                                   
100 #endif /* CONFIG_FUNCTION_TRACER */               
101                                                   
102 #ifndef __ASSEMBLY__                              
103 #ifdef CONFIG_FUNCTION_GRAPH_TRACER               
104 struct fgraph_ret_regs {                          
105         /* a0 - a1 */                             
106         unsigned long regs[2];                    
107                                                   
108         unsigned long fp;                         
109         unsigned long __unused;                   
110 };                                                
111                                                   
112 static inline unsigned long fgraph_ret_regs_re    
113 {                                                 
114         return ret_regs->regs[0];                 
115 }                                                 
116                                                   
117 static inline unsigned long fgraph_ret_regs_fr    
118 {                                                 
119         return ret_regs->fp;                      
120 }                                                 
121 #endif /* ifdef CONFIG_FUNCTION_GRAPH_TRACER *    
122 #endif                                            
123                                                   
124 #endif /* _ASM_LOONGARCH_FTRACE_H */              
125                                                   

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