Impact: ABI change
This expands several fields in the perf_counter_hw_event struct and adds
a "flags" argument to the perf_counter_open system call, in order that
features can be added in future without ABI changes.
In particular the record_type field is expanded to 64 bits, and the
space for flag bits has been expanded from 32 to 64 bits.
This also adds some new fields:
* read_format (64 bits) is intended to provide a way to specify what
userspace wants to get back when it does a read() on a simple
(non-interrupting) counter;
* exclude_idle (1 bit) provides a way for userspace to ask that events
that occur when the cpu is idle be excluded;
* extra_config_len will provide a way for userspace to supply an
arbitrary amount of extra machine-specific PMU configuration data
immediately following the perf_counter_hw_event struct, to allow
sophisticated users to program things such as instruction matching
CAMs and address range registers;
* __reserved_3 and __reserved_4 provide space for future expansion.
Signed-off-by: Paul Mackerras <paulus@samba.org>
__s64 type;
__u64 irq_period;
__s64 type;
__u64 irq_period;
+ __u64 record_type;
+ __u64 read_format;
- __u32 disabled : 1, /* off by default */
+ __u64 disabled : 1, /* off by default */
nmi : 1, /* NMI sampling */
raw : 1, /* raw event type */
inherit : 1, /* children inherit it */
nmi : 1, /* NMI sampling */
raw : 1, /* raw event type */
inherit : 1, /* children inherit it */
exclude_user : 1, /* don't count user */
exclude_kernel : 1, /* ditto kernel */
exclude_hv : 1, /* ditto hypervisor */
exclude_user : 1, /* don't count user */
exclude_kernel : 1, /* ditto kernel */
exclude_hv : 1, /* ditto hypervisor */
+ exclude_idle : 1, /* don't count when idle */
+ __reserved_1 : 55;
+
+ __u32 extra_config_len;
+ __u32 __reserved_4;
asmlinkage long sys_perf_counter_open(
const struct perf_counter_hw_event __user *hw_event_uptr,
asmlinkage long sys_perf_counter_open(
const struct perf_counter_hw_event __user *hw_event_uptr,
- pid_t pid, int cpu, int group_fd);
+ pid_t pid, int cpu, int group_fd, unsigned long flags);
- * sys_perf_task_open - open a performance counter, associate it to a task/cpu
+ * sys_perf_counter_open - open a performance counter, associate it to a task/cpu
*
* @hw_event_uptr: event type attributes for monitoring/sampling
* @pid: target pid
* @cpu: target cpu
* @group_fd: group leader counter fd
*/
*
* @hw_event_uptr: event type attributes for monitoring/sampling
* @pid: target pid
* @cpu: target cpu
* @group_fd: group leader counter fd
*/
-SYSCALL_DEFINE4(perf_counter_open,
+SYSCALL_DEFINE5(perf_counter_open,
const struct perf_counter_hw_event __user *, hw_event_uptr,
const struct perf_counter_hw_event __user *, hw_event_uptr,
- pid_t, pid, int, cpu, int, group_fd)
+ pid_t, pid, int, cpu, int, group_fd, unsigned long, flags)
{
struct perf_counter *counter, *group_leader;
struct perf_counter_hw_event hw_event;
{
struct perf_counter *counter, *group_leader;
struct perf_counter_hw_event hw_event;
int fput_needed2 = 0;
int ret;
int fput_needed2 = 0;
int ret;
+ /* for future expandability... */
+ if (flags)
+ return -EINVAL;
+
if (copy_from_user(&hw_event, hw_event_uptr, sizeof(hw_event)) != 0)
return -EFAULT;
if (copy_from_user(&hw_event, hw_event_uptr, sizeof(hw_event)) != 0)
return -EFAULT;