user1418067
user1418067

Reputation: 312

Android kernel printk() and clock_gettime(CLOCK_BOOTTIME) time reversal of 60ms

I need to measure Android kernel and framework processing time for mouse HID event.

Problem: App side onTouchListner time is 60ms earlier than kernel hid_irq_in(). kernel IRQ should be 1-2ms before onTouchListener.

I am not sure why time is reverted. If I use not accurate way to get time, let me know.

Upvotes: 0

Views: 115

Answers (1)

user1418067
user1418067

Reputation: 312

"dmesg" add timestamp of printk() message. But that time is not synced with clock_gettime(CLOCK_BOOTTIME) in userland.

I need to call ktime_get_boottime() then printk() in kernel code. That time is synced with clock_gettime(CLOCK_BOOTTIME) in userland.

With this measurement, I found handling mouse left click event takes 3ms in kernel and framework.

Upvotes: 0

Related Questions