提交 d1df638b 编写于 作者: J John Garry 提交者: Zhong Jinghua

perf evlist: Change evlist__splice_list_tail() ordering

mainline inclusion
from mainline-v5.11-rc1
commit 6d2783fe
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I63VF5
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6d2783fe365fa5f571cf1416b5f5b1e352447a0e

--------------------------------------------------------------------------

Function find_evsel_group() expects events to be ordered such that they
are grouped after their leader.

Modify evlist__splice_list_tail() to guarantee this (ordering).

[Should prob also change the function name]
Signed-off-by: NJohn Garry <john.garry@huawei.com>
Acked-by: NKajol Jain <kjain@linux.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Kim Phillips <kim.phillips@amd.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lore.kernel.org/lkml/1607080216-36968-6-git-send-email-john.garry@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NJunhao He <hejunhao3@huawei.com>
上级 3aecd7c6
......@@ -180,11 +180,22 @@ void evlist__remove(struct evlist *evlist, struct evsel *evsel)
void perf_evlist__splice_list_tail(struct evlist *evlist,
struct list_head *list)
{
struct evsel *evsel, *temp;
while (!list_empty(list)) {
struct evsel *evsel, *temp, *leader = NULL;
__evlist__for_each_entry_safe(list, temp, evsel) {
list_del_init(&evsel->core.node);
evlist__add(evlist, evsel);
__evlist__for_each_entry_safe(list, temp, evsel) {
list_del_init(&evsel->core.node);
evlist__add(evlist, evsel);
leader = evsel;
break;
}
__evlist__for_each_entry_safe(list, temp, evsel) {
if (evsel->leader == leader) {
list_del_init(&evsel->core.node);
evlist__add(evlist, evsel);
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册