提交 1d29c889 编写于 作者: D Daniel P. Berrange

Make use of PERF_COUNT_HW_REF_CPU_CYCLES conditional

The PERF_COUNT_HW_REF_CPU_CYCLES constant is not available
on all Linux distros libvirt targets, so its use must be
made conditional. Other constant have existed long enough
that we can assume they exist, as we don't support very
old distros like RHEL-5 any more.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 256f6b18
......@@ -104,8 +104,14 @@ static struct virPerfEventAttr attrs[] = {
.attrType = PERF_TYPE_HARDWARE,
.attrConfig = PERF_COUNT_HW_STALLED_CYCLES_BACKEND},
{.type = VIR_PERF_EVENT_REF_CPU_CYCLES,
# ifdef PERF_COUNT_HW_REF_CPU_CYCLES
.attrType = PERF_TYPE_HARDWARE,
.attrConfig = PERF_COUNT_HW_REF_CPU_CYCLES},
.attrConfig = PERF_COUNT_HW_REF_CPU_CYCLES
# else
.attrType = 0,
.attrConfig = 0,
# endif
},
};
typedef struct virPerfEventAttr *virPerfEventAttrPtr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册