简体   繁体   English

OProfile样本意味着自我还是包容性?

[英]OProfile sample means self or inclusive?

The samples given by OProfile in the flat report, are they the samples for the function itself, or they are the samples for the function itself plus samples for the functions it calls? 由OProfile在平面报告中提供的示例,是函数本身的示例,还是函数本身的示例加上其调用的函数的示例? I tried to look at the docs, tutorials but could not find a concrete answer. 我试图查看文档,教程,但找不到具体答案。 My feeling is that it is samples for self, more precisely, the number of samples when the CPU is executing instructions for the body of the function but not in the function it calls. 我的感觉是,它是用于自身的样本,更准确地说,是CPU在执行针对函数主体的指令时(而不是在其调用的函数中)执行时的样本数。

It's hard to tell from the doc, but if you have turned on stack sampling, it seems to say that every return address on the stack is treated as if it is a program-counter sample. 很难从文档中得知,但是如果您打开了堆栈采样,似乎是说堆栈上的每个返回地址都被当作程序计数器样本来对待。 If it does that, then the time would be inclusive, provided it handles recursion properly. 如果这样做的话,那么时间就将是包括在内的, 前提是它能够正确处理递归。

To handle recursion properly, if a function appears more than once on a sample, it should only be counted once. 为了正确处理递归,如果一个函数在一个样本上出现多次,则应该只计数一次。

Also, I can't tell from the doc if the samples are suspended during I/O or sleeps, which they should not be, unless you want to be blind to those. 另外,我无法从文档中得知在I / O或睡眠期间是否暂停了样本,否则不应这样做,除非您不想对这些样本视而不见。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM