|
@@ -1288,6 +1288,11 @@ static unsigned int perf_poll(struct file *file, poll_table *wait)
|
|
return events;
|
|
return events;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void perf_counter_reset(struct perf_counter *counter)
|
|
|
|
+{
|
|
|
|
+ atomic_set(&counter->count, 0);
|
|
|
|
+}
|
|
|
|
+
|
|
static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|
static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|
{
|
|
{
|
|
struct perf_counter *counter = file->private_data;
|
|
struct perf_counter *counter = file->private_data;
|
|
@@ -1303,6 +1308,9 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|
case PERF_COUNTER_IOC_REFRESH:
|
|
case PERF_COUNTER_IOC_REFRESH:
|
|
perf_counter_refresh(counter, arg);
|
|
perf_counter_refresh(counter, arg);
|
|
break;
|
|
break;
|
|
|
|
+ case PERF_COUNTER_IOC_RESET:
|
|
|
|
+ perf_counter_reset(counter);
|
|
|
|
+ break;
|
|
default:
|
|
default:
|
|
err = -ENOTTY;
|
|
err = -ENOTTY;
|
|
}
|
|
}
|