ART equivalent of dvmDumpAllThreads - android

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!

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.

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.

Profiling user-defined methods in 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...

Customizing Android

I want to use Android for a system I have in order to use it as an embedded system that would run a specific application (which runs in chrome browser). However, this will not use Android in ordinary way, but rather hack around it so that libraries like OpenCV and packages like Chromium can be installed on the Android's Linux kernel. In addition, I would also need to figure out a way that would allow a USB camera to be supported.
I have done some research on this, but I am getting nowhere. Would somebody recommend resources that are relevant to this issue, or suggestions on how to approach it? Your feedback would be much appreciated.
Edit1: I am not intending for this question to be too broad. I only want to get more ideas on how you add libraries like OpenCV to Android, and whether there is a way to install the chrome browser as well.
Edit2: the Android system is on the Snapdragon platform.
Both Chromium and OpenCV can be built on Linux, have you tried compiling them from source on Android and failed? What error did you get? Here's a link for cross-compiling Chrome for ARM processors:
http://code.google.com/p/chromium/wiki/LinuxChromiumArm
I would use http://www.android-x86.org/ first and see if it works there before trying to run it on ARM so that you can fail faster if it doesn't work.
You might want to spend some time with ROM hackers to get more insight. Ideally, you want to find some people who are doing something similar so you can work with them. Take a look at:
http://forum.cyanogenmod.com/
http://forum.xda-developers.com/
A lot of what those guys are doing does not apply to what you are looking for, but they do get much deeper into the OS than most programmers. You might get lucky, and not have to modify the Android source code yourself as thinksteep mentions.

Port possible? (grim fandandroido)

The dream is to run Grim fandango on my android,
And i stumbled onto 'residual' (http://residual.sourceforge.net/ it's a c++ application) and someone who made it to run on his nokia n900 (http://www.youtube.com/watch?v=TO9a5nTMHYI).
So for the question, would this be possible for android? My initial thought was the support debian and ubuntu and my android is faster then the n900, why not?
So before i spend days/weeks learning and getting it to work on my android,
I thought it might be a good idea to ask people who actually know about these things if its even possible.
And maybe how much work it really would be, in my head it's currently only:
make allot of Android.mk's
try to compile and fix errors still it works.
Which (if i don't get to many errors) doesn't sound to hard.
Any thoughts are welcome,
Thanks for reading!
I'd say your goal is totally feasible.
Residual seems to rely on standard C++ libraries, plus OpenGL and SDL. For the latter, there are actually several SDL Android ports out there you can take advantage of.
Somebody familiar with Android and the NDK could probably get Residual to a somewhat playable state in a few days (a proper port would take much longer ofc). If you're new to the platform however, you should be prepared to spend several weeks learning the basics of native application development in Android before tackling the project.

Categories

Resources