Tool to parse info from /proc/stat on ubuntu, can also be used to query individual threads.  I built this to check process statistics for a scheduler benchmark so the code might not be pretty, but it generally will work for Ubuntu's flavor of Linux.