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

TOMOYO Linux Cross Reference
Linux/tools/perf/perf-sys.h

Version: ~ [ linux-6.1-rc7 ] ~ [ linux-6.0.10 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.80 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.156 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.225 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.267 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.300 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.334 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ 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 ] ~

  1 #ifndef _PERF_SYS_H
  2 #define _PERF_SYS_H
  3 
  4 #include <unistd.h>
  5 #include <sys/types.h>
  6 #include <sys/syscall.h>
  7 #include <linux/types.h>
  8 #include <linux/compiler.h>
  9 #include <linux/perf_event.h>
 10 #include <asm/barrier.h>
 11 
 12 #if defined(__i386__)
 13 #define cpu_relax()     asm volatile("rep; nop" ::: "memory");
 14 #define CPUINFO_PROC    {"model name"}
 15 #endif
 16 
 17 #if defined(__x86_64__)
 18 #define cpu_relax()     asm volatile("rep; nop" ::: "memory");
 19 #define CPUINFO_PROC    {"model name"}
 20 #endif
 21 
 22 #ifdef __powerpc__
 23 #define CPUINFO_PROC    {"cpu"}
 24 #endif
 25 
 26 #ifdef __s390__
 27 #define CPUINFO_PROC    {"vendor_id"}
 28 #endif
 29 
 30 #ifdef __sh__
 31 #define CPUINFO_PROC    {"cpu type"}
 32 #endif
 33 
 34 #ifdef __hppa__
 35 #define CPUINFO_PROC    {"cpu"}
 36 #endif
 37 
 38 #ifdef __sparc__
 39 #define CPUINFO_PROC    {"cpu"}
 40 #endif
 41 
 42 #ifdef __alpha__
 43 #define CPUINFO_PROC    {"cpu model"}
 44 #endif
 45 
 46 #ifdef __ia64__
 47 #define cpu_relax()     asm volatile ("hint @pause" ::: "memory")
 48 #define CPUINFO_PROC    {"model name"}
 49 #endif
 50 
 51 #ifdef __arm__
 52 #define CPUINFO_PROC    {"model name", "Processor"}
 53 #endif
 54 
 55 #ifdef __aarch64__
 56 #define cpu_relax()     asm volatile("yield" ::: "memory")
 57 #endif
 58 
 59 #ifdef __mips__
 60 #define CPUINFO_PROC    {"cpu model"}
 61 #endif
 62 
 63 #ifdef __arc__
 64 #define CPUINFO_PROC    {"Processor"}
 65 #endif
 66 
 67 #ifdef __metag__
 68 #define CPUINFO_PROC    {"CPU"}
 69 #endif
 70 
 71 #ifdef __xtensa__
 72 #define CPUINFO_PROC    {"core ID"}
 73 #endif
 74 
 75 #ifdef __tile__
 76 #define cpu_relax()     asm volatile ("mfspr zero, PASS" ::: "memory")
 77 #define CPUINFO_PROC    {"model name"}
 78 #endif
 79 
 80 #ifndef cpu_relax
 81 #define cpu_relax() barrier()
 82 #endif
 83 
 84 static inline int
 85 sys_perf_event_open(struct perf_event_attr *attr,
 86                       pid_t pid, int cpu, int group_fd,
 87                       unsigned long flags)
 88 {
 89         int fd;
 90 
 91         fd = syscall(__NR_perf_event_open, attr, pid, cpu,
 92                      group_fd, flags);
 93 
 94 #ifdef HAVE_ATTR_TEST
 95         if (unlikely(test_attr__enabled))
 96                 test_attr__open(attr, pid, cpu, fd, group_fd, flags);
 97 #endif
 98         return fd;
 99 }
100 
101 #endif /* _PERF_SYS_H */
102 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp