Function caller in linux kernel

前端 未结 4 1592
深忆病人
深忆病人 2021-01-30 03:26

Is there a way to get function caller in linux kernel? I know __func__ returns the function name which is executing. I am looking for the function whic

4条回答
  •  无人及你
    2021-01-30 04:06

    Whether or not frame pointers are needed depends on arch, IIRC. For x86, they are certainly desired to fully exploit these features. Also note that inlining can skew the accuracy of builtin_return_address for this very reason.

    If you just want a stack dump to see how some place was reached, better use the dump_stack() function than trying to fiddle around with builtin_return_address.

提交回复
热议问题