什么指令'instCount' Pin 工具计数? [英] What instructions 'instCount' Pin tool counts?
问题描述
我在基本 C 程序上运行 pintool 'instCount',主函数中的主体为空.
I run pintool 'instCount' on basic C program with empty body within the main function.
int main() {
int main() {
}
当我在这个程序可执行文件上运行 instCount 时,它显示了大约 86000 条指令.连程序都很小,为什么要生成这么多指令..??知道吗.??
When I run the instCount on this program executable , it shows around 86000 instructions. Even the program is very small why so many instructions are genrated..??Any idea.??
谢谢
推荐答案
缺少的是在幕后,做了很多工作才能让您到达 main() 函数的执行点.运行时需要执行很多工作才能提供您期望获得的环境.例如:
What's missing is that behind the scenes, a lot of work is done to get you up to the point where the main() function is executed. There is a lot of work that the runtime needs to perform in order to provide the environment as you expect to get it. For example:
- 必须加载和初始化库.
- 需要分配和初始化内部数据结构(例如动态内存分配器).
- 环境中有多种因素可能会改变运行时应有的方式.这需要检查并采取行动.
我列出的事情只是启动期间发生的事情的非常部分列表.关闭期间也会发生类似的事情,这也会增加指令数.
The things I listed are just a very partial list of what happens during startup. Similar things occur during shutdown which also add to the instruction count.
这篇关于什么指令'instCount' Pin 工具计数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!