How to view "syslog" outputs?

645 views
Skip to first unread message

ooowjc

unread,
Jul 7, 2011, 3:57:51 AM7/7/11
to Android-x86
Hi, developers!

I am currently modifying "android-x86/bionic/libc/netbsd/net/
getaddrinfo.c" and would like to see any outputs from this file. I see
several "syslog" statements in this file, could anyone tell me the
steps to view the "syslog" outputs?

BTW, I have tried to include <android/log.h> and use
"__android_log_write(ANDROID_LOG_ERROR,"Tag","Message");" in
"getaddrinfo.c". I also added "LOCAL_LDLIBS := -llog
LOCAL_C_INCLUDES += system/core/include/cutils
LOCAL_SHARED_LIBRARIES := libcutils" in the place building
"libc_common.a" in "~/android-x86/bionic/libc/Android.mk" but the
build system still reports "undefined reference to
`__android_log_write'
collect2: ld returned 1 exit status".

Finding valid outputs statements in "getaddrinfo.c" is driving me
crazy recently. Anyone could help??

Thanks in advance.

Jiechao Wang

ooowjc

unread,
Jul 7, 2011, 4:13:08 AM7/7/11
to Android-x86
I have also tried to add "LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog"
instead of "LOCAL_LDLIBS := -llog
LOCAL_C_INCLUDES += system/core/include/cutils
LOCAL_SHARED_LIBRARIES := libcutils"
but the same error occurred.

Bryan Hundven

unread,
Jul 7, 2011, 11:54:37 AM7/7/11
to andro...@googlegroups.com
from your build:

./out/host/linux-x86/bin/adb connect <ip address of your device>
./out/host/linux-x86/bin/adb logcat

or you can type: logcat
from the terminal emulator in dev tools on the device.
If your trying to debug something early in the boot process, it might
be more useful to get a host-to-host usb cable <type-a to type-a> and
setup usb gadgets to run in device mode so you can use adb over usb.

Otherwise, you have to add console=ttyUSB0,115200 and compile in a usb
serial driver and usb serial console support (or ttyS0 if you actually
have a serial port), and capture the output of the serial console to a
log file before you start doing this.
As soon as you see a prompt on the serial console quickly type: logcat

This is what I've been doing, but if someone has a better way, it
would be really helpful!

> --
> You received this message because you are subscribed to the Google Groups "Android-x86" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-x86...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
>
>

-Bryan

Chih-Wei Huang

unread,
Jul 7, 2011, 10:20:56 PM7/7/11
to andro...@googlegroups.com
在 2011年7月7日下午11:54,Bryan Hundven <bryanh...@gmail.com> 寫道:
> This is what I've been doing, but if someone has a better way, it
> would be really helpful!

Since android-x86 2.2, the output of logcat
will be saved to /data/log.txt in debug mode.

If you run non-debug mode, you may start
logcat service manually:

start logcat

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

ooowjc

unread,
Jul 8, 2011, 3:07:43 AM7/8/11
to Android-x86
Thank you for your response, I know "logcat" but I don't think
"syslog" will output to "logcat".

ooowjc

unread,
Jul 8, 2011, 3:08:09 AM7/8/11
to Android-x86
Does "syslog" really output to "logcat"??

On 7月8日, 上午10时20分, Chih-Wei Huang <cwhu...@android-x86.org> wrote:

Bryan Hundven

unread,
Jul 8, 2011, 3:09:16 AM7/8/11
to andro...@googlegroups.com
2011/7/7 Chih-Wei Huang <cwh...@android-x86.org>:

> 在 2011年7月7日下午11:54,Bryan Hundven <bryanh...@gmail.com> 寫道:
>> This is what I've been doing, but if someone has a better way, it
>> would be really helpful!
>
> Since android-x86 2.2, the output of logcat
> will be saved to /data/log.txt in debug mode.
>
> If you run non-debug mode, you may start
> logcat service manually:
>
> start logcat

ah. thanks CW!

> --
> Chih-Wei
> Android-x86 project
> http://www.android-x86.org
>

Reply all
Reply to author
Forward
0 new messages