Is there a way to see what kernel task is doing? I found a question (and answers) about What exactly does kernel_task do?. What I want to know is how I can inspect what kernel_task is doing at any given moment in time? 

Does it get logged so that I can inspect what is been doing for a while or can I even observe it at realtime?
There are few places that information is available, but since kernel is a multitasking beast one has to look in multiple places: 


The simple one is the Console log "type kernel in the filter box", but not all activity is reported there since Kernel issues millions of instructions in a Milli-second.
Also the Activity Monitor is a good source of information.
You could use the ps -A &gt; process.txt to see all running processes.
You could use the sudo iosnoop to see all disk activity.
You could use kextstat &gt; ~/Desktop/kexts.txt to see all loaded drivers.


In other words, it is too busy for you to follow and a continuous output file would not make senses.