8

There are two kinds of times in Trace OpenGL calls in DDMS, the Wall Times and the Thread Time, so what do they mean? And what is the difference between the two?

I could only see that most Thread Time is equal to the Wall Time, while some of the Thread Time is less than the Wall Time. enter image description here

Torrence
  • 448
  • 3
  • 20

1 Answers1

8

The names make it fairly clear. When talking about performance timing, "wall clock time" refers to the actual time that passed. It refers to the time you would see on a wall clock (with very high resolution, of course). So in this case, Wall Time refers to the total amount of time that passed between the point the call was made, and the point the call returned.

Thread Time is the amount of time that passed while the rendering thread was scheduled. This time will always be at most as much as Wall Time. It will be identical if no other threads were scheduled, and less if other threads were scheduled while the call was processed.

Even though you didn't ask about this, I'll still mention something very important you need to be aware of when looking at these times: They measure the amount of time spent in the driver to handle the API call, which mostly includes just changing internal state and generating commands for the GPU. Due to the asynchronous nature of OpenGL, these times have nothing to do with how long the GPU takes to execute the generated commands. For example, if you look at the time shown for a glDrawElements() call, it has absolutely nothing to do with how long the GPU takes to do the rendering. Therefore, the times are mostly useless, IMHO, unless what you're interested in is measuring the CPU overhead for the calls.

Reto Koradi
  • 53,228
  • 8
  • 93
  • 133
  • Thanks Reto, so 'Trace for OpenGL ES' tool measures the time that CPU generates graphical commands while the time has nothing to do with executing in GPU. I am new to the tool and I have not found much document about it, could you please recommend some reading material about it? – Torrence Aug 12 '14 at 05:42
  • I'm not aware of much documentation. The code for the actual trace collection is at https://android.googlesource.com/platform/frameworks/native/+/master/opengl/libs/GLES_trace/src/. To see where the times are collected for the calls, see gltrace_api.cpp in that directory. – Reto Koradi Aug 12 '14 at 06:22
  • I will check the file. Thanks for your help :) – Torrence Aug 12 '14 at 06:31