Android笔记-Linux Kernel Ftrace (Function Trace)解析(二)

2014-11-24 09:02:07 ? 作者: ? 浏览: 1
(__aligned__(4))) \


__attribute__((section("_ftrace_annotated_branch"))) \


______f = { \


.func = __func__, \


.file = __FILE__, \


.line = __LINE__, \


}; \


______r = likely_notrace(x); \


ftrace_likely_update(&______f, ______r, expect); \


______r; \


})


函式ftrace_likely_update (位置在kernel/trace/trace_branch.c)实作如下所示,


void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect)


{


/*


* I would love to have a trace point here instead, but the


* trace point code is so inundated with unlikely and likely


* conditions that the recursive nightmare that exists is too


* much to try to get working. At least for now.


*/


trace_likely_condition(f, val, expect);


/* FIXME: Make this atomic! */


if (val == expect)


f->correct++;


else


f->incorrect++;


}


-->

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: