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

TOMOYO Linux Cross Reference
Linux/arch/mips/kernel/perf_event.c

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/mips/kernel/perf_event.c (Version linux-6.12-rc7) and /arch/i386/kernel/perf_event.c (Version linux-5.18.19)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 
  2 /*                                                
  3  * Linux performance counter support for MIPS.    
  4  *                                                
  5  * Copyright (C) 2010 MIPS Technologies, Inc.     
  6  * Author: Deng-Cheng Zhu                         
  7  *                                                
  8  * This code is based on the implementation fo    
  9  * based on the sparc64 perf event code and th    
 10  * counter access is based on the MIPS Oprofil    
 11  * support references the code of MIPS stacktr    
 12  */                                               
 13                                                   
 14 #include <linux/perf_event.h>                     
 15 #include <linux/sched/task_stack.h>               
 16                                                   
 17 #include <asm/stacktrace.h>                       
 18                                                   
 19 /* Callchain handling code. */                    
 20                                                   
 21 /*                                                
 22  * Leave userspace callchain empty for now. Wh    
 23  * the user stack callchains, we will add it h    
 24  */                                               
 25                                                   
 26 static void save_raw_perf_callchain(struct per    
 27                                     unsigned l    
 28 {                                                 
 29         unsigned long *sp = (unsigned long *)r    
 30         unsigned long addr;                       
 31                                                   
 32         while (!kstack_end(sp)) {                 
 33                 addr = *sp++;                     
 34                 if (__kernel_text_address(addr    
 35                         perf_callchain_store(e    
 36                         if (entry->nr >= entry    
 37                                 break;            
 38                 }                                 
 39         }                                         
 40 }                                                 
 41                                                   
 42 void perf_callchain_kernel(struct perf_callcha    
 43                            struct pt_regs *reg    
 44 {                                                 
 45         unsigned long sp = regs->regs[29];        
 46 #ifdef CONFIG_KALLSYMS                            
 47         unsigned long ra = regs->regs[31];        
 48         unsigned long pc = regs->cp0_epc;         
 49                                                   
 50         if (raw_show_trace || !__kernel_text_a    
 51                 unsigned long stack_page =        
 52                         (unsigned long)task_st    
 53                 if (stack_page && sp >= stack_    
 54                     sp <= stack_page + THREAD_    
 55                         save_raw_perf_callchai    
 56                 return;                           
 57         }                                         
 58         do {                                      
 59                 perf_callchain_store(entry, pc    
 60                 if (entry->nr >= entry->max_st    
 61                         break;                    
 62                 pc = unwind_stack(current, &sp    
 63         } while (pc);                             
 64 #else                                             
 65         save_raw_perf_callchain(entry, sp);       
 66 #endif                                            
 67 }                                                 
 68                                                   

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