What is the meaning of Incl CPU Time, Excl CPU Time, Incl Real CPU Time, Excl Real CPU Time in traceview?
Asked Answered
A

4

31

1) Exclusive time is the time spent in the method 2) Inclusive time is the time spent in the method plus the time spent in any called functions 3) We refer to calling methods as "parents" and called methods as "children." Reference Link : Click here

Question here is :

what are difference between

  • Incl CPU Time & Incl Real CPU Time ?
  • Excl CPU Time & Excl Real CPU Time ?

in my one example trace file for Method1() : Incl CPU Time = 242 msec & Incl Real CPU Time = 5012 msec

  • i can not identify reason behind 5012-242 = 4770 msec gap in above both times.

Please help me if you have any idea.

Anthropopathy answered 2/4, 2013 at 9:21 Comment(0)
A
10

cpu time is the time for which the process uses the cpu and cpu real time is the total time from the starting of process to end of process it includes waiting time of process to execute.

Airmail answered 25/4, 2013 at 4:0 Comment(1)
i will check my logs, and compare with your answers. from your answer we can see that cpu ream time is less than cpu time. i will accept your answer after checking this details. thanks for help.Anthropopathy
L
40

Here's the DDMS documentation

Incl CPU time is the inclusive cpu time. It is the sum of the time spent in the function itself, as well as the sum of the times of all functions that it calls.

Excl CPU time is the exclusive cpu time. It is only the time spent in the function itself. You'll notice that it is always the same as the "incl time" of the "self" child.

The documentation doesn't clarify the difference between CPU time and real time, but I agree with Neetesh that CPU time is the time that the function is actually running (this would not include waiting on IO) and the real time is the wall clock time (which would include time spent doing IO).

Lundquist answered 27/7, 2013 at 21:36 Comment(0)
A
10

cpu time is the time for which the process uses the cpu and cpu real time is the total time from the starting of process to end of process it includes waiting time of process to execute.

Airmail answered 25/4, 2013 at 4:0 Comment(1)
i will check my logs, and compare with your answers. from your answer we can see that cpu ream time is less than cpu time. i will accept your answer after checking this details. thanks for help.Anthropopathy
A
1

Just as Chris and David said, I did a test.

#include <unistd.h>

#define S ((long long)1000 * 1000 * 1000)

// My CPU frequency is 3 GHz
void run()  {
    for (int i = 0; i < S; ++i);
}

void g() {
    run();
    run();
    run();

    for (int i = 0; i < S; ++i);
}

int main() {
    g();
    // run();

    return 0;
}

As you can see, the inclusive time of function g is 8 s and its exclusive time is 2 s: CPU Time

Artist answered 14/11, 2022 at 2:30 Comment(0)
R
0

from the source code of .trace, you can see the cpu time detail different from the real cpu time, it's the same with the description of the android doc: CPU time considers only the time that the thread is actively using CPU time, and real time provides absolute timing information from the moment your app enters a method to when it exits that method—regardless of whether the thread is active or sleeping.

Reno answered 1/8, 2018 at 10:3 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.