Linux内核转存,linux-kernel – 内核线程转储中的“isra”是什么

isra is the suffix added to the function name when gcc option -fipa-sra compiler optimization being carried out.

-fipa-sra

Perform interprocedural scalar replacement of aggregates, removal of unused

parameters and replacement of parameters passed by reference by parameters passed

by value.

Enabled at levels -O2, -O3 and -Os.

在此选项下优化的所有函数都会在其名称后附加isra.我深入研究了gcc代码并找到了附加字符串的函数.

tree

clone_function_name (tree decl, const char *suffix)

{

tree name = DECL_ASSEMBLER_NAME (decl);

size_t len = IDENTIFIER_LENGTH (name);

char *tmp_name, *prefix;

prefix = XALLOCAVEC (char, len + strlen (suffix) + 2);

memcpy (prefix, IDENTIFIER_POINTER (name), len);

strcpy (prefix + len + 1, suffix);

#ifndef NO_DOT_IN_LABEL

prefix[len] = '.';

#elif !defined NO_DOLLAR_IN_LABEL

prefix[len] = '$';

#else

prefix[len] = '_';

#endif

ASM_FORMAT_PRIVATE_NAME (tmp_name, prefix, clone_fn_id_num++);

return get_identifier (tmp_name);

}

这里,参数2,const char *后缀是“isra”,并注意函数宏ASM_FORMAT_PRIVATE_NAME的底部,它将clone_fn_id_num作为其第三个参数.这是在“isra”之后找到的任意数字.其名称是在此编译器选项下克隆的函数计数(或者可以是跟踪所有克隆函数的全局计数器).

如果你想了解更多,请在文件gcc / tree-sra.c中搜索modify_function,然后调用cgraph_function_versioning(),它将“isra”作为最后一个参数.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值