perf/cgroup: correct indirection in perf_less_group_idx
Ian Rogers
reviewerPATCH v2 1/1 perf/cgroup: correct indirection in perf_less_group_idx
The void* in perf_less_group_idx is to a cell in the array which points at a perf_event*, as such it is a perf_event**.
Fixes 6eef8a7116de ("perf/core: Use min_heap in visit_groups_merge()")
Reported-By John Sperbeck <[email protected]>
Signed-off-by Ian Rogers <[email protected]>
--- kernel/events/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/events/core.c +2 -1
@@ -3503,7 +3503,8 @@ static void cpu_ctx_sched_out(struct perf_cpu_context *cpuctx,static bool perf_less_group_idx (const void *l,const void *r) { -const struct perf_event *le = l, *re = r; +const struct perf_event *le = *(const struct perf_event **)l; +const struct perf_event *re = *(const struct perf_event **)r;return le->group_index < re->group_index; }
Signature · 1 line
2.25.1.696.g5e7596f4ac-goog
[tip: perf/urgent] perf/cgroup: Correct indirection in perf_less_group_idx()
The following commit has been merged into the perf/urgent branch of tip:
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 24fb6b8e7c2280000966e3f2c9c8069a538518eb Gitweb: https://git.kernel.org/tip/24fb6b8e7c2280000966e3f2c9c8069a538518eb Author: Ian Rogers <[email protected]> AuthorDate: Sat, 21 Mar 2020 09:43:31 -07:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Wed, 08 Apr 2020 11:33:45 +02:00
perf/cgroup: Correct indirection in perf_less_group_idx()
The void* in perf_less_group_idx() is to a member in the array which points at a perf_event*, as such it is a perf_event**.
Reported-By John Sperbeck <[email protected]>
Fixes 6eef8a7116de ("perf/core: Use min_heap in visit_groups_merge()")
Signed-off-by Ian Rogers <[email protected]>
Signed-off-by Peter Zijlstra (Intel) <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/events/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/events/core.c +2 -1
@@ -3522,7 +3522,8 @@ static void cpu_ctx_sched_out(struct perf_cpu_context *cpuctx,static bool perf_less_group_idx (const void *l,const void *r) { -const struct perf_event *le = l, *re = r; +const struct perf_event *le = *(const struct perf_event **)l; +const struct perf_event *re = *(const struct perf_event **)r;return le->group_index < re->group_index; }