perfcounters: fix a few minor cleanliness issues
PATCH 1/1 perfcounters: fix a few minor cleanliness issues
This fixes three issues noticed by Arnd Bergmann:
- Add #ifdef __KERNEL__ and move some things around in perf_counter.h to make sure only the bits that userspace needs are exported to userspace.
- Use __u64, __s64, __u32 types in the structs exported to userspace rather than u64, s64, u32.
- Make the sys_perf_counter_open syscall available to the SPUs on Cell platforms.
And one issue that I noticed in looking at the code again:
- Wrap the perf_counter_open syscall with SYSCALL_DEFINE4 so we get the proper handling of int arguments on ppc64 (and some other 64-bit architectures).
---
This is in the master branch of my perfcounters.git tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perfcounters.git master
arch/powerpc/include/asm/systbl.h | 2 +- include/linux/perf_counter.h | 43 +++++++++++++++++++----------------- include/linux/syscalls.h | 9 ++----- kernel/perf_counter.c | 6 ++-- 4 files changed, 30 insertions(+), 30 deletions(-)
arch/powerpc/include/asm/systbl.h +1 -1
@@ -322,4 +322,4 @@ SYSCALL_SPU(epoll_create1) SYSCALL_SPU(dup3) SYSCALL_SPU(pipe2) SYSCALL(inotify_init1) -SYSCALL(perf_counter_open) +SYSCALL_SPU(perf_counter_open)
include/linux/perf_counter.h +23 -20
76 lines not on this page · raw message
include/linux/syscalls.h +3 -6
@@ -696,10 +696,7 @@ asmlinkage long sys_pipe(int __user *);int kernel_execve (const char *filename,char *const argv[],char *const envp[]); -asmlinkage int sys_perf_counter_open( - -struct perf_counter_hw_event *hw_event_uptr__user , -pid_t pid, -int cpu, -int group_fd); +asmlinkage long sys_perf_counter_open ( +const struct perf_counter_hw_event __user *hw_event_uptr, +pid_t pid,int cpu,int group_fd);#endif
kernel/perf_counter.c +3 -3
@@ -1690,9 +1690,9 @@ perf_counter_alloc(struct perf_counter_hw_event *hw_event,* @cpu: target cpu * @group_fd: group leader counter fd */ -asmlinkage int -sys_perf_counter_open (struct perf_counter_hw_event *hw_event_uptr__user , -pid_t pid,int cpu,int group_fd) +SYSCALL_DEFINE4 (perf_counter_open, + const struct perf_counter_hw_event __user *, hw_event_uptr, + pid_t, pid, int, cpu, int, group_fd) {struct perf_counter *counter, *group_leader;struct perf_counter_hw_event hw_event;
Signature · 1 line
1.5.6.3
Quoted 23 lines · Paul Mackerras
This fixes three issues noticed by Arnd Bergmann:
- Add #ifdef
__KERNEL__and move some things around inperf_counter.hto make sure only the bits that userspace needs are exported to userspace.- Use
__u64,__s64,__u32types in the structs exported to userspace rather than u64, s64, u32.- Make the
sys_perf_counter_opensyscall available to the SPUs on Cell platforms.And one issue that I noticed in looking at the code again:
- Wrap the
perf_counter_opensyscall withSYSCALL_DEFINE4so we get the proper handling of int arguments on ppc64 (and some other 64-bit architectures).Reported-by Arnd Bergmann <[email protected]>Signed-off-by Paul Mackerras <[email protected]>---
This is in the master branch of my perfcounters.git tree at:
Quoted 7 lines
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perfcounters.gitmasterarch/powerpc/include/asm/systbl.h | 2 +- include/linux/perf_counter.h | 43 +++++++++++++++++++----------------- include/linux/syscalls.h | 9 ++----- kernel/perf_counter.c | 6 ++-- 4 files changed, 30 insertions(+), 30 deletions(-)
Pulled into tip:perfcounters/core, thanks Paul!
Ingo
Quoted 12 lines · Paul Mackerras
This fixes three issues noticed by Arnd Bergmann:
- Add #ifdef
__KERNEL__and move some things around inperf_counter.hto make sure only the bits that userspace needs are exported to userspace.- Use
__u64,__s64,__u32types in the structs exported to userspace rather than u64, s64, u32.- Make the
sys_perf_counter_opensyscall available to the SPUs on Cell platforms.
Quoted 8 lines
And one issue that I noticed in looking at the code again:
- Wrap the
perf_counter_opensyscall withSYSCALL_DEFINE4so we get the proper handling of int arguments on ppc64 (and some other 64-bit architectures).Reported-by Arnd Bergmann <[email protected]>Signed-off-by Paul Mackerras <[email protected]>
Thanks for the follow-up!