Profiling user-defined methods in android - android

Can't I use profiling for user-defined methods in android? I searched for my method name in the 'Find:' box of the profiling window. But, no use. I am using Eclipse 3.7.2 in Ubuntu 12.04. Any answers would be appreciated. Thanks in advance.

Profiling in VM-based languages, such as Java, is somewhat tricky, especially when using a sampling profiler. The VM occasionally decides to inline some methods, which may remove them completely from the view of the profiler, or reduce the time that the profiler thinks is spent in them. I have mentioned some general caveats of sampling profilers in an older answer of mine.
Instead of searching for this specific method, you could try searching for methods that call it, or for methods that are called by it. Hopefully, you will be able to discern enough information to figure out if your method is a performance concern.
Unless you provide more information on your code and how exactly you are profiling your application, it is difficult to be more specific. You should at least mention if you are using an instrumenting or a sampling profiler...

Related

How to find memory leaks for native code in post Android 18?

I am trying to find a way to find memory leaks in native code on Android apps. I have found others answers like How to Find memory leaks from native code in android, but these solutions aren't applicable post Android 18 as the DDMS no longer supports the "Native Heap" tab.
So if anyone can suggest a solution, it will be great help!
https://github.com/android/ndk/issues/431 tracks LSan support for the NDK, which will be the best option when that's done. It's not currently being worked on, but will probably be picked up once TSan is done.
https://android-arsenal.com/details/1/1775
here you go. I use this. Installation is already inside the link.
Sometimes it is freezing when dumping information but still good I think.

ART equivalent of dvmDumpAllThreads

I'm trying to debug a native Android application using gdb on a newer device.
Is there an equivalent of call dvmDumpAllThreads(true) that I can call on an ART VM?
I do not know the answer for certain, but it's interesting problem so I searched a little bit. The stacktrace on this issue, combined with the information on this page of the art documentation makes me think the answer is to call the linux command (perhaps paired with debuggrd)
abort(3);
or that an alternative might be to let it crash and look at a Tombstone report (outlined on the art documentation page I linked)
I don't generally like to make guesses, but as information seems to be scarce I thought I'd offer this. I'm sorry if it doesn't help!

Tensorflow on Android via Kivy

I found this answer that brought me to the idea instead of using the compiled tensorflow graph you might be able to use kivy on your Android phone. That way you could directly talk to the tensorflow graph using python-for-android.
A possible advantage would be to train/adapt the model on the fly. As far as I know otherwise you can only use the final trained model (but this is currently unanswered on stackoverflow). Also cross compiling to Windows Phone might be possible what currently isn't (see here).
I don't know the technical limitations. Anyone can confirm that this is possible and maybe what would be neccessary?
Although WinPhones could be a possibility in the future, there's basically a situation where almost no-one cares as there isn't really much interest about porting it. However, there's a thing in progress about using angle for translating openGL to DirectX, so it could be possible later. There's still this funny app packaging though, so it'll eat a lot of time.
Yet I think it might be possible to use those unofficial converters APK -> WinPhone app. Re TensorFlow: to me it looks like only a recipe is missing so try write one. :P

what can I use to profile C++ module code for android

Can anyone suggest some good performance profiling tool for C/C++ code
that does not require recompiling/linking. I need for android platform.
Thanks.
After searching for a while i was not able to find descent one, so i solved this issue i.e. by taking timestamp as i enter a function and as i leave a function use them to find out time spent in function, it took little effort but i was able to find out the portion which is casuing bottleneck, you can give it a try. Not as good as something already cooked but it may help you identify problems!
I have found one: ARM DS-5 Community Edition (http://ds.arm.com/ds-5-community-edition/). It seems that this tool meets my requirement.

How to record the activities of an android phone

I'm hoping to write a tweak to record all activities running on a rooted Android phone. For example, I want to record the information such as:
2012-07-31 15:03 app1:Activity01:onCreate()
2012-07-31 15:04 app1:Activity01:onStart()
...
2012-07-31 15:05 app1:Activity01:onPause()
2012-07-31 15:05 app2:Activity01:onResume()
Is is possible to do it? If so, please kindly tell me where to find the related information, books or domain knowledge I should study to accomplish this task. I'm new on Android programming but familiar with C++ and Java.
Thanks a lot!
Each Android app is executed in its own process running its own instance of the Dalvik VM. The VM normally does not provide the information you are looking for across process boundaries.
If you feel like really hacking your Android you could investigate into these two approaches:
Modify the Android API classes, basically building your own android.jar, where you can override and extend existing functionality.
Try to use the VM's debugging facility to gain access to its runtime state (see e.g. Dalvik VM debug monitor).
Bottomline: Rooting your phone is child's play compared to those hacks.
However, I would advise against trying to 'hook' into Android the way you described, both for performance and stability reasons.
So the answer was it ain't possible in a normal app, even on a rooted phone.
See comments :-)

Categories

Resources