Archive for January, 2011

Disassembling the TI ez430 chronos – an open source watch software development

Following procedure at:

http://karuppuswamy.com/wordpress/2010/10/07/debugging-ez430-chronos-with-mspdebug-tool-in-ubuntu-linux/

and

http://mspdebug.sourceforge.net/fet.html

I managed to extract out the firmware for the chronos:

mspdebug -R “hexout 0x8000 0xffff ez430-firmware.hex”

Trying to open interface 1 on 002
rf2500: warning: can’t detach kernel driver: No data available
FET protocol version is 30001000
Configured for Spy-Bi-Wire
Set Vcc: 3000 mV
Device ID: 0x6137
Device: CC430F6137
Code memory starts at 0x8000
Reading 128 bytes from 0x8000…
Reading 128 bytes from 0x8080…

(The reason ” -B /dev/ttyACM0″ is not used is because it gave the following errors:

mspdebug -B /dev/ttyACM0 “hexout 0x8000 0xffff ez430-firmware.hex”

bsl: couldn’t read bootloader transition acknowledgement)

It is possible to disassemble using the mspdebug tool, but using gdb remote feature is more powerful – as the full suite of features under gdb is available. To build the cross-compiled version of gdb the following is the procedure to build msp430-gdb:

http://zolertia.sourceforge.net/wiki/index.php/Howto_compile_mspgcc_from_the_source

(the errors of “error: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result” will be encountered many times over. Just modify the line by wrapping it with “assert( getcwd()!= NULL);” and insert the line “#include <assert.h>” at the top of the C file – and subsequently everything will compile successfully.)

The following are the steps for connection:

First connect direct to the device (implicitly via /dev/ttyACM0) using mspdebug and “gdb” as an option:

In one terminal enter:

mspdebug -R
Code memory starts at 0x8000
(mspdebug) gdb
Bound to port 2000. Now waiting for connection…

And in another terminal issued the msp430-gdb command:

msp430-gdb
(gdb) target remote localhost:2000
(gdb) info registers
pc/r0: e958 sp/r1: 0000 sr/r2: 0000 r3: 0000
fp/r4: 0000 r5: 0000 r6: 0000 r7: 0000
r8: 0000 r9: 0000 r10: 0000 r11: 0000
r12: 0000 r13: 0000 r14: 0000 r15: 0000
(gdb) x /10i $pc
0xe958: mov #11260, r1 ;#0x2bfc
0xe95c: .word 0x1800; ????
0xe95e: mov.b #-2932, &0x1ea8 ;#0xf48c
0xe964: .word 0x1800; ????
0xe966: mov.b #-2932, &0x1eac ;#0xf48c
0xe96c: .word 0x13b0; ????
0xe96e: and.b @r4, r12
0xe970: tst r12
0xe972: jz $+6 ;abs 0xe978
0xe974: .word 0x13b0; ????

Ok, disassembled successfully. On the other hand, dumping the firmware is not really necessary really – as the source code for the ez430 Chronos is openly available:

http://focus.ti.com/lit/sw/slac388/slac388.zip

http://www.lengal.net/git/?p=chronos;a=summary

http://code.google.com/p/rit-ti-ez430/source/detail?r=21

As mentioned here:

http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/32220.aspx

the source code compiled is identical to that in the firmware – but only when when compiled using the “Full edition” of the IAR tool.

Reference TI documentation:

http://focus.ti.com/lit/ds/symlink/cc430f5133.pdf
http://focus.ti.com/lit/ds/symlink/cc430f6137.pdf
http://focus.ti.com/lit/ug/slau292c/slau292c.pdf
http://focus.ti.com/docs/toolsw/folders/print/ez430-chronos.html?DCMP=Chronos&HQS=Other+OT+chronos

After doing a checkout of the source code:

svn checkout http://rit-ti-ez430.googlecode.com/svn/trunk/ rit-ti-ez430-read-only

Here are my analysis of the major features of the source codes.

What is the main functions and flow?

extern void display_update() is called from 1 sites in this file.
It appears to be inlineable (size = 189 units)
It has 3 non-trivial scope blocks nested 3 deep.
It calls these functions:
display_symbol() (3 times)
is_bluerobin() (1 times)
display_chars() (2 times)
memcpy() (5 times)
clear_line() (3 times)
? () (7 times)

extern void idle_loop() is called from 1 sites in this file.
It appears to be inlineable (size = 5 units)
It has 3 non-trivial scope blocks nested 3 deep.
It calls these functions:
to_lpm() (1 times)

extern void init_application() is called from 1 sites in this file.
It appears to be inlineable (size = 113 units)
It has 3 non-trivial scope blocks nested 3 deep.
It calls these functions:
ps_init() (1 times)
Timer0_Init() (1 times)
init_buttons() (1 times)
lcd_init() (1 times)
as_init() (1 times)
radio_powerdown() (1 times)
radio_reset() (1 times)
_enable_interrupts() (1 times)
_disable_interrupts() (1 times)
SetVCore() (1 times)

extern void init_global_variables() is called from 1 sites in this file.
It appears to be inlineable (size = 53 units)
It has 3 non-trivial scope blocks nested 3 deep.
It calls these functions:
read_calibration_values() (1 times)
battery_measurement() (1 times)
reset_batt_measurement() (1 times)
reset_temp_measurement() (1 times)
reset_rf() (1 times)
reset_bluerobin() (1 times)
reset_acceleration() (1 times)
reset_altitude_measurement() (1 times)
reset_stopwatch() (1 times)
reset_buzzer() (1 times)
reset_alarm() (1 times)
reset_date() (1 times)
reset_clock() (1 times)

extern int main() is called from 0 sites in this file.
It has 3 non-trivial scope blocks nested 3 deep.
It calls these functions:
display_update() (1 times)
process_requests() (1 times)
wakeup_event() (1 times)
idle_loop() (1 times)
test_mode() (1 times)
init_global_variables() (1 times)
init_application() (1 times)

extern void process_requests() is called from 1 sites in this file.
It appears to be inlineable (size = 49 units)
It has 3 non-trivial scope blocks nested 3 deep.
It calls these functions:
start_buzzer() (1 times)
battery_measurement() (1 times)
do_acceleration_measurement() (1 times)
do_altitude_measurement() (1 times)
temperature_measurement() (1 times)

extern void read_calibration_values() is called from 1 sites in this file.
It appears to be inlineable (size = 116 units)
It has 3 non-trivial scope blocks nested 3 deep.
It calls these functions:
<NONE>

extern void to_lpm() is called from 1 sites in this file.
It appears to be inlineable (size = 4 units)
It has 3 non-trivial scope blocks nested 3 deep.
It calls these functions:
<NONE>

extern void wakeup_event() is called from 1 sites in this file.
It appears to be inlineable (size = 241 units)
It has 3 non-trivial scope blocks nested 3 deep.
It calls these functions:
clear_display() (1 times)
? () (6 times)

What are the ISR routines (interrupt service request handler)?

./ez430_chronos/driver/radio.c:
__interrupt void radio_ISR(void)

./ez430_chronos/driver/timer.c:
__interrupt void TIMER0_A0_ISR(void)
__interrupt void TIMER0_A1_5_ISR(void)

./ez430_chronos/driver/adc12.c:
__interrupt void ADC12ISR (void)

./ez430_chronos/driver/ports.c:
__interrupt void PORT2_ISR(void)

./ez430_chronos_datalogger/driver/radio.c:
__interrupt void radio_ISR(void)

./ez430_chronos_datalogger/driver/timer.c:
__interrupt void TIMER0_A0_ISR(void)
__interrupt void TIMER0_A1_5_ISR(void)

./ez430_chronos_datalogger/driver/adc12.c:
__interrupt void ADC12ISR (void)

./ez430_chronos_datalogger/driver/ports.c:
__interrupt void PORT2_ISR(void)

Listed below is the snapshot of ./ez430_chronos/main.c:

int main(void)
{
// Init MCU
init_application();

// Assign initial value to global variables
init_global_variables();

// Branch to welcome screen
test_mode();

// Main control loop: wait in low power mode until some event needs to be processed
while(1)
{
// When idle go to LPM3
idle_loop();

// Process wake-up events
if (button.all_flags || sys.all_flags) wakeup_event();

// Process actions requested by logic modules
if (request.all_flags) process_requests();

// Before going to LPM3, update display
if (display.all_flags) display_update();
}
}

The DMA declaration for the buttons (driver/ports.h):

// Port, pins and interrupt resources for buttons
#define BUTTONS_IN (P2IN)
#define BUTTONS_OUT (P2OUT)
#define BUTTONS_DIR (P2DIR)
#define BUTTONS_REN (P2REN)
#define BUTTONS_IE (P2IE)
#define BUTTONS_IES (P2IES)
#define BUTTONS_IFG (P2IFG)
#define BUTTONS_IRQ_VECT2 (PORT2_VECTOR)

And the P2IN value above are documented here (page 31):

http://focus.ti.com/lit/ds/symlink/cc430f5133.pdf

Port P1 input P1IN 00h
Port P1 output P1OUT 02h
Port P1 direction P1DIR 04h
Port P1 pullup/pulldown enable P1REN 06h
Port P1 drive strength P1DS 08h
Port P1 selection P1SEL 0Ah
Port P1 interrupt vector word P1IV 0Eh
Port P1 interrupt edge select P1IES 18h
Port P1 interrupt enable P1IE 1Ah
Port P1 interrupt flag P1IFG 1Ch
Port P2 input P2IN 01h
Port P2 output P2OUT 03h
Port P2 direction P2DIR 05h
Port P2 pullup/pulldown enable P2REN 07h
Port P2 drive strength P2DS 09h
Port P2 selection P2SEL 0Bh
Port P2 interrupt vector word P2IV 1Eh
Port P2 interrupt edge select P2IES 19h
Port P2 interrupt enable P2IE 1Bh
Port P2 interrupt flag P2IFG 1Dh

The following are the functions for display (display.h):

// Physical LCD memory write
extern void write_lcd_mem(u8 * lcdmem, u8 bits, u8 bitmask, u8 state);

// Display init / clear
extern void lcd_init(void);
extern void clear_display(void);
extern void clear_display_all(void);
extern void clear_line(u8 line);

// Blinking function
extern void start_blink(void);
extern void stop_blink(void);
extern void clear_blink_mem(void);
extern void set_blink_rate(u8 bits);

// Character / symbol draw functions
extern void display_char(u8 segment, u8 chr, u8 mode);
extern void display_chars(u8 segments, u8 * str, u8 mode);
extern void display_symbol(u8 symbol, u8 mode);

// Time display function
extern void DisplayTime(u8 updateMode);
extern void display_am_pm_symbol(u8 timeAM);

// Set_value display functions
extern void display_value1(u8 segments, u32 value, u8 digits, u8 blanks);
extern void display_hours1(u8 segments, u32 value, u8 digits, u8 blanks);

// Integer to string conversion
extern u8 * itoa(u32 n, u8 digits, u8 blanks);

// Segment index helper function
extern u8 switch_seg(u8 line, u8 index1, u8 index2);

Generally, it would be interesting to know:

a. How are the radio access point implemented? If there are multiple recipient how can they be distinguished from another? How to pair with the RF transceiver? How secure is the communication, or rather, how easy it is to perform man-in-the-middle attacks? How to access all the other sensors via the RF access point?

b. How to access the pressure sensor?

c. How to access the three-axis accelerometer?

d. How to access the temperature sensor?

e. How to access the battery voltage sensor?

f. It would be interesting to understand how the watch is able to trigger a USB CDC communication on the linux host, so that /dev/ttyACM0 from the linux host can be used to access the embedded device – performing debugging, putting it into single-stepping mode, accessing sensors etc?

Advertisements

How to get stack traces of running processes in Android?

Inside the “adb shell” environment as setup by Android SDK, issuing “kill -3 <pid>” where <pid> is the process PID as derived from “ps” command will generate a trace n /data/tnr/traces.txt (look at the comments given in the last line of “logcat” output, after “kill -3” command is issued.

----- pid 180 at 2011-01-10 09:11:30 -----

Cmd line: com.android.mms

DALVIK THREADS:
"main" prio=5 tid=3 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x4001b268 self=0xbd00
| sysTid=180 nice=0 sched=0/0 cgrp=default handle=-1344001384
at java.lang.Object.wait(Native Method)
- waiting on <0x118668> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:326)
at android.os.MessageQueue.next(MessageQueue.java:144)
at android.os.Looper.loop(Looper.java:110)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"pool-1-thread-1" prio=5 tid=17 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c30a68 self=0x2cc5f8
| sysTid=226 nice=0 sched=0/0 cgrp=default handle=3241776
at java.lang.Object.wait(Native Method)
- waiting on <0x31a4b0> (a java.lang.VMThread)
at java.lang.Thread.parkFor(Thread.java:1535)
at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
at sun.misc.Unsafe.park(Unsafe.java:317)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:131)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:936)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:664)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1001)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
at java.lang.Thread.run(Thread.java:1096)

"Binder Thread #3" prio=5 tid=19 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43be6940 self=0x136b78
| sysTid=222 nice=0 sched=0/0 cgrp=default handle=3114880
at dalvik.system.NativeStart.run(Native Method)

"AsyncQueryWorker" prio=5 tid=15 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bb4810 self=0x1314d8
| sysTid=218 nice=0 sched=0/0 cgrp=default handle=1250216
at java.lang.Object.wait(Native Method)
- waiting on <0x11bb00> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b7fea8 self=0x14dae8
| sysTid=188 nice=0 sched=0/0 cgrp=default handle=1260840
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b7fde8 self=0x133d90
| sysTid=187 nice=0 sched=0/0 cgrp=default handle=1260280
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43b7e2a0 self=0x138d18
| sysTid=186 nice=0 sched=0/0 cgrp=default handle=1243872
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43b7e1e8 self=0x133b60
| sysTid=182 nice=0 sched=0/0 cgrp=default handle=1212640
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e22b08 self=0x133930
| sysTid=181 nice=0 sched=0/0 cgrp=default handle=1213368
at dalvik.system.NativeStart.run(Native Method)

----- end 180 -----

----- pid 52 at 2011-01-10 09:11:30 -----
Cmd line: system_server

DALVIK THREADS:
"main" prio=5 tid=3 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x4001b268 self=0xbd00
| sysTid=52 nice=0 sched=0/0 cgrp=default handle=-1344001384
at com.android.server.SystemServer.init1(Native Method)
at com.android.server.SystemServer.main(SystemServer.java:497)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"SearchDialog" prio=5 tid=77 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c84868 self=0x4ccad0
| sysTid=185 nice=0 sched=0/0 cgrp=default handle=1363992
at java.lang.Object.wait(Native Method)
- waiting on <0x4e1548> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Binder Thread #6" prio=5 tid=75 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43d52508 self=0x49cf88
| sysTid=167 nice=0 sched=0/0 cgrp=default handle=4832136
at dalvik.system.NativeStart.run(Native Method)

"android.hardware.SensorManager$SensorThread" prio=5 tid=73 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43d03538 self=0x483d88
| sysTid=157 nice=-4 sched=0/0 cgrp=default handle=4743336
at android.hardware.SensorManager.sensors_data_poll(Native Method)
at android.hardware.SensorManager$SensorThread$SensorThreadRunnable.run(SensorManager.java:375)
at java.lang.Thread.run(Thread.java:1096)

"com.android.server.MountListener" prio=5 tid=71 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43cffa00 self=0x4800c8
| sysTid=156 nice=0 sched=0/0 cgrp=default handle=4719072
at android.net.LocalSocketImpl.readba_native(Native Method)
at android.net.LocalSocketImpl.access$400(LocalSocketImpl.java:29)
at android.net.LocalSocketImpl$SocketInputStream.read(LocalSocketImpl.java:92)
at android.net.LocalSocketImpl$SocketInputStream.read(LocalSocketImpl.java:78)
at com.android.server.MountListener.listenToSocket(MountListener.java:208)
at com.android.server.MountListener.run(MountListener.java:274)
at java.lang.Thread.run(Thread.java:1096)

"Binder Thread #5" prio=5 tid=69 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43cb8048 self=0x3e66f0
| sysTid=129 nice=0 sched=0/0 cgrp=default handle=3915688
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #4" prio=5 tid=67 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43cbebd0 self=0x3bbe20
| sysTid=128 nice=0 sched=0/0 cgrp=default handle=3924616
at dalvik.system.NativeStart.run(Native Method)

"Wallpaper" prio=5 tid=65 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bcbd08 self=0x2c6af8
| sysTid=121 nice=-2 sched=0/0 cgrp=default handle=3860184
at java.lang.Object.wait(Native Method)
- waiting on <0x3b8650> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Binder Thread #3" prio=5 tid=63 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43c64ba0 self=0x2f78a8
| sysTid=117 nice=0 sched=0/0 cgrp=default handle=3217504
at dalvik.system.NativeStart.run(Native Method)

"watchdog" prio=5 tid=61 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43b897d0 self=0x313810
| sysTid=91 nice=0 sched=0/0 cgrp=default handle=1177312
at java.lang.Object.wait(Native Method)
- waiting on <0x2eb518> (a com.android.server.Watchdog)
at java.lang.Object.wait(Object.java:326)
at com.android.server.Watchdog.run(Watchdog.java:819)

"GpsNetworkThread" prio=5 tid=59 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43cb4f60 self=0x311a60
| sysTid=89 nice=0 sched=0/0 cgrp=default handle=3218296
at java.lang.Object.wait(Native Method)
- waiting on <0x304798> (a com.android.internal.location.GpsLocationProvider$GpsNetworkThread)
at java.lang.Object.wait(Object.java:326)
at com.android.internal.location.GpsLocationProvider$GpsNetworkThread.runLocked(GpsLocationProvider.java:1236)
at com.android.internal.location.GpsLocationProvider$GpsNetworkThread.run(GpsLocationProvider.java:1206)

"GpsEventThread" prio=5 tid=57 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43ca72b0 self=0x30b568
| sysTid=86 nice=0 sched=0/0 cgrp=default handle=3207296
at com.android.internal.location.GpsLocationProvider.native_wait_for_event(Native Method)
at com.android.internal.location.GpsLocationProvider.access$400(GpsLocationProvider.java:69)
at com.android.internal.location.GpsLocationProvider$GpsEventThread.run(GpsLocationProvider.java:1185)

"android:unnamed_thread" prio=5 tid=55 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43caa4e0 self=0x30f9a8
| sysTid=88 nice=0 sched=0/0 cgrp=default handle=829592
at dalvik.system.NativeStart.run(Native Method)

"android:unnamed_thread" prio=5 tid=53 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43caa418 self=0x30b0d8
| sysTid=87 nice=0 sched=0/0 cgrp=default handle=3185568
at dalvik.system.NativeStart.run(Native Method)

"AudioService" prio=5 tid=51 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43ca0240 self=0x30e1c0
| sysTid=84 nice=0 sched=0/0 cgrp=default handle=3201040
at java.lang.Object.wait(Native Method)
- waiting on <0x30efb8> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.media.AudioService$AudioSystemThread.run(AudioService.java:1158)

"LocationManagerService" prio=5 tid=49 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c3da90 self=0x3081b0
| sysTid=83 nice=10 sched=0/0 cgrp=bg_non_interactive handle=3182328
at java.lang.Object.wait(Native Method)
- waiting on <0x2ea7a0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at com.android.server.LocationManagerService.run(LocationManagerService.java:504)
at java.lang.Thread.run(Thread.java:1096)

"WifiWatchdogThread" prio=5 tid=47 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c64af8 self=0x3068b0
| sysTid=82 nice=0 sched=0/0 cgrp=default handle=3172808
at java.lang.Object.wait(Native Method)
- waiting on <0x3087d8> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at com.android.server.WifiWatchdogService$WifiWatchdogThread.run(WifiWatchdogService.java:966)

"WifiService" prio=5 tid=45 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c0c258 self=0x306198
| sysTid=81 nice=0 sched=0/0 cgrp=default handle=3170992
at java.lang.Object.wait(Native Method)
- waiting on <0x306678> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"ConnectivityThread" prio=5 tid=43 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bf00a0 self=0x2f5aa0
| sysTid=80 nice=0 sched=0/0 cgrp=default handle=3038432
at java.lang.Object.wait(Native Method)
- waiting on <0x307d68> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at com.android.server.ConnectivityService$ConnectivityThread.run(ConnectivityService.java:177)

"InputDispatcher" prio=5 tid=41 NATIVE
| group="main" sCount=1 dsCount=0 s=Y obj=0x43c70878 self=0x2e2640
| sysTid=79 nice=-8 sched=0/0 cgrp=default handle=3026376
at android.os.Process.sendSignal(Native Method)
at com.android.server.am.ActivityManagerService.appNotRespondingLocked(ActivityManagerService.java:4692)
at com.android.server.am.HistoryRecord.keyDispatchingTimedOut(HistoryRecord.java:473)
at com.android.server.WindowManagerService$KeyWaiter.waitForNextEventTarget(WindowManagerService.java:5677)
at com.android.server.WindowManagerService.dispatchKey(WindowManagerService.java:5219)
at com.android.server.WindowManagerService.access$1100(WindowManagerService.java:130)
at com.android.server.WindowManagerService$InputDispatcherThread.process(WindowManagerService.java:6457)
at com.android.server.WindowManagerService$InputDispatcherThread.run(WindowManagerService.java:6342)

"WindowManagerPolicy" prio=5 tid=39 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c5d638 self=0x2df820
| sysTid=78 nice=-2 sched=0/0 cgrp=default handle=3012920
at java.lang.Object.wait(Native Method)
- waiting on <0x2e1088> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at com.android.server.WindowManagerService$PolicyThread.run(WindowManagerService.java:565)

"InputDeviceReader" prio=5 tid=37 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43c371e0 self=0x2deb08
| sysTid=77 nice=-8 sched=0/0 cgrp=default handle=1273248
at com.android.server.KeyInputQueue.readEvent(Native Method)
at com.android.server.KeyInputQueue.access$000(KeyInputQueue.java:48)
at com.android.server.KeyInputQueue$1.run(KeyInputQueue.java:504)

"WindowManager" prio=5 tid=35 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c42de0 self=0x2da690
| sysTid=76 nice=-4 sched=0/0 cgrp=default handle=2992040
at java.lang.Object.wait(Native Method)
- waiting on <0x2e10b0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at com.android.server.WindowManagerService$WMThread.run(WindowManagerService.java:531)

"AlarmManager" prio=5 tid=33 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43c43558 self=0x2da840
| sysTid=75 nice=0 sched=0/0 cgrp=default handle=2996536
at com.android.server.AlarmManagerService.waitForAlarm(Native Method)
at com.android.server.AlarmManagerService.access$100(AlarmManagerService.java:53)
at com.android.server.AlarmManagerService$AlarmThread.run(AlarmManagerService.java:605)

"PowerManagerService" prio=5 tid=31 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c04250 self=0x2d1c60
| sysTid=74 nice=0 sched=0/0 cgrp=default handle=2956664
at java.lang.Object.wait(Native Method)
- waiting on <0x48c1e0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:326)
at android.os.MessageQueue.next(MessageQueue.java:144)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"UEventObserver" prio=5 tid=29 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43c335f8 self=0x2d1108
| sysTid=73 nice=0 sched=0/0 cgrp=default handle=2953760
at android.os.UEventObserver.next_event(Native Method)
at android.os.UEventObserver.access$100(UEventObserver.java:39)
at android.os.UEventObserver$UEventThread.run(UEventObserver.java:102)

"SyncHandlerThread" prio=5 tid=27 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c4ea28 self=0x2c74f8
| sysTid=70 nice=10 sched=0/0 cgrp=bg_non_interactive handle=1155448
at java.lang.Object.wait(Native Method)
- waiting on <0x2c7610> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"AccountManagerService" prio=5 tid=25 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43c7ff10 self=0x11f460
| sysTid=69 nice=0 sched=0/0 cgrp=default handle=1273848
at java.lang.Object.wait(Native Method)
- waiting on <0x11ec10> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"FileObserver" prio=5 tid=23 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43bc5cf8 self=0x1382b8
| sysTid=68 nice=0 sched=0/0 cgrp=default handle=1215472
at android.os.FileObserver$ObserverThread.observe(Native Method)
at android.os.FileObserver$ObserverThread.run(FileObserver.java:69)

"PackageManager" prio=5 tid=21 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bae448 self=0x1269b8
| sysTid=67 nice=10 sched=0/0 cgrp=bg_non_interactive handle=1273184
at java.lang.Object.wait(Native Method)
- waiting on <0x148d88> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"ProcessStats" prio=5 tid=19 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43baa600 self=0x11fd80
| sysTid=66 nice=0 sched=0/0 cgrp=default handle=1177664
at java.lang.Object.wait(Native Method)
- waiting on <0x11ff80> (a com.android.server.am.ActivityManagerService$3)
at java.lang.Object.wait(Object.java:326)
at com.android.server.am.ActivityManagerService$3.run(ActivityManagerService.java:1519)

"ActivityManager" prio=5 tid=17 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43b8b8d0 self=0x1239b8
| sysTid=63 nice=-2 sched=0/0 cgrp=default handle=1220992
at java.lang.Object.wait(Native Method)
- waiting on <0x148dd0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1331)

"android.server.ServerThread" prio=5 tid=15 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43b817e0 self=0x133de0
| sysTid=61 nice=-2 sched=0/0 cgrp=default handle=1261304
at java.lang.Object.wait(Native Method)
- waiting on <0x3c3eb0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:326)
at android.os.MessageQueue.next(MessageQueue.java:144)
at android.os.Looper.loop(Looper.java:110)
at com.android.server.ServerThread.run(SystemServer.java:428)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b7fd18 self=0x11c4c0
| sysTid=57 nice=0 sched=0/0 cgrp=default handle=1263080
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b7f478 self=0x1344a8
| sysTid=56 nice=0 sched=0/0 cgrp=default handle=1277264
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43b7e2a0 self=0x134698
| sysTid=55 nice=0 sched=0/0 cgrp=default handle=1261568
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43b7e1e8 self=0x1270c0
| sysTid=54 nice=0 sched=0/0 cgrp=default handle=1205136
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e1e1e8 self=0x112cb8
| sysTid=53 nice=0 sched=0/0 cgrp=default handle=1205072
at dalvik.system.NativeStart.run(Native Method)

----- end 52 -----

----- pid 197 at 2011-01-10 09:11:30 -----
Cmd line: com.android.settings

DALVIK THREADS:
"main" prio=5 tid=3 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x4001b268 self=0xbd00
| sysTid=197 nice=0 sched=0/0 cgrp=bg_non_interactive handle=-1344001384
at java.lang.Object.wait(Native Method)
- waiting on <0x2ec750> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b820f8 self=0x148e18
| sysTid=202 nice=0 sched=0/0 cgrp=default handle=1243864
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b82038 self=0x14dae8
| sysTid=201 nice=0 sched=0/0 cgrp=default handle=1332984
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43b7e2a0 self=0x144030
| sysTid=200 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1261408
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43b7e1e8 self=0x133d90
| sysTid=199 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1260824
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e23018 self=0x138d18
| sysTid=198 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1260760
at dalvik.system.NativeStart.run(Native Method)

----- end 197 -----

----- pid 211 at 2011-01-10 09:11:30 -----
Cmd line: com.svox.pico

DALVIK THREADS:
"main" prio=5 tid=3 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x4001b268 self=0xbd00
| sysTid=211 nice=0 sched=0/0 cgrp=bg_non_interactive handle=-1344001384
at java.lang.Object.wait(Native Method)
- waiting on <0x128188> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43d06030 self=0x14dae8
| sysTid=216 nice=0 sched=0/0 cgrp=default handle=1332472
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43d04b78 self=0x1453e0
| sysTid=215 nice=0 sched=0/0 cgrp=default handle=1263536
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43d032a0 self=0x134698
| sysTid=214 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1326304
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43d031e8 self=0x133c28
| sysTid=213 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1260520
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e20c18 self=0x1270c0
| sysTid=212 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1215472
at dalvik.system.NativeStart.run(Native Method)

----- end 211 -----

----- pid 161 at 2011-01-10 09:11:31 -----
Cmd line: android.process.media

DALVIK THREADS:
"main" prio=5 tid=3 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x4001b268 self=0xbd00
| sysTid=161 nice=0 sched=0/0 cgrp=bg_non_interactive handle=-1344001384
at java.lang.Object.wait(Native Method)
- waiting on <0x2c3de0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"thumbs thread" prio=5 tid=15 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43b99410 self=0x12cc18
| sysTid=168 nice=10 sched=0/0 cgrp=bg_non_interactive handle=1232176
at java.lang.Object.wait(Native Method)
- waiting on <0x897c8> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at com.android.providers.media.MediaProvider$Worker.run(MediaProvider.java:2101)
at java.lang.Thread.run(Thread.java:1096)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b80b90 self=0x133dd0
| sysTid=166 nice=0 sched=0/0 cgrp=default handle=1260944
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b7f5c8 self=0x133b60
| sysTid=165 nice=0 sched=0/0 cgrp=default handle=1260056
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43b7e2a0 self=0x128300
| sysTid=164 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1213120
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43b7e1e8 self=0x128090
| sysTid=163 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1243688
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e22620 self=0x137090
| sysTid=162 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1273936
at dalvik.system.NativeStart.run(Native Method)

----- end 161 -----

----- pid 203 at 2011-01-10 09:11:31 -----
Cmd line: com.example.android.softkeyboard

DALVIK THREADS:
"main" prio=5 tid=3 VMWAIT
| group="main" sCount=2 dsCount=1 s=Y obj=0x4001b268 self=0xbd00
| sysTid=203 nice=0 sched=0/0 cgrp=default handle=-1344001384
at com.example.android.softkeyboard.SoftKeyboard.onKeyDown(SoftKeyboard.java:~-1)
at android.view.KeyEvent.dispatch(KeyEvent.java:1037)
at android.inputmethodservice.AbstractInputMethodService$AbstractInputMethodSessionImpl.dispatchKeyEvent(AbstractInputMethodService.java:135)
at android.inputmethodservice.IInputMethodSessionWrapper.executeMessage(IInputMethodSessionWrapper.java:76)
at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:45)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b84b70 self=0x14e9b8
| sysTid=208 nice=0 sched=0/0 cgrp=default handle=1370464
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b80d28 self=0x148e18
| sysTid=207 nice=0 sched=0/0 cgrp=default handle=1344104
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43b7e2a0 self=0x14db28
| sysTid=206 nice=0 sched=0/0 cgrp=default handle=1366760
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43b7e1e8 self=0x145610
| sysTid=205 nice=0 sched=0/0 cgrp=default handle=1243688
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e23508 self=0x144070
| sysTid=204 nice=0 sched=0/0 cgrp=default handle=1327152
at dalvik.system.NativeStart.run(Native Method)

----- end 203 -----

----- pid 101 at 2011-01-10 09:11:31 -----
Cmd line: android.process.acore

DALVIK THREADS:
"main" prio=5 tid=3 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x4001b268 self=0xbd00
| sysTid=101 nice=0 sched=0/0 cgrp=default handle=-1344001384
at java.lang.Object.wait(Native Method)
- waiting on <0x39a870> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #6" prio=5 tid=25 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43c2e7d0 self=0x389058
| sysTid=225 nice=0 sched=0/0 cgrp=default handle=3575760
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #5" prio=5 tid=23 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43be6b00 self=0x394f68
| sysTid=171 nice=0 sched=0/0 cgrp=default handle=3756528
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #4" prio=5 tid=21 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43ba4dd0 self=0x382c88
| sysTid=170 nice=0 sched=0/0 cgrp=default handle=3679584
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #3" prio=5 tid=19 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43ba4cf0 self=0x37aec0
| sysTid=169 nice=0 sched=0/0 cgrp=default handle=1154984
at dalvik.system.NativeStart.run(Native Method)

"ContactAggregator" prio=5 tid=17 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bdd8f0 self=0x34d780
| sysTid=140 nice=10 sched=0/0 cgrp=bg_non_interactive handle=3434424
at java.lang.Object.wait(Native Method)
- waiting on <0x35d318> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"ApplicationsProviderUpdater" prio=5 tid=15 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bbe3f8 self=0x331b48
| sysTid=134 nice=10 sched=0/0 cgrp=bg_non_interactive handle=3316232
at java.lang.Object.wait(Native Method)
- waiting on <0x329890> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b82080 self=0x1282c0
| sysTid=114 nice=0 sched=0/0 cgrp=default handle=1141712
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b7ff10 self=0x116a30
| sysTid=113 nice=0 sched=0/0 cgrp=default handle=1216120
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43b7e2a0 self=0x128ca0
| sysTid=107 nice=0 sched=0/0 cgrp=default handle=1196000
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43b7e1e8 self=0x116c60
| sysTid=103 nice=0 sched=0/0 cgrp=default handle=1164552
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e218c0 self=0x123e18
| sysTid=102 nice=0 sched=0/0 cgrp=default handle=1173640
at dalvik.system.NativeStart.run(Native Method)

----- end 101 -----

----- pid 98 at 2011-01-10 09:11:31 -----
Cmd line: com.android.phone

DALVIK THREADS:
"main" prio=5 tid=3 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x4001b268 self=0xbd00
| sysTid=98 nice=0 sched=0/0 cgrp=default handle=-1344001384
at java.lang.Object.wait(Native Method)
- waiting on <0x145170> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:326)
at android.os.MessageQueue.next(MessageQueue.java:144)
at android.os.Looper.loop(Looper.java:110)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #4" prio=5 tid=29 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43bf7d70 self=0x138150
| sysTid=196 nice=0 sched=0/0 cgrp=default handle=1160936
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #3" prio=5 tid=27 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43bf7c48 self=0x2d11e8
| sysTid=195 nice=0 sched=0/0 cgrp=default handle=1220928
at dalvik.system.NativeStart.run(Native Method)

"AsyncQueryWorker" prio=5 tid=25 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bddd68 self=0x2dfb78
| sysTid=138 nice=0 sched=0/0 cgrp=default handle=3013776
at java.lang.Object.wait(Native Method)
- waiting on <0x12a1b0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Stk Icon Loader" prio=5 tid=23 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bdb558 self=0x2de610
| sysTid=137 nice=0 sched=0/0 cgrp=default handle=3008296
at java.lang.Object.wait(Native Method)
- waiting on <0x2df458> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"RilMessageDecoder" prio=5 tid=21 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bdad88 self=0x2dd730
| sysTid=136 nice=0 sched=0/0 cgrp=default handle=3004488
at java.lang.Object.wait(Native Method)
- waiting on <0x2dea18> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Stk Telephony service" prio=5 tid=19 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bda9c0 self=0x2dccd8
| sysTid=135 nice=0 sched=0/0 cgrp=default handle=3001840
at java.lang.Object.wait(Native Method)
- waiting on <0x2ddb60> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"RILReceiver" prio=5 tid=17 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43bc8888 self=0x137280
| sysTid=133 nice=0 sched=0/0 cgrp=default handle=1274776
at android.net.LocalSocketImpl.readba_native(Native Method)
at android.net.LocalSocketImpl.access$400(LocalSocketImpl.java:29)
at android.net.LocalSocketImpl$SocketInputStream.read(LocalSocketImpl.java:92)
at com.android.internal.telephony.RIL.readRilMessage(RIL.java:418)
at com.android.internal.telephony.RIL.access$200(RIL.java:206)
at com.android.internal.telephony.RIL$RILReceiver.run(RIL.java:517)
at java.lang.Thread.run(Thread.java:1096)

"RILSender" prio=5 tid=15 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bc6460 self=0x135418
| sysTid=132 nice=0 sched=0/0 cgrp=default handle=1362872
at java.lang.Object.wait(Native Method)
- waiting on <0x137688> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b835b8 self=0x116a70
| sysTid=116 nice=0 sched=0/0 cgrp=default handle=1141296
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b7fe40 self=0x116c60
| sysTid=115 nice=0 sched=0/0 cgrp=default handle=1195824
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43b7e2a0 self=0x123e18
| sysTid=111 nice=0 sched=0/0 cgrp=default handle=1173568
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43b7e1e8 self=0x11c4c0
| sysTid=104 nice=0 sched=0/0 cgrp=default handle=1263048
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e213d8 self=0x1453e0
| sysTid=99 nice=0 sched=0/0 cgrp=default handle=1262984
at dalvik.system.NativeStart.run(Native Method)

----- end 98 -----

----- pid 92 at 2011-01-10 09:11:31 -----
Cmd line: com.android.inputmethod.latin

DALVIK THREADS:
"main" prio=5 tid=3 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x4001b268 self=0xbd00
| sysTid=92 nice=0 sched=0/0 cgrp=bg_non_interactive handle=-1344001384
at java.lang.Object.wait(Native Method)
- waiting on <0x120c88> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"AsyncTask #1" prio=5 tid=15 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43ba4250 self=0x136f20
| sysTid=172 nice=10 sched=0/0 cgrp=bg_non_interactive handle=1284472
at java.lang.Object.wait(Native Method)
- waiting on <0x1b3360> (a java.lang.VMThread)
at java.lang.Thread.parkFor(Thread.java:1535)
at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
at sun.misc.Unsafe.park(Unsafe.java:317)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:131)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1996)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1001)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
at java.lang.Thread.run(Thread.java:1096)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b80308 self=0x116c60
| sysTid=109 nice=0 sched=0/0 cgrp=default handle=1277304
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b7f378 self=0x11e768
| sysTid=108 nice=0 sched=0/0 cgrp=default handle=1164808
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43b7e2a0 self=0x1453e0
| sysTid=105 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1263536
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43b7e1e8 self=0x134698
| sysTid=97 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1243864
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e20e88 self=0x1270c0
| sysTid=95 nice=0 sched=0/0 cgrp=bg_non_interactive handle=1261704
at dalvik.system.NativeStart.run(Native Method)

----- end 92 -----

----- pid 95 at 2011-01-11 19:09:05 -----
Cmd line: com.android.phone

DALVIK THREADS:
"main" prio=5 tid=3 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x4001b268 self=0xbd00
| sysTid=95 nice=0 sched=0/0 cgrp=default handle=-1344001384
at java.lang.Object.wait(Native Method)
- waiting on <0x2e4a30> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:326)
at android.os.MessageQueue.next(MessageQueue.java:144)
at android.os.Looper.loop(Looper.java:110)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #7" prio=5 tid=35 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43bf52e0 self=0x30c7c0
| sysTid=180 nice=0 sched=0/0 cgrp=default handle=3179304
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #6" prio=5 tid=33 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43bd5708 self=0x2eb010
| sysTid=179 nice=0 sched=0/0 cgrp=default handle=2979648
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #5" prio=5 tid=31 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43bd5648 self=0x2db478
| sysTid=178 nice=0 sched=0/0 cgrp=default handle=2979256
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #4" prio=5 tid=29 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b83178 self=0x2d68c8
| sysTid=177 nice=0 sched=0/0 cgrp=default handle=2975096
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #3" prio=5 tid=27 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43be6920 self=0x2d5890
| sysTid=176 nice=0 sched=0/0 cgrp=default handle=1285864
at dalvik.system.NativeStart.run(Native Method)

"AsyncQueryWorker" prio=5 tid=25 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bddd88 self=0x2dfb98
| sysTid=135 nice=0 sched=0/0 cgrp=default handle=3013808
at java.lang.Object.wait(Native Method)
- waiting on <0x139dc8> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Stk Icon Loader" prio=5 tid=23 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bdb578 self=0x2de638
| sysTid=134 nice=0 sched=0/0 cgrp=default handle=3008336
at java.lang.Object.wait(Native Method)
- waiting on <0x2df7a0> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"RilMessageDecoder" prio=5 tid=21 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bdada8 self=0x2dd758
| sysTid=133 nice=0 sched=0/0 cgrp=default handle=3004528
at java.lang.Object.wait(Native Method)
- waiting on <0x2dea40> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Stk Telephony service" prio=5 tid=19 WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bda9e0 self=0x2dcd00
| sysTid=132 nice=0 sched=0/0 cgrp=default handle=3001880
at java.lang.Object.wait(Native Method)
- waiting on <0x2ddb88> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:288)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"RILReceiver" prio=5 tid=17 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43bc88a8 self=0x137558
| sysTid=130 nice=0 sched=0/0 cgrp=default handle=1275504
at android.net.LocalSocketImpl.readba_native(Native Method)
at android.net.LocalSocketImpl.access$400(LocalSocketImpl.java:29)
at android.net.LocalSocketImpl$SocketInputStream.read(LocalSocketImpl.java:92)
at com.android.internal.telephony.RIL.readRilMessage(RIL.java:418)
at com.android.internal.telephony.RIL.access$200(RIL.java:206)
at com.android.internal.telephony.RIL$RILReceiver.run(RIL.java:517)
at java.lang.Thread.run(Thread.java:1096)

"RILSender" prio=5 tid=15 TIMED_WAIT
| group="main" sCount=1 dsCount=0 s=N obj=0x43bc6480 self=0x135418
| sysTid=129 nice=0 sched=0/0 cgrp=default handle=1362872
at java.lang.Object.wait(Native Method)
- waiting on <0x137530> (a android.os.MessageQueue)
at java.lang.Object.wait(Object.java:326)
at android.os.MessageQueue.next(MessageQueue.java:144)
at android.os.Looper.loop(Looper.java:110)
at android.os.HandlerThread.run(HandlerThread.java:60)

"Binder Thread #2" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b80308 self=0x134a78
| sysTid=114 nice=0 sched=0/0 cgrp=default handle=1264184
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43b7f378 self=0x144260
| sysTid=110 nice=0 sched=0/0 cgrp=default handle=1259536
at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x43b7e2a0 self=0x148c28
| sysTid=106 nice=0 sched=0/0 cgrp=default handle=1346536
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
| group="system" sCount=0 dsCount=0 s=N obj=0x43b7e1e8 self=0x138d18
| sysTid=99 nice=0 sched=0/0 cgrp=default handle=1243744
at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 s=N obj=0x42e213e0 self=0x133970
| sysTid=96 nice=0 sched=0/0 cgrp=default handle=1259824
at dalvik.system.NativeStart.run(Native Method)

----- end 95 -----

To be noted:

a.   Since the Java class symbols is printed, the codes that generated these stack traces will be easier to be implemented as a Java class itself.

b.   The command “kill -3” somehow must be triggering the Dalvik exception handling codes, to print out these stack trace.

c.   So if you “kill -3” a non-Java applications, for example, /system/bin/debuggerd process, then no output will go into this /data/tnr/traces.txt.   For example, the following processes will have stack traces dumped:

app_24    92    30    104100 14660 ffffffff afe0da04 S com.example.android.softkeyboard
radio     95    30    117944 17020 ffffffff afe0da04 S com.android.phone
app_7     97    30    122540 20088 ffffffff afe0da04 S android.process.acore
app_17    137   30    103952 15184 ffffffff afe0da04 S com.android.alarmclock
app_3     147   30    103656 15648 ffffffff afe0da04 S android.process.media

 

How Android OS process the SoftKeyboard?

How to capture the stacktrace of Android OS specifically for the SoftKeyboard implementation?

First create an application based on the SoftKeyboard sample, and then “Run” it – it will start the AVD emulator if necessary, and install itself as an apk into the started AVD emulator. The output in the console (Windows->ShowView->Console) view is shown below:

[2011-01-10 08:47:40 – my2.1proj_softkey] New emulator found: emulator-5554
[2011-01-10 08:47:40 – my2.1proj_softkey] Waiting for HOME (‘android.process.acore’) to be launched…
[2011-01-10 08:48:12 – my2.1proj_softkey] WARNING: Application does not specify an API level requirement!
[2011-01-10 08:48:12 – my2.1proj_softkey] Device API version is 7 (Android 2.1-update1)
[2011-01-10 08:48:12 – my2.1proj_softkey] HOME is up on device ’emulator-5554′
[2011-01-10 08:48:12 – my2.1proj_softkey] Uploading my2.1proj_softkey.apk onto device ’emulator-5554′
[2011-01-10 08:48:13 – my2.1proj_softkey] Installing my2.1proj_softkey.apk…
[2011-01-10 08:48:34 – my2.1proj_softkey] Success!
[2011-01-10 08:48:34 – my2.1proj_softkey] /my2.1proj_softkey/bin/my2.1proj_softkey.apk installed on device

The last line indicated that the application is now running. Use the keyboard setting and select that as the standard keyinput. Since the task is now running – identify the name under the “Devices” (Windows->ShowView->Devices) view. Then look out for the green “beetle” button, left click on the task, and then click the “green beetle” to enable the task for debugging. (Eclipse will indicate that only applications with source codes available are possible to be debugged).

Then open up the “Outline” view, where all the methods are shown (Windows->ShowView->Other and inside the “filter text” window, enter “Outline”), right click on the method to set breakpoint on and select “Toggle Method Breakpoint” to enable breakpointing on the method.

Next select “Run” on the application, and after compilation Eclipse will attempt to reinstall (click Windows->ShowView->Console):

[2011-01-10 09:10:55 – my2.1proj_softkey] Android Launch!
[2011-01-10 09:10:55 – my2.1proj_softkey] adb is running normally.
[2011-01-10 09:10:55 – my2.1proj_softkey] No Launcher activity found!
[2011-01-10 09:10:55 – my2.1proj_softkey] The launch will only sync the application package on the device!
[2011-01-10 09:10:55 – my2.1proj_softkey] Performing sync
[2011-01-10 09:10:55 – my2.1proj_softkey] Automatic Target Mode: using existing emulator ’emulator-5554′ running compatible AVD ‘my2.1avd’
[2011-01-10 09:10:55 – my2.1proj_softkey] WARNING: Application does not specify an API level requirement!
[2011-01-10 09:10:55 – my2.1proj_softkey] Device API version is 7 (Android 2.1-update1)
[2011-01-10 09:10:58 – my2.1proj_softkey] Application already deployed. No need to reinstall.
[2011-01-10 09:10:58 – my2.1proj_softkey] /my2.1proj_softkey/bin/my2.1proj_softkey.apk installed on device
[2011-01-10 09:10:58 – my2.1proj_softkey] Done!

Subsequent clicking on the softkeyboard will immediately trigger the following Using DDMS and Eclipse to capture the stacktrace in Android emulation the following stacktrace was generated (click Windows->ShowView->Debug):

DalvikVM[localhost:8615]
Thread [<3> main] (Suspended (entry into method onKeyDown in SoftKeyboard))
SoftKeyboard.onKeyDown(int, KeyEvent) line: 338
KeyEvent.dispatch(KeyEvent$Callback, KeyEvent$DispatcherState, Object) line: 1037
InputMethodService$InputMethodSessionImpl(AbstractInputMethodService$AbstractInputMethodSessionImpl).dispatchKeyEvent(int, KeyEvent, InputMethodSession$EventCallback) line: 135
IInputMethodSessionWrapper.executeMessage(Message) line: 76
HandlerCaller$MyHandler.handleMessage(Message) line: 45
HandlerCaller$MyHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4363
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object…) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native
method]
Thread [<13> Binder Thread #2] (Running)
Thread [<11> Binder Thread #1] (Running)

First, shown below is the SoftKeyboard class’s onKeyDown() method (from Android SDK sample for SoftKeyboard) implementation:

/**
* Use this to monitor key events being delivered to the application.
* We get first crack at them, and can either resume them or let them
* continue to the app.
*/
@Override public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
// The InputMethodService already takes care of the back
// key for us, to dismiss the input method if it is shown.
// However, our keyboard could be showing a pop-up window
// that back should dismiss, so we first allow it to do that.
if (event.getRepeatCount() == 0 && mInputView != null) {
if (mInputView.handleBack()) {
return true;
}
}
break;

case KeyEvent.KEYCODE_DEL:
// Special handling of the delete key: if we currently are
// composing text for the user, we want to modify that instead
// of let the application to the delete itself.
if (mComposing.length() > 0) {
onKey(Keyboard.KEYCODE_DELETE, null);
return true;
}
break;

case KeyEvent.KEYCODE_ENTER:
// Let the underlying text editor always handle these.
return false;

 

default:
// For all other keys, if we want to do transformations on
// text being entered with a hard keyboard, we need to process
// it and do the appropriate action.
if (PROCESS_HARD_KEYS) {
if (keyCode == KeyEvent.KEYCODE_SPACE
&& (event.getMetaState()&KeyEvent.META_ALT_ON) != 0) {
// A silly example: in our input method, Alt+Space
// is a shortcut for ‘android’ in lower case.
InputConnection ic = getCurrentInputConnection();
if (ic != null) {
// First, tell the editor that it is no longer in the
// shift state, since we are consuming this.
ic.clearMetaKeyStates(KeyEvent.META_ALT_ON);
keyDownUp(KeyEvent.KEYCODE_A);
keyDownUp(KeyEvent.KEYCODE_N);
keyDownUp(KeyEvent.KEYCODE_D);
keyDownUp(KeyEvent.KEYCODE_R);
keyDownUp(KeyEvent.KEYCODE_O);
keyDownUp(KeyEvent.KEYCODE_I);
keyDownUp(KeyEvent.KEYCODE_D);
// And we consume this event.
return true;
}
}

And looking up the code “frameworks/base/core/java/android/app/ActivityThread.java” line 4630 of 4639:

public static final void main(String[] args) {
SamplingProfilerIntegration.start();

Process.setArgV0(“<pre-initialized>”);

Looper.prepareMainLooper();

ActivityThread thread = new ActivityThread();
thread.attach(false);

Looper.loop();

if (Process.supportsProcesses()) {
throw new RuntimeException(“Main thread loop unexpectedly exited”);

 

From above, we can deduced that Looper.loop()’s being executed, thus leading to the stack trace as shown above.

Notice also that the line number for Looper.loop() is higher in the current source code (from recent’s “repo sync” update) as compared with the emulator which is using Android 2.1 Update version.

Unboxing my Freescale board: MPC5125

MPC5125 Product Summary Page:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC5125

Product video available here:

http://www.youtube.com/watch?v=rEJmgamfhLI

After connecting via USB to my Ubuntu, and then from the dmesg, found that /dev/ttyACM0 is to be used, so setting “minicom -s” to read from /dev/ttyACM0.

Looking at the command available:

=> help
?       – alias for ‘help’
askenv  – get environment variables from stdin
autoscr – run script from memory
base    – print or set address offset
bdinfo  – print Board Info structure
boot    – boot default, i.e., run ‘bootcmd’
bootd   – boot default, i.e., run ‘bootcmd’
bootm   – boot application image from memory
bootp   – boot image via network using BOOTP/TFTP protocol
checksum- checksum ddr_add data_count
clocks  – print clock configuration
cmp     – memory compare
coninfo – print console devices and information
cp      – memory copy
crc32   – checksum calculation
date    – get/set/reset date & time
dhcp    – boot image via network using DHCP/TFTP protocol
diufb   – Init or Display BMP file
echo    – echo args to console
eeprom  – EEPROM sub-system
erase   – erase FLASH memory
exit    – exit script
fdt     – flattened device tree utility commands
flinfo  – print FLASH memory information
go      – start application at address ‘addr’
help    – print online help
i2c     – I2C sub-system
icrc32  – checksum calculation
iloop   – infinite loop on address range
imd     – i2c memory display
iminfo  – print header information for application image
imm     – i2c memory modify (auto-incrementing)
imw     – memory write (fill)
imxtract- extract a part of a multi-image
inm     – memory modify (constant address)
iprobe  – probe to discover valid I2C chip addresses
itest   – return true/false on integer compare
loadb   – load binary file over serial line (kermit mode)
loads   – load S-Record file over serial line
loady   – load binary file over serial line (ymodem mode)
loop    – infinite loop on address range
md      – memory display
mii     – MII utility commands
mm      – memory modify (auto-incrementing)
mtest   – simple RAM test
mw      – memory write (fill)
nand    – NAND sub-system
nand_e  – erase nand block
nand_loader- Nand loader program
nand_r  – test NAND read
nand_w  – test NAND write
nboot   – boot from NAND device
nfs     – boot image via network using NFS protocol
nm      – memory modify (constant address)
ping    – send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect – enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reginfo – print register information
reset   – Perform RESET of the CPU
run     – run commands in an environment variable
saveenv – save environment variables to persistent storage
setenv  – set environment variables
showvar – print local hushshell variables
sleep   – delay execution for some time
test    – minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
ubi     – ubi commands
version – print monitor version
ydump   – YAFFS device struct
yls     – yaffs ls
ymkdir  – YAFFS mkdir
ymount  – mount yaffs
ymv     – YAFFS mv
yrd     – read file from yaffs
yrdm    – read file to memory from yaffs
yrm     – YAFFS rm
yrmdir  – YAFFS rmdir
yumount – unmount yaffs
ywr     – write file to yaffs
ywrm    – write file from memory to yaffs
=> bdinfo
memstart    = 0x00000000
memsize     = 0x00000000
flashstart  = 0x00000000
flashsize   = 0x00000000
flashoffset = 0x00000000
sramstart   = 0x00000000
sramsize    = 0x00000000
bootflags   = 0x00000001
intfreq     = 393.216 MHz
busfreq     = 196.608 MHz
ethaddr     = 00:22:78:00:4A:A1
eth1addr    = 00:00:00:00:00:00
IP addr     = 192.168.10.205
baudrate    = 115200 bps

And environment:

=> printenv
bootcmd=run nandboot
bootdelay=2
baudrate=115200
loads_echo=1
preboot=echo;echo Type \”run flash_nfs\” to mount root filesystem over NFS;echo
rootpath=/opt/eldk/pcc_6xx
hostname=ads5125
bootfile=ads5125/uImage
loadaddr=400000
ramdiskfile=ads5125/uRamdisk
fdtfile=ads5125/ads5125.dtb
u-boot=ads5125/u-boot.bin
netdev=eth0
ipaddr=192.168.10.205
consdev=tty0
serverip=192.168.10.74
fdtaddr=4000000
fdtfile=mpc5125-twr.dtb
kernel_name=vmlinux-twr-5125.bin
consoledev=ttyPSC0
flash_kernel=0x300
flash_dtb=0xb00
nandboot=setenv bootargs root=/dev/mtdblock6 rw rootfstype=yaffs2 console=$consr
fdt_name=mpc5125-twr.dtb
ramdisk_name=rootfs.ext2.gz.uboot-common
ramdisk_flash_addr=0xc00
kernel_loader_addr=0x2000000
fdt_loader_addr=0x2800000
ramdisk_loader_addr=0x3000000
nand_ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate;nanr
uboot_name=u-boot-second-usb.bin
uboot_name_first=u-boot-first-usb.bin
uboot_size=0x60000
uboot_update=tftp 0x1000000 u-boot-spl-2k.bin;nand_e 0x00 0x01;nand_loader 0x100
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
ramargs=setenv bootargs root=/dev/ram rw
addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netma1
addtty=setenv bootargs ${bootargs} console=${consdev},${baudrate}
mqx_name=extram_d.bin
mqx_size=0xa00000
mqx_addr=0x10000
mqx_flash_addr_s=0x80000
mqx_flash_addr_e=0x863ff
kernel_rootfs_update=tftp 0x3000000  $fdt_name;nand_e $flash_dtb 0xb01;nand_w 00
mqx_update=tftp $mqx_addr $mqx_name;nand_e $mqx_flash_addr_s $mqx_flash_addr_e;e
mqxboot=nand_r $mqx_addr $mqx_flash_addr_s $mqx_size;go $mqx_addr
ethact=FEC ETHERNET
ethaddr=00:22:78:00:4A.A1
stdin=serial
stdout=serial
stderr=serial

Environment size: 2451/131067 bytes

After enter “boot” to continue booting up, and doing a “dmesg” and showing some initial output:

http://pastebin.com/pypMSThq

Filesystems:

root@linux:/proc# cat filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   cgroup
nodev   debugfs
nodev   securityfs
nodev   sockfs
nodev   usbfs
nodev   pipefs
nodev   anon_inodefs
nodev   tmpfs
nodev   inotifyfs
nodev   devpts
ext3
ext2
ext4
ext4dev
nodev   ramfs
vfat
msdos
nodev   nfs
nodev   nfs4
ntfs
nodev   autofs
nodev   fuse
fuseblk
nodev   fusectl
yaffs
yaffs2
nodev   mqueue
nodev   rpc_pipefs

List of running processes:

ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  1 19:09 ?        00:00:12 /sbin/init
root         2     0  0 19:09 ?        00:00:00 [kthreadd]
root         3     2  0 19:09 ?        00:00:00 [ksoftirqd/0]
root         4     2  0 19:09 ?        00:00:00 [events/0]
root         5     2  0 19:09 ?        00:00:00 [khelper]
root         8     2  0 19:09 ?        00:00:00 [netns]
root       158     2  0 19:09 ?        00:00:00 [kintegrityd/0]
root       160     2  0 19:09 ?        00:00:00 [kblockd/0]
root       169     2  0 19:09 ?        00:00:00 [ksuspend_usbd]
root       175     2  0 19:09 ?        00:00:00 [khubd]
root       180     2  4 19:09 ?        00:00:37 [kmmcd]
root       204     2  0 19:09 ?        00:00:00 [pdflush]
root       205     2  0 19:09 ?        00:00:00 [pdflush]
root       206     2  0 19:09 ?        00:00:00 [kswapd0]
root       207     2  0 19:09 ?        00:00:00 [aio/0]
root       208     2  0 19:09 ?        00:00:00 [nfsiod]
root       836     2  0 19:09 ?        00:00:00 [mtdblockd]
root       888     2  0 19:09 ?        00:00:00 [hid_compat]
root       929     2  0 19:09 ?        00:00:00 [rpciod/0]
root      1030     1  0 19:12 ?        00:00:01 /sbin/udevd –daemon
root      2250     1  0 19:12 tty4     00:00:00 /sbin/getty 38400 tty4
root      2251     1  0 19:12 tty5     00:00:00 /sbin/getty 38400 tty5
root      2253     1  0 19:12 ttyPSC0  00:00:00 /bin/login —
root      2256     1  0 19:12 ttyPSC1  00:00:00 /sbin/getty 115200 ttyPSC1
root      2259     1  0 19:12 tty2     00:00:00 /sbin/getty 38400 tty2
root      2262     1  0 19:12 tty3     00:00:00 /sbin/getty 38400 tty3
root      2263     1  0 19:12 tty6     00:00:00 /sbin/getty 38400 tty6
syslog    2306     1  0 19:12 ?        00:00:00 /sbin/syslogd -u syslog
103       2324     1  0 19:12 ?        00:00:00 /bin/dbus-daemon –system
root      2345     1  0 19:12 ?        00:00:00 /usr/sbin/sshd
105       2364     1  0 19:12 ?        00:00:00 /usr/sbin/hald
root      2367     1  0 19:12 ?        00:00:00 /usr/sbin/console-kit-daemon
root      2430  2364  0 19:12 ?        00:00:00 hald-runner
root      2486     1  0 19:12 ?        00:00:00 /usr/sbin/gdm
root      2489  2486  0 19:12 ?        00:00:00 /usr/sbin/gdm
root      2496  2489 20 19:12 ?        00:02:34 /usr/bin/Xfbdev :0 -mouse mouse
root      2513     1  0 19:12 ?        00:00:00 /usr/sbin/NetworkManager –pid-f
root      2528     1  0 19:12 ?        00:00:00 /sbin/wpa_supplicant -u -f /var/
root      2532     1  0 19:12 ?        00:00:00 /usr/sbin/nm-system-settings –c
ntp       2552     1  0 19:12 ?        00:00:00 /usr/sbin/ntpd -p /var/run/ntpd.
root      2558  2552  0 19:12 ?        00:00:00 /usr/sbin/ntpd -p /var/run/ntpd.
root      2569     1  0 19:12 ?        00:00:00 /usr/bin/system-tools-backends
root      2624     1  0 19:12 tty1     00:00:00 /sbin/getty 38400 tty1
root      2644  2253  0 19:12 ttyPSC0  00:00:00 -bash
user      2684  2489  0 19:12 ?        00:00:00 /bin/sh /etc/xdg/xfce4/xinitrc –
user      2792  2684  0 19:12 ?        00:00:00 /usr/bin/ssh-agent /usr/bin/dbus
user      2796     1  0 19:12 ?        00:00:00 /usr/bin/dbus-launch –exit-with
user      2800     1  0 19:12 ?        00:00:00 //bin/dbus-daemon –fork –print
root      2812  2684 50 19:12 ?        00:06:21 /usr/bin/limeplayer -l /home/use
root      2878  2644  0 19:25 ttyPSC0  00:00:00 ps -ef

Operating System:

cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION=”Ubuntu 9.04″

Listing the packages (partially) “apt-cache pkgnames”:   http://pastebin.com/mtjFDdNj

Other info:

http://dev.emcelettronica.com/freescale-mpc5125-mcu-high-resolution-display-and-hmi

http://www.symmetrongroup.ru/suppliers/freescale/towersystem-mpc5125-manual.shtml

http://cache.freescale.com/files/microcontrollers/doc/ref_manual/MPC5125RM.pdf?fpsp=1

https://linuxlink.timesys.com/webshare/2/index.pt/timesys/factory/mpc5125-twr_small_footprint/1/output/

(the last link provide source codes customized for MPC5125).

%d bloggers like this: