Methods Summary |
---|
private int | aMethod()Calls other methods to make some interesting trace data.
int count = 0;
for (int ii = 0; ii < 6; ii++) {
count += bMethod();
}
for (int ii = 0; ii < 5; ii++) {
count += cMethod();
}
for (int ii = 0; ii < 4; ii++) {
count += dMethod(ii);
}
return count;
|
private int | bMethod()Calls another method to make some interesting trace data.
int count = 0;
for (int ii = 0; ii < 4; ii++) {
count += cMethod();
}
return count;
|
private int | cMethod()Executes a simple loop to make some interesting trace data.
int count = 0;
for (int ii = 0; ii < 1000; ii++) {
count += ii;
}
return count;
|
private int | dMethod(int level)Calls itself recursively to make some interesting trace data.
int count = 0;
if (level > 0) {
count = dMethod(level - 1);
}
for (int ii = 0; ii < 100; ii++) {
count += ii;
}
if (level == 0) {
return count;
}
return dMethod(level - 1);
|
public void | disableTestNativeTracingFromC()
long start = System.currentTimeMillis();
nativeMethodAndStartTracing();
long end = System.currentTimeMillis();
long elapsed = end - start;
Log.i(TAG, "elapsed millis: " + elapsed);
|
public int | eMethod()
eMethodCalls += 1;
int count = fMethod();
count += gMethod(3);
return count;
|
public int | fMethod()
fMethodCalls += 1;
int count = 0;
for (int ii = 0; ii < 10; ii++) {
count += ii;
}
return count;
|
public int | gMethod(int level)
gMethodCalls += 1;
int count = level;
if (level > 1)
count += gMethod(level - 1);
return count;
|
native void | nativeMethod()
|
native void | nativeMethodAndStartTracing()
|
public void | testMethodTracing()
long start = System.currentTimeMillis();
Debug.startMethodTracing("traceTest");
topMethod();
Debug.stopMethodTracing();
long end = System.currentTimeMillis();
long elapsed = end - start;
Log.i(TAG, "elapsed millis: " + elapsed);
|
public void | testNativeTracingFromJava()
long start = System.currentTimeMillis();
Debug.startNativeTracing();
//nativeMethod();
int count = 0;
for (int ii = 0; ii < 20; ii++) {
count = eMethod();
}
Debug.stopNativeTracing();
long end = System.currentTimeMillis();
long elapsed = end - start;
Log.i(TAG, "elapsed millis: " + elapsed);
Log.i(TAG, "eMethod calls: " + eMethodCalls
+ " fMethod calls: " + fMethodCalls
+ " gMethod calls: " + gMethodCalls);
|
private void | topMethod()
aMethod();
bMethod();
cMethod();
dMethod(5);
Thread t1 = new aThread();
t1.start();
Thread t2 = new aThread();
t2.start();
Thread t3 = new aThread();
t3.start();
try {
t1.join();
t2.join();
t3.join();
} catch (InterruptedException e) {
}
|