Loading arch/arm/kernel/perf_event.c +3 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,9 @@ u64 armpmu_event_update(struct perf_event *event) struct hw_perf_event *hwc = &event->hw; u64 delta, prev_raw_count, new_raw_count; if (event->state <= PERF_EVENT_STATE_OFF) return 0; again: prev_raw_count = local64_read(&hwc->prev_count); new_raw_count = armpmu->read_counter(event); Loading arch/arm/mach-msm/perf_debug.c +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ static char *descriptions = " 3 Perf: bring CPU online if needed when disabling irq\n" " 4 Perf: Support sw events across hotplug\n" " 5 msm: perf: initialise krait perf L2 counter enables\n" " 6 msm: perf: clean up duplicate constraint events\n" ; static ssize_t desc_read(struct file *fp, char __user *buf, Loading arch/arm/mach-msm/perf_event_msm_krait_l2.c +3 −1 Original line number Diff line number Diff line Loading @@ -504,8 +504,10 @@ static int msm_l2_test_set_ev_constraint(struct perf_event *event) * This sets the event OFF on all but one * CPU. */ if (!(event->cpu < 0)) if (!(event->cpu < 0)) { event->state = PERF_EVENT_STATE_OFF; event->attr.constraint_duplicate = 1; } } out: raw_spin_unlock_irqrestore(&l2_pmu_constraints.lock, flags); Loading include/uapi/linux/perf_event.h +2 −1 Original line number Diff line number Diff line Loading @@ -272,8 +272,9 @@ struct perf_event_attr { exclude_callchain_kernel : 1, /* exclude kernel callchains */ exclude_callchain_user : 1, /* exclude user callchains */ constraint_duplicate : 1, __reserved_1 : 41; __reserved_1 : 40; union { __u32 wakeup_events; /* wakeup every n events */ Loading kernel/events/core.c +10 −0 Original line number Diff line number Diff line Loading @@ -3082,6 +3082,16 @@ static void put_event(struct perf_event *event) static int perf_release(struct inode *inode, struct file *file) { struct perf_event *event = file->private_data; /* * Event can be in state OFF because of a constraint check. * Change to ACTIVE so that it gets cleaned up correctly. */ if ((event->state == PERF_EVENT_STATE_OFF) && event->attr.constraint_duplicate) event->state = PERF_EVENT_STATE_ACTIVE; put_event(file->private_data); return 0; } Loading Loading
arch/arm/kernel/perf_event.c +3 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,9 @@ u64 armpmu_event_update(struct perf_event *event) struct hw_perf_event *hwc = &event->hw; u64 delta, prev_raw_count, new_raw_count; if (event->state <= PERF_EVENT_STATE_OFF) return 0; again: prev_raw_count = local64_read(&hwc->prev_count); new_raw_count = armpmu->read_counter(event); Loading
arch/arm/mach-msm/perf_debug.c +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ static char *descriptions = " 3 Perf: bring CPU online if needed when disabling irq\n" " 4 Perf: Support sw events across hotplug\n" " 5 msm: perf: initialise krait perf L2 counter enables\n" " 6 msm: perf: clean up duplicate constraint events\n" ; static ssize_t desc_read(struct file *fp, char __user *buf, Loading
arch/arm/mach-msm/perf_event_msm_krait_l2.c +3 −1 Original line number Diff line number Diff line Loading @@ -504,8 +504,10 @@ static int msm_l2_test_set_ev_constraint(struct perf_event *event) * This sets the event OFF on all but one * CPU. */ if (!(event->cpu < 0)) if (!(event->cpu < 0)) { event->state = PERF_EVENT_STATE_OFF; event->attr.constraint_duplicate = 1; } } out: raw_spin_unlock_irqrestore(&l2_pmu_constraints.lock, flags); Loading
include/uapi/linux/perf_event.h +2 −1 Original line number Diff line number Diff line Loading @@ -272,8 +272,9 @@ struct perf_event_attr { exclude_callchain_kernel : 1, /* exclude kernel callchains */ exclude_callchain_user : 1, /* exclude user callchains */ constraint_duplicate : 1, __reserved_1 : 41; __reserved_1 : 40; union { __u32 wakeup_events; /* wakeup every n events */ Loading
kernel/events/core.c +10 −0 Original line number Diff line number Diff line Loading @@ -3082,6 +3082,16 @@ static void put_event(struct perf_event *event) static int perf_release(struct inode *inode, struct file *file) { struct perf_event *event = file->private_data; /* * Event can be in state OFF because of a constraint check. * Change to ACTIVE so that it gets cleaned up correctly. */ if ((event->state == PERF_EVENT_STATE_OFF) && event->attr.constraint_duplicate) event->state = PERF_EVENT_STATE_ACTIVE; put_event(file->private_data); return 0; } Loading