top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Android: How can i get the stack trace of function , if i can change the framework and build?

+1 vote
410 views
Android: How can i get the stack trace of function , if i can change the framework and build?
posted Jun 16, 2014 by Daler

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

When I need that, I usually insert code that looks like this:

StackTraceElement stack[] = Thread.currentThread().getStackTrace();
for (StackTraceElement e: stack) Slog.i(TAG, " " + e.toString());
answer Jun 16, 2014 by Dewang Chaudhary
Similar Questions
+1 vote

I am doing some changes in frameworks/base/, so i just wanted to know whether there is a faster process of building it. Currently what i follow is very slow i.e. I do

$ make -j4 installclean // which cleans *.img files from the /out folder
$ make -j4

and finally it creates all *.img. So apart from the above process, is there a way for a single line of change can be built fast ?

+3 votes

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!

+3 votes

I need to change the Wifi channel programmatically (Of course, I will enable the Wifi to function as Hotsopt first).
Is there any API/Driver in the source code that I can use?

0 votes

I want to show the network signal strength in my app. I am using LTE network for transmitting data and want to show any real time variations in network strength. I was able to get the GSM signal strength but how can I get the same for LTE?

+1 vote

I want to define a new theme in framework, and override the alert dialog style. Please help...

...