]> Pileus Git - ~andy/linux/commit
ARM: perf: fix group validation for mixed software and hardware groups
authorWill Deacon <will.deacon@arm.com>
Wed, 9 Oct 2013 12:51:29 +0000 (13:51 +0100)
committerWill Deacon <will.deacon@arm.com>
Wed, 9 Oct 2013 13:33:07 +0000 (14:33 +0100)
commit2dfcb802d6bd54a2353678c6434846d94b058f2c
treedc650b6f6210c880668fa09311f7db8fd3bfd259
parentab255e72204fc5127f0adf40ba103d9335fefa30
ARM: perf: fix group validation for mixed software and hardware groups

Since software events can always be scheduled, perf allows software and
hardware events to be mixed together in the same event group. There are
two ways in which this can come about:

  (1) A SW event is added to a HW group. This validates using the HW PMU
      of the group leader.

  (2) A HW event is added to a SW group. This inserts the SW events and
      the new HW event into a HW context, but the SW event remains the
      group leader.

When validating the latter case, we would ideally compare the PMU of
each event in the group with the relevant HW PMU. The problem is, in the
face of potentially multiple HW PMUs, we don't have a handle on the
relevant structure. Commit 7b9f72c62ed0 ("ARM: perf: clean up event
group validation") attempting to resolve this issue, but actually made
things *worse* by comparing with the leader PMU. If the leader is a SW
event, then we automatically `pass' all the HW events during validation!

This patch removes the check against the leader PMU. Whilst this will
allow events from multiple HW PMUs to be grouped together, that should
probably be dealt with in perf core as the result of a later patch.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/kernel/perf_event.c