Version 3.6.0 of Valgrind was released a couple of weeks ago. Probably the largest change this release is the addition of support for Linux running on ARM.Valgrind is a GPL'd framework for building simulation based debugging and profiling tools, plus a set of "standard" tools. The best known of these is Memcheck, a memory error detector, but in fact it is only one of eight tools in the standard distribution: two memory checkers, two thread checkers, two performance profilers and two space profilers.
You can download the sources from www.valgrind.org. Alternatively, you may be able to get pre-built packages via your Linux distro, or via Linaro, although note that the 3.6.0 upstream release post-dates pre-built packages. 3.6.0 is known to work on Ubuntu 10.04 and 10.10 on ARM, and on the Nokia N900 running Maemo 5.
Also available online is full documentation. For those impatient to get going, the quick start guide tells you the bare minimum needed to get started.
What works, what doesn't?
Valgrind runs your code on an instrumented, synthetic CPU. Hence the level of instruction set coverage is important. 3.6.0 contains a fairly complete implementation of the ARMv7-A user space instruction set, including ARM and Thumb integer code, VFPv3, media v6 and NEON instructions, but not including ThumbEE or Jazelle. It works well enough to run multi-million lines of C++ sized applications (OpenOffice scale) as well as a smattering of hand-optimized ARM codecs.
Which tools work?
Valgrind pushes the boundaries of what can be done by runtime code instrumentation, so not everything works on every platform. For 3.6.0 on ARM-Linux, the tool situation is:
- Memcheck (heap error detector) works.
- Cachegrind (low level cache profiler) works.
- Massif and DHAT (heap profilers) work.
- Callgrind (a profiler like Cachegrind but which is call/return aware) doesn't work properly, because of difficulties reliably identifying calls and returns on ARM. Getting this fixed is a priority.
- Ptrcheck (a detector for stack/global array overruns) doesn't work.
- Helgrind and DRD (thread error detectors) should work in principle, but haven't received much testing.
- Stack traces generated by Valgrind will stop in any library for which debug information is not available. This is different from the behavior on all other targets, in which missing debug info merely leads to non-identification of code addresses, but does not break the traces. This is because, on ARM-Linux, stripped objects do not have even the minimal Dwarf CFI needed for unwinding.
- You need to be running a kernel configured for hardware TLS, else all attempts to run Valgrind will segfault at startup. See here.
If you have questions or difficulties, feel free to mail our users or developers mailing lists, here. Bugs should be reported at here.
There will likely be a 3.6.1 release before the end of the year, to clear up any critical issues resulting from the recent 3.6.0 release. So if you want to try Valgrind on ARM-Linux, now would be a good time!
Guest Blogger:
Julian Seward, Valgrind, He is the founder and one of principal architects of the Valgrind project. His long term interests are in the field of tools and techniques for creating reliable software.
ARM welcomes its wealth of Partners in the ARM Connected Community (CC) to submit guest blogs to be published on our multiple community blogs. If interested in participating please submit email inquiries to Tell.Us@arm.com.
The ARM Connected Community (CC) is an extensive ecosystem covering all aspects of ARM-based design, from chip implementation through to system and device design. The CC provides a platform for collaborative innovation, with multiple types of forums for members to work with one another, and with customers, to solve industry challenges, all with the purpose of enabling designers to focus on differentiating features and an accelerated time-to-market for ARM powered solutions.
All company and product names appearing in the ARM Blogs are trademarks and/or registered trademarks of ARM Limited per ARM’s official trademark list. All other product or service names mentioned herein are the trademarks of their respective owners.
0 Comments On This Entry
Please log in above to add a comment or register for an account
»
Blog Tags
»
Search My Blog
»


Leave Comment











