I want to distinguish between various execution paths in linux kernel so that I can monitor a particular thread by grepping on its id in dmesg.
Is task_struct->pid sufficient to distinguish between all threads of execution (like kernel threads executing on behalf of user processes, normal kernel threads with process contexts but not execing on behalf of user process (like work queue), kernel thread without process context (like ISR, soft IRQ and tasklets))?
If I am monitoring a output file in user space that gets frequently updated, I can monitor it using something like "tail -f output.txt". Is there a way I can do same for kernel log messages?