mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
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: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
This commit is contained in:
parent
4dd19ea913
commit
26ac16f3ce
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user