How to print out the current pid in kernel

1,434 views
Skip to first unread message

Footballer

unread,
Feb 22, 2011, 3:37:18 AM2/22/11
to Android Linux Kernel Development
Hi fork,

I'm now porting the Android to a processor core. Once the zygote is
up, the processor trigger an illegal exception. It means that there is
a wrong instruction is executed by the processor. I checked the
program pointer when the exception is triggered, it should be in user
space. I wouldn't like to find out that which process the wrong
instruction is in.

My question is how to print out the current pid in exception handler
in the kernel.

Thanks for your help

Kaleung

Robert Beckett

unread,
Feb 24, 2011, 7:10:08 AM2/24/11
to android...@googlegroups.com
int pid_n = pid_nr(task_pid(current));
Reply all
Reply to author
Forward
0 new messages