Karim Yaghmour gave a useful presentation on debugging techniques at AnDevCon 2016 in Boston. One of the topics he briefly discussed were the native tools that you can use to help troubleshoot issues with a deployed firmware image on a target. The native tools mentioned were:
He didn’t have time to mention how to get those tools into your firmware image. They are in myandroid/system/extras. Just add the LOCAL_MODULE name in each folder’s Android.mk to your PRODUCT_PACKAGES list in the appropriate device make file and if you want those tools in your standard user builds, change LOCAL_MODULE_TAGS in each folder’s Android.mk to optional (default is debug). Look at Change tags on some native tools used in debugging on user builds and PRODUCT_PACKAGES for exact details. Most of these tools will go in system/xbin because of the use of TARGET_OUT_OPTIONAL_EXECUTABLES for the LOCAL_MODULE_PATH.