lkml.org 
[lkml]   [2010]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Notification when a task is created/exits
On Tue, 16 Feb 2010 11:18:25 +0530
"Leonidas ." <leonidas137@gmail.com> wrote:

> Hi folks,
>
> Is it possible to register a set of callbacks from my module so that
> these call backs get called
> whenever a certain task is created or exits. Basically, I want to keep
> track of all the threads
> which are created and are exiting, my module should get notified of
> these events somehow.
> One way is to call my functions directly from the task creation and
> exit functions, but I personally
> do not like this approach since I dont want to mess with this core kernel code.
>

AFAIK, there are no extensible notifier chain at task create/exit.
But I think you have 2 options.

1. use NETLINK and catch task create/exit in userland.
But this means "catch" is asyncronous.

2. implement cgroup subsystem
AFAIK, in the latest kernel, cgroup subsystem can be implemented as module.
cgroup has fork/exit handler.
And you can implement some useful controls for tasks you watch via
cgroup's control interface.

Thanks,
-Kame


> -Leo.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>



\
 
 \ /
  Last update: 2010-02-17 03:59    [W:0.160 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site