Integrate Valgrind in Android

Registered by Tony Mansson

[botao, 3rd November 2011]: About Valgrind, it's a awesome tool for memory check, but it requires a huge size of memory to do the work. I go through the Valgrind news and they currently don't have an official release for Android, but you can find more experimental stuff here:
http://blog.mozilla.com/jseward/2011/09/27/valgrind-on-android-current-status/
http://comments.gmane.org/gmane.comp.debugging.valgrind/11617

[mansson 2012-01-10] The key issue seems to be how to deal with memory requirements, as Android normally does not do swapping. Enabling swapping is possible and that's the chosen path in current efforts. That means however changing the runtime properties of an Android system substantially.

Using valgrind memcheck on smaller processes may be possible on a board with 1 GB RAM.

The work should start with an analysis of consequences and alternatives to swapping in Android.

[mansson 2012-01-18] Valgrind IS in AOSP! You can find some history and instructions here:
https://bugs.kde.org/show_bug.cgi?id=266035

Note that upstream Valgrind also supports building with Android NDK: http://valgrind.org/docs/manual/dist.readme-android.html

A large part of Valgrind memory is taken by CFI data, which on ARM is required for stack unwinding. One trick is to upload only those debug libraries you really need (Valgrind looks for them under /data/local/symbols).

Blueprint information

Status:
Complete
Approver:
Zach Pfeffer
Priority:
Medium
Drafter:
Tony Mansson
Direction:
Needs approval
Assignee:
Kejun ZHOU
Definition:
Approved
Series goal:
Accepted for future
Implementation:
Implemented
Milestone target:
milestone icon 12.01
Started by
Kejun ZHOU
Completed by
Tony Mansson

Related branches

Sprints

Whiteboard

Meta:
Roadmap id: ANDROID2011-DEVTOOLS-1

Notes:
[pfefferz 2012/1/18] Add notes here like this. :)

[kejun-zhou 2012/1/18].
The valgrind is already in the ICS 4.0.3.

[mansson 2012-01-26] The Wiki page is here: https://wiki.linaro.org/Platform/Android/UseValgrindOnAndroid

Headline:
Valgrind is now included in Linaro Android

Acceptance:
It is possible to build Linaro Android so that valgrind is enabled and useful. Usage of valgrind in Android is documented.

(?)

Work Items

Work items:
Valgrind in android.git.linaro.org: DONE
Create wiki documentation: DONE

This blueprint contains Public information 
Everyone can see this information.