提交 26ac16f3 编写于 作者: N Nitesh Konkar 提交者: John Ferlan

perf: Prevent enabling of already enabled perf event

Currently, on every --enable perf_event command,
a new event->fd is created and counting of perf
event counter starts from zero and previous
event->fd is lost. This patch prevents this
behaviour.
Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
上级 4dd19ea9
......@@ -198,6 +198,9 @@ virPerfEventEnable(virPerfPtr perf,
if (!event || !event_attr)
return -1;
if (event->enabled)
return 0;
if (event_attr->attrType == 0 && (type == VIR_PERF_EVENT_CMT ||
type == VIR_PERF_EVENT_MBMT ||
type == VIR_PERF_EVENT_MBML)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册