1

I am working with a big C++ project on VMware (Ubuntu). It has several processes and a lot of cpp files.

What I want to find out is this: While running my code, how many operations (Additions, multiplications, read, write, shift, etc...) are being performed in each of the cpp files.

I have searched a lot for this and I know that I should be looking for a profiler that gives me the number of instructions in the running code, but I didn't find any profiler yet.

I am a beginner in programming, so I will appreciate any help.

4

2 回答 2

2

Valgrind 可能是您正在寻找的。只需从包管理器安装它,然后通过添加valgrind --tool=cachegrind到命令行的开头来运行程序。

于 2013-03-07T10:05:59.097 回答
0

虽然 valgrind 是一个很棒的 linux 工具,但在 Windows 上,最好使用 Visual Studio 中内置的分析器;请注意,您需要完整版而不是免费 Express。

于 2013-03-07T10:07:41.167 回答