Android traceview - behavior on Android 3.2 vs. 4.1

132 views Asked by At

This question is not about the meaning of the data columns presented by traceview - I think I understand that.

I noticed a couple of things when looking a traces in traceview captured on an Android 3.2 devices vs. an Android 4.1 device. My question is whether these are known improvements that were made for the newer Android releases, or if they are a limitation of the device, or if they are not artifacts but are actually meaningful.

The two devices/OSes I'm comparing

  • Samsung Galaxy Tab 10.1 with 2 cores, running Android 3.2
  • Google Nexus 7 tablet with 4 cores, running Android 4.1

The first thing I noticed is that for traces captured on the Samsung Galaxy Tab with Android 3.2, there are no "Real Time" columns, only "CPU Time" columns. Does anyone know why?

The second thing I noticed is that although the Samsung Galaxy Tab with Android 3.2 has two cores, the traceview thread activity lines for captures taken from the Samsung Galaxy Tab always show only one thread running at any exact point in time. Whereas for the Google Nexus 7, multiple threads are shown running simultaneously.

The app running for both devices is a test app that launches some threads and then each thread, including the main UI thread, loops for awhile calculating the Fibonacci sequence. There is no reason why two of these threads can't run simultaneously, on the Samsung Galaxy Tab or any other device with 2 cores. Furthermore, the time it takes perform a fixed amount of calculation is about the same for each thread when there are 2 threads vs. when there is only 1 - so the 2 threads must really be executing simultaneously as expected. Then when there are 3 threads on the 2-core device, the time it takes for each thread to do the calculation is increased by 50% which is exactly what I expect.

So, I think this is just a limitation of trace capturing on the Samsung Galaxy Tab 10.1 running Android 3.2. On this device for "real" apps with a lot of calls, traceview appears to show two threads running simultaneously but if I zoom all the way in, the activity is actually interleaved and never are two threads shown as active at the same time.

0

There are 0 answers