perf: Adjust the perf initialization
Introduce a static attr table and refactor virPerfEventEnable() for
general purpose usage.
This patch creates a static table/matrix that converts the VIR_PERF_EVENT_*
events into their respective "attr.type" and "attr.config" so that
virPerfEventEnable doesn't have the switch the calling function passes
by value the 'type'.
Signed-off-by: NQiaowei Ren <qiaowei.ren@intel.com>
Showing
想要评论请 注册 或 登录