在VirtualBox guest虚拟机中运行perf [英] Running perf within a VirtualBox guest

查看:59
本文介绍了在VirtualBox guest虚拟机中运行perf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的教授要我跑步:

perf stat -e mem-loads,mem-stores ./test

为了让我找到C文件的内存加载和存储.我是在VirtualBox Linux guest虚拟机中执行此操作的,问题是 perf 表示这是无效或不受支持的事件,任何人都可以建议我在这里做错了什么吗?

In order for me to find the memory loads and stores for a C file. I'm doing this from within a VirtualBox Linux guest and problem is that perf is saying this is an invalid or unsupported event, can anyone advise as to what I'm doing wrong here?

invalid or unsupported event: 'mem-loads,'
Run 'perf list' for a list of valid events

 Usage: perf stat [<options>] [<command>]

    -e, --event <event>   event selector. use 'perf list' to list available events

VirtualBox来宾中是否有 perf 个硬件事件可用?

Are perf hardware events available from within a VirtualBox guest?

推荐答案

使用

With a few exceptions (that don't include VirtualBox), you cannot use hardware PMU events in perf from within a virtual machine guest on Linux.

也许有些实验室计算机安装了本地Linux,或者您可以使用可引导的Linux闪存驱动器进行测试.如果您的教授是首先建议使用虚拟机的人,您可以向他们提出问题.

Perhaps there are lab computers that have native Linux installations, or you could use a bootable Linux flash drive to do you test. If your professor was the one who suggested a virtual machine in the first place, you could raise the issue with them.

这篇关于在VirtualBox guest虚拟机中运行perf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆