Re: Context of a kernel routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi...

On Sun, Sep 19, 2010 at 01:29, Vimal <j.vimal@xxxxxxxxx> wrote:
> Hi,
>
> How do I find out what functions in the kernel code are run in the
> context of the process they're meant for?  For e.g., when a TCP socket
> receives a packet and it's being processed by some function, is the
> code executing in the context of the process that created this socket?

IMHO it's hard to say that method X is the finest way to identify it.

I think the easiest way is to put the codes such as in_atomic(),
in_interrupt() (I can't really recall the names) in the related codes
and find out which codes that return true.

The other way is to do code tracing by yourself. This method itself
can be done by the help of gdb or other debugger (break at the target
code and do backtracing) OR by doing manual code tracing.

In both ways, you're tracking the execution path i.e where it is
rooted. Most likely, long code path is running inside process context.
In this case, it's piggybacking last process context (if executed by
kernel threads) or running on behalf of current running process (in
the case of syscalls).

Maybe I miss something here, but hopefully you get the idea.


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux