update sample.c

rewrite to support 8 cores, uid, pid, wifi