diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-09-04 05:56:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-04 05:56:22 -0400 |
commit | 825c9fb47a0837db12fecf8d360e0e1d284ddb49 (patch) | |
tree | 555effec5a598bb8de43fc49b801b8ef403f5ffd | |
parent | a29889a5369d2604c2053bcd051519a2445d8a70 (diff) |
sparc: add basic support for 'perf'
This wires up the perf_counter_open() syscall so that basic
software support for perf is working.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/sparc/Kconfig | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/perf_counter.h | 8 | ||||
-rw-r--r-- | arch/sparc/include/asm/unistd.h | 3 | ||||
-rw-r--r-- | arch/sparc/kernel/systbls_32.S | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/systbls_64.S | 4 | ||||
-rw-r--r-- | tools/perf/perf.h | 6 |
6 files changed, 21 insertions, 4 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index b847f880eeca..2aa7cd39b481 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -25,6 +25,7 @@ config SPARC | |||
25 | select ARCH_WANT_OPTIONAL_GPIOLIB | 25 | select ARCH_WANT_OPTIONAL_GPIOLIB |
26 | select RTC_CLASS | 26 | select RTC_CLASS |
27 | select RTC_DRV_M48T59 | 27 | select RTC_DRV_M48T59 |
28 | select HAVE_PERF_COUNTERS | ||
28 | 29 | ||
29 | config SPARC32 | 30 | config SPARC32 |
30 | def_bool !64BIT | 31 | def_bool !64BIT |
@@ -44,6 +45,7 @@ config SPARC64 | |||
44 | select RTC_DRV_BQ4802 | 45 | select RTC_DRV_BQ4802 |
45 | select RTC_DRV_SUN4V | 46 | select RTC_DRV_SUN4V |
46 | select RTC_DRV_STARFIRE | 47 | select RTC_DRV_STARFIRE |
48 | select HAVE_PERF_COUNTERS | ||
47 | 49 | ||
48 | config ARCH_DEFCONFIG | 50 | config ARCH_DEFCONFIG |
49 | string | 51 | string |
diff --git a/arch/sparc/include/asm/perf_counter.h b/arch/sparc/include/asm/perf_counter.h new file mode 100644 index 000000000000..f07c587a8304 --- /dev/null +++ b/arch/sparc/include/asm/perf_counter.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __ASM_SPARC_PERF_COUNTER_H | ||
2 | #define __ASM_SPARC_PERF_COUNTER_H | ||
3 | |||
4 | static inline void set_perf_counter_pending(void) { } | ||
5 | |||
6 | #define PERF_COUNTER_INDEX_OFFSET 0 | ||
7 | |||
8 | #endif | ||
diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h index b2c406de7d4f..706df669f3b8 100644 --- a/arch/sparc/include/asm/unistd.h +++ b/arch/sparc/include/asm/unistd.h | |||
@@ -395,8 +395,9 @@ | |||
395 | #define __NR_preadv 324 | 395 | #define __NR_preadv 324 |
396 | #define __NR_pwritev 325 | 396 | #define __NR_pwritev 325 |
397 | #define __NR_rt_tgsigqueueinfo 326 | 397 | #define __NR_rt_tgsigqueueinfo 326 |
398 | #define __NR_perf_counter_open 327 | ||
398 | 399 | ||
399 | #define NR_SYSCALLS 327 | 400 | #define NR_SYSCALLS 328 |
400 | 401 | ||
401 | #ifdef __32bit_syscall_numbers__ | 402 | #ifdef __32bit_syscall_numbers__ |
402 | /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, | 403 | /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, |
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S index 690901657291..04181577cb65 100644 --- a/arch/sparc/kernel/systbls_32.S +++ b/arch/sparc/kernel/systbls_32.S | |||
@@ -82,5 +82,5 @@ sys_call_table: | |||
82 | /*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate | 82 | /*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate |
83 | /*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 | 83 | /*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 |
84 | /*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv | 84 | /*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv |
85 | /*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo | 85 | /*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_counter_open |
86 | 86 | ||
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index 2ee7250ba7ae..91b06b7f7acf 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -83,7 +83,7 @@ sys_call_table32: | |||
83 | /*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate | 83 | /*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate |
84 | .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 | 84 | .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 |
85 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv | 85 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv |
86 | .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo | 86 | .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_counter_open |
87 | 87 | ||
88 | #endif /* CONFIG_COMPAT */ | 88 | #endif /* CONFIG_COMPAT */ |
89 | 89 | ||
@@ -158,4 +158,4 @@ sys_call_table: | |||
158 | /*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate | 158 | /*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate |
159 | .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 | 159 | .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 |
160 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv | 160 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv |
161 | .word sys_pwritev, sys_rt_tgsigqueueinfo | 161 | .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_counter_open |
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index e5148e2b6134..2abeb20d0bf3 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
@@ -41,6 +41,12 @@ | |||
41 | #define cpu_relax() asm volatile("" ::: "memory"); | 41 | #define cpu_relax() asm volatile("" ::: "memory"); |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | #ifdef __sparc__ | ||
45 | #include "../../arch/sparc/include/asm/unistd.h" | ||
46 | #define rmb() asm volatile("":::"memory") | ||
47 | #define cpu_relax() asm volatile("":::"memory") | ||
48 | #endif | ||
49 | |||
44 | #include <time.h> | 50 | #include <time.h> |
45 | #include <unistd.h> | 51 | #include <unistd.h> |
46 | #include <sys/types.h> | 52 | #include <sys/types.h> |