aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/perf_counter.h12
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--kernel/perf_counter.c10
3 files changed, 17 insertions, 7 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 186efaf49665..c42455ab1558 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -69,9 +69,10 @@ struct perf_counter_hw_event {
69 __s64 type; 69 __s64 type;
70 70
71 __u64 irq_period; 71 __u64 irq_period;
72 __u32 record_type; 72 __u64 record_type;
73 __u64 read_format;
73 74
74 __u32 disabled : 1, /* off by default */ 75 __u64 disabled : 1, /* off by default */
75 nmi : 1, /* NMI sampling */ 76 nmi : 1, /* NMI sampling */
76 raw : 1, /* raw event type */ 77 raw : 1, /* raw event type */
77 inherit : 1, /* children inherit it */ 78 inherit : 1, /* children inherit it */
@@ -80,10 +81,15 @@ struct perf_counter_hw_event {
80 exclude_user : 1, /* don't count user */ 81 exclude_user : 1, /* don't count user */
81 exclude_kernel : 1, /* ditto kernel */ 82 exclude_kernel : 1, /* ditto kernel */
82 exclude_hv : 1, /* ditto hypervisor */ 83 exclude_hv : 1, /* ditto hypervisor */
84 exclude_idle : 1, /* don't count when idle */
83 85
84 __reserved_1 : 23; 86 __reserved_1 : 55;
87
88 __u32 extra_config_len;
89 __u32 __reserved_4;
85 90
86 __u64 __reserved_2; 91 __u64 __reserved_2;
92 __u64 __reserved_3;
87}; 93};
88 94
89/* 95/*
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 28ef2be839c7..ab1d77247395 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -698,5 +698,5 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
698 698
699asmlinkage long sys_perf_counter_open( 699asmlinkage long sys_perf_counter_open(
700 const struct perf_counter_hw_event __user *hw_event_uptr, 700 const struct perf_counter_hw_event __user *hw_event_uptr,
701 pid_t pid, int cpu, int group_fd); 701 pid_t pid, int cpu, int group_fd, unsigned long flags);
702#endif 702#endif
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 16b14ba99d34..b2e838959f3e 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -1683,16 +1683,16 @@ perf_counter_alloc(struct perf_counter_hw_event *hw_event,
1683} 1683}
1684 1684
1685/** 1685/**
1686 * sys_perf_task_open - open a performance counter, associate it to a task/cpu 1686 * sys_perf_counter_open - open a performance counter, associate it to a task/cpu
1687 * 1687 *
1688 * @hw_event_uptr: event type attributes for monitoring/sampling 1688 * @hw_event_uptr: event type attributes for monitoring/sampling
1689 * @pid: target pid 1689 * @pid: target pid
1690 * @cpu: target cpu 1690 * @cpu: target cpu
1691 * @group_fd: group leader counter fd 1691 * @group_fd: group leader counter fd
1692 */ 1692 */
1693SYSCALL_DEFINE4(perf_counter_open, 1693SYSCALL_DEFINE5(perf_counter_open,
1694 const struct perf_counter_hw_event __user *, hw_event_uptr, 1694 const struct perf_counter_hw_event __user *, hw_event_uptr,
1695 pid_t, pid, int, cpu, int, group_fd) 1695 pid_t, pid, int, cpu, int, group_fd, unsigned long, flags)
1696{ 1696{
1697 struct perf_counter *counter, *group_leader; 1697 struct perf_counter *counter, *group_leader;
1698 struct perf_counter_hw_event hw_event; 1698 struct perf_counter_hw_event hw_event;
@@ -1703,6 +1703,10 @@ SYSCALL_DEFINE4(perf_counter_open,
1703 int fput_needed2 = 0; 1703 int fput_needed2 = 0;
1704 int ret; 1704 int ret;
1705 1705
1706 /* for future expandability... */
1707 if (flags)
1708 return -EINVAL;
1709
1706 if (copy_from_user(&hw_event, hw_event_uptr, sizeof(hw_event)) != 0) 1710 if (copy_from_user(&hw_event, hw_event_uptr, sizeof(hw_event)) != 0)
1707 return -EFAULT; 1711 return -EFAULT;
1708 1712