tags:

views:

23

answers:

1

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.

  1. 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))?

  2. 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?

+1  A: 
  1. yes
  2. with klogd started, just try "tail -f /var/log/message"
arsane
kernel threads w/o process context - ISR, soft IRQ etc - do they still have task struct associated with them? I think I remember reading that in ISR, current still points to whatever kernel thread got interrupted, but obviosuly it does not carry any meaning as now you are inside ISR (you can check if you are in ISR using something like am_i_in_isr()). But in that case, current->pid will not point to ISR but to PID of interrupted process..isn't that so?
Methos
ISR/soft IRQ have no context related. What you want to do?
arsane