Skip to content

Commit

Permalink
perf, x86: Use weight instead of cmask in for_each_event_constraint()
Browse files Browse the repository at this point in the history
There may exist constraints with a cmask set to zero. In this case
for_each_event_constraint() will not work properly. Now weight is used
instead of the cmask for loop exit detection. Weight is always a value
other than zero since the default contains the HWEIGHT from the
counter mask and in other cases a value of zero does not fit too.

This is in preparation of ibs event constraints that wont have a
cmask.

Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1271190201-25705-7-git-send-email-robert.richter@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Robert Richter authored and Ingo Molnar committed May 7, 2010
1 parent 31fa58a commit a1f2b70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ struct cpu_hw_events {
EVENT_CONSTRAINT(0, 0, 0)

#define for_each_event_constraint(e, c) \
for ((e) = (c); (e)->cmask; (e)++)
for ((e) = (c); (e)->weight; (e)++)

union perf_capabilities {
struct {
Expand Down

0 comments on commit a1f2b70

Please sign in to comment.