Re: How to see Android bootloader debugging (LOG/stdout) messages

4,913 views
Skip to first unread message

Jayesh Kumar Tank

unread,
Oct 26, 2012, 10:55:53 AM10/26/12
to android-...@googlegroups.com
dmesg or /proc/kmsg could be of help.

On Thursday, October 25, 2012 9:41:18 PM UTC+5:30, CaptainM wrote:
Hi,

I'm currently looking into the Android bootloader source code and I would like to see the debugging messages which are printed by LOGE/LOGI/... These are printed by "fprintf(stdout, <message>)". For examples see here: https://code.google.com/p/android-source-browsing/source/browse/common.h?repo=platform--bootable--recovery line 27.
Since stdout pipes to /dev/null: is there a way to change this? I want to see these messages while I'm in the bootloader of a mobile device (it's an HTC Desire by the way). The messages I would like to see are at the very beginning where even ADB is not yet active. So Logcat or shell commands on the device can't be used at this time. So I wonder if there is any way to set a parameter to save these messages in a file until I remove the parameter or something. I don't want to make changes to the bootloader source code and compile my own, if possible. The device is rooted and I can write on the NAND storage, if needed.

Thanks in advance for any help!

CaptainM

unread,
Oct 27, 2012, 1:16:42 PM10/27/12
to android-...@googlegroups.com
The messages won't show up in dmesg, /proc/kmsg, /proc/last_kmsg and the logging files in /data/system/dropbox.
I even tried to replace /dev/null with a file so I can read it afterwards, but it seems to get replaced at the reboot of the device. So I'm quite desperate.

Best regards

Jayesh Kumar Tank

unread,
Oct 29, 2012, 1:56:22 AM10/29/12
to android-...@googlegroups.com
In that case, please check aplogs which are persistent across boot and contains these logs.

CaptainM

unread,
Oct 29, 2012, 6:17:16 AM10/29/12
to android-...@googlegroups.com
I'm sorry but I don't know what "aplogs" is. Could you elaborate on this? Like a path where I can find those logs? I couldn't find anything with the filename "*aplog*" (*: wildcard).

Regards

CaptainM

unread,
Nov 8, 2012, 3:53:16 PM11/8/12
to android-...@googlegroups.com
Sorry to push this, but maybe anyone knows what this "aplogs" is, it would be very much appreciated!

Jayesh Kumar Tank

unread,
Nov 9, 2012, 9:25:20 AM11/9/12
to android-...@googlegroups.com
aplog is nothing but the combination of kernel events, ril events mixed with logcat. Create a service to redirect these event to merge with logcat in init.rc file so that this service runs at boot time and save the output to /logs/aplog file. This can be seen later when adb is up. It should look something like this(not tested):

service logcat /system/bin/logcat -f /dev/kmsg -f dmesg -r 20000  -f /data/aplog
    oneshot
    user root


Hope this helps.

CaptainM

unread,
Nov 19, 2012, 6:08:42 AM11/19/12
to android-...@googlegroups.com
Hello,

just in case somebody else ever wants to see these messages:
It seems like all printf() and fprintf() messages are written to /data/data/log, at least on the HTC Desire.

Thank you very much for your help, Jayesh.

Best regards
Reply all
Reply to author
Forward
0 new messages