top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Android: Getting call stack trace "overhead"

+3 votes
386 views

I have a question about "overhead" of getting call stack trace.Based on my understanding of dalvik code (ArrayObject* dvmDdmGetStackTraceById(u4 threadId) in dalvik/vm/Ddm.cpp file),call stack trace are tracked after all other threads are suspended.

However, "suspend" does not mean suspending all other threads but it means "just wait until all other threads sleep themselves".

So my questions are:

  1. To make all other threads sleeping themselves, does dalvik VM do some special actions such as periodically suspend all threads or something?How all other threads sleeping themselves? In Unix kernel, timer interrupt enforces all threads to sleep periodically. How it works in dalvik VM?

  2. Does "just wait until all other threads sleep themselves" imply that getting call stack trace does not interfere other threads and does not have any impact on the performance of other threads?Thus, does it just have overhead of "waiting time until all other threads sleep themselves" + "tracking call stack trace"?

If someone answer clearly these questions, it would be very helpful to me.Thanks very much!

posted Jan 6, 2015 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
I had mistakes that it does not suspend all other threads. It just suspends the target thread.
So my questions are:
1. To make a thread sleeping itself, does dalvik VM do some special actions such as periodically suspend a thread or something?How a thread sleeping itself? In Unix kernel, timer interrupt enforces all threads to sleep periodically. How it works in dalvik VM?
2. Does "just wait until a thread sleeps itself" imply that getting call stack trace does not interfere other threads and does not have any impact on the performance of other threads?Thus, it just have overhead of "waiting time until the thread sleeps itself" + "tracking call stack trace"?

Similar Questions
+2 votes

I changed the Android kitkat framework to add the logging statement whenever an application creates an intent. For the same I did changes in the file framework/base/core/java/android/content/Intent.java . However, there are different overloaded methods in this file for creating the intent. Some have the package info but other don't have.

Please let me know how to got the package from which the intent is created.

+2 votes

I need to find all cities, towns or postal codes in radius of 20 km from place specified by latitude and longitude.

I've tried Places search from Google Places API with this query:

https://maps.googleapis.com/maps/api/place/radarsearch/json?location=53.09022140,21.21483510&radius=20000&types(locality|postal_code)&sensor=false&key=myKey

but this seems not to work with geocode places (only business results are presented).

I've also read about Place Searches in Places Library of Google Maps JavaScript API v3, but I'm not sure if this is appropriate for Android Application (I have a http/php server, but I'm not sure how can I use it with my Android App). Can I use it directly from my application?

Maybe I could achieve it using other service? Do you have any suggestions?

+6 votes

Is there any API in CallLog.Calls class to get Operator Name

+4 votes

I want the complete stack trace, mainly the list of functions traversed in a normal execution of a binary.
AFAIK, GDB provides the trace only when it hits a break point or in case of a crash.

...