gcc: 选项:-mfentry

文章目录

简介

-mfentry
-mno-fentry
If profiling is active (‘-pg’), put the profiling counter call before the prologue. Note: On x86 architectures the attribute ms_hook_prologue isn’t possible at the moment for ‘-mfentry’ and ‘-pg’.
如果没有看过ABI相关的文档,可能一开始不能理解before the prologue;这里的prologue其实在ABI有专有的含义,就是代表函数实际执行之前做的一些准备工作。
这里的mfentry的作用,就是在这些准备工作之前做一些函数调用,或者其他类似的事情。

实例

https://mzhan017.blog.csdn.net/article/details/122283614
ftrace使用了这个功能。不排除,是为了实现ftrace,而开发了mfentry功能。

猜你喜欢

转载自blog.csdn.net/qq_36428903/article/details/125967422