#ifndef _LINUX_PERF_COUNTER_H
#define _LINUX_PERF_COUNTER_H
-#include <asm/atomic.h>
-#include <asm/ioctl.h>
-
-#ifdef CONFIG_PERF_COUNTERS
-# include <asm/perf_counter.h>
-#endif
-
-#include <linux/list.h>
-#include <linux/mutex.h>
-#include <linux/rculist.h>
-#include <linux/rcupdate.h>
-#include <linux/spinlock.h>
-
-struct task_struct;
+#include <linux/types.h>
+#include <linux/ioctl.h>
/*
* User-space ABI bits:
* Hardware event to monitor via a performance monitoring counter:
*/
struct perf_counter_hw_event {
- s64 type;
+ __s64 type;
- u64 irq_period;
- u32 record_type;
+ __u64 irq_period;
+ __u32 record_type;
- u32 disabled : 1, /* off by default */
+ __u32 disabled : 1, /* off by default */
nmi : 1, /* NMI sampling */
raw : 1, /* raw event type */
inherit : 1, /* children inherit it */
__reserved_1 : 23;
- u64 __reserved_2;
+ __u64 __reserved_2;
};
/*
#define PERF_COUNTER_IOC_ENABLE _IO('$', 0)
#define PERF_COUNTER_IOC_DISABLE _IO('$', 1)
+#ifdef __KERNEL__
/*
- * Kernel-internal data types:
+ * Kernel-internal data types and definitions:
*/
+#ifdef CONFIG_PERF_COUNTERS
+# include <asm/perf_counter.h>
+#endif
+
+#include <linux/list.h>
+#include <linux/mutex.h>
+#include <linux/rculist.h>
+#include <linux/rcupdate.h>
+#include <linux/spinlock.h>
+#include <asm/atomic.h>
+
+struct task_struct;
+
/**
* struct hw_perf_counter - performance counter hardware details:
*/
static inline int perf_counter_task_enable(void) { return -EINVAL; }
#endif
+#endif /* __KERNEL__ */
#endif /* _LINUX_PERF_COUNTER_H */
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
* @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;