提交 2cf61295 编写于 作者: G Guoqing Jiang 提交者: Yang Yingliang

intel: perf/x86/intel: Use update attributes for skylake format

mainline inclusion
from mainline-v5.3-rc1
commit b6576880
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I47H3V
CVE: NA

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

commit b6576880 upstream
Backport summary: backport to kernel 4.19.57 for ICX perf topdown support

Using the new pmu::update_attrs attribute group for
skylake specific format attributes.
Signed-off-by: NJiri Olsa <jolsa@kernel.org>
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190512155518.21468-9-jolsa@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
Signed-off-by: NYunying Sun <yunying.sun@intel.com>
Signed-off-by: NGuoqing Jiang <jiangguoqing@kylinos.cn>
Signed-off-by: NJackie Liu <liuyun01@kylinos.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 0bbfbb73
...@@ -4224,6 +4224,11 @@ static struct attribute_group group_format_extra = { ...@@ -4224,6 +4224,11 @@ static struct attribute_group group_format_extra = {
.is_visible = exra_is_visible, .is_visible = exra_is_visible,
}; };
static struct attribute_group group_format_extra_skl = {
.name = "format",
.is_visible = exra_is_visible,
};
static const struct attribute_group *attr_update[] = { static const struct attribute_group *attr_update[] = {
&group_events_td, &group_events_td,
&group_events_mem, &group_events_mem,
...@@ -4231,6 +4236,7 @@ static const struct attribute_group *attr_update[] = { ...@@ -4231,6 +4236,7 @@ static const struct attribute_group *attr_update[] = {
&group_caps_gen, &group_caps_gen,
&group_caps_lbr, &group_caps_lbr,
&group_format_extra, &group_format_extra,
&group_format_extra_skl,
NULL, NULL,
}; };
...@@ -4238,11 +4244,11 @@ static struct attribute *empty_attrs; ...@@ -4238,11 +4244,11 @@ static struct attribute *empty_attrs;
__init int intel_pmu_init(void) __init int intel_pmu_init(void)
{ {
struct attribute **extra_skl_attr = &empty_attrs;
struct attribute **extra_attr = &empty_attrs; struct attribute **extra_attr = &empty_attrs;
struct attribute **td_attr = &empty_attrs; struct attribute **td_attr = &empty_attrs;
struct attribute **mem_attr = &empty_attrs; struct attribute **mem_attr = &empty_attrs;
struct attribute **tsx_attr = &empty_attrs; struct attribute **tsx_attr = &empty_attrs;
struct attribute **to_free = NULL;
union cpuid10_edx edx; union cpuid10_edx edx;
union cpuid10_eax eax; union cpuid10_eax eax;
union cpuid10_ebx ebx; union cpuid10_ebx ebx;
...@@ -4723,8 +4729,7 @@ __init int intel_pmu_init(void) ...@@ -4723,8 +4729,7 @@ __init int intel_pmu_init(void)
x86_pmu.get_event_constraints = hsw_get_event_constraints; x86_pmu.get_event_constraints = hsw_get_event_constraints;
extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? extra_attr = boot_cpu_has(X86_FEATURE_RTM) ?
hsw_format_attr : nhm_format_attr; hsw_format_attr : nhm_format_attr;
extra_attr = merge_attr(extra_attr, skl_format_attr); extra_skl_attr = skl_format_attr;
to_free = extra_attr;
td_attr = hsw_events_attrs; td_attr = hsw_events_attrs;
mem_attr = hsw_mem_events_attrs; mem_attr = hsw_mem_events_attrs;
tsx_attr = hsw_tsx_events_attrs; tsx_attr = hsw_tsx_events_attrs;
...@@ -4765,7 +4770,7 @@ __init int intel_pmu_init(void) ...@@ -4765,7 +4770,7 @@ __init int intel_pmu_init(void)
x86_pmu.get_event_constraints = icl_get_event_constraints; x86_pmu.get_event_constraints = icl_get_event_constraints;
extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? extra_attr = boot_cpu_has(X86_FEATURE_RTM) ?
hsw_format_attr : nhm_format_attr; hsw_format_attr : nhm_format_attr;
extra_attr = merge_attr(extra_attr, skl_format_attr); extra_skl_attr = skl_format_attr;
mem_attr = icl_events_attrs; mem_attr = icl_events_attrs;
tsx_attr = icl_tsx_events_attrs; tsx_attr = icl_tsx_events_attrs;
x86_pmu.lbr_pt_coexist = true; x86_pmu.lbr_pt_coexist = true;
...@@ -4798,6 +4803,7 @@ __init int intel_pmu_init(void) ...@@ -4798,6 +4803,7 @@ __init int intel_pmu_init(void)
group_events_mem.attrs = mem_attr; group_events_mem.attrs = mem_attr;
group_events_tsx.attrs = tsx_attr; group_events_tsx.attrs = tsx_attr;
group_format_extra.attrs = extra_attr; group_format_extra.attrs = extra_attr;
group_format_extra_skl.attrs = extra_skl_attr;
x86_pmu.attr_update = attr_update; x86_pmu.attr_update = attr_update;
...@@ -4871,7 +4877,6 @@ __init int intel_pmu_init(void) ...@@ -4871,7 +4877,6 @@ __init int intel_pmu_init(void)
pr_cont("full-width counters, "); pr_cont("full-width counters, ");
} }
kfree(to_free);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册