From mboxrd@z Thu Jan 1 00:00:00 1970 From: arokux@gmail.com (Arokux B.) Date: Wed, 22 Feb 2012 14:07:22 +0100 Subject: Iterating through all the processes in a module In-Reply-To: <20120207191702.GA9172@kroah.com> References: <20120207191702.GA9172@kroah.com> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Dear Greg, thank you very much for your quick reply. Having my code as a module I can trigger its execution (load a module) and disable it (unload a module). How can I achieve this if the code is inside the kernel? One possibility I see is adding an entry in the procfs. Regards On Tue, Feb 7, 2012 at 8:17 PM, Greg KH wrote: > On Tue, Feb 07, 2012 at 06:45:24PM +0100, Arokux B. wrote: >> Hi, >> >> (for learning purposes) I would like to iterate through all the tasks >> in a module and output different information about them. For this task >> I need to lock the list of all tasks (need I?). I've seen some example >> in the kernel code which lock tasklist_lock. However this symbol >> cannot be used by modules. Its export was removed by >> c59923a15c12d2b3597af913bf234a0ef264a38b commit. >> >> Is there any other way I can lock the list of tasks then? > > Don't do such a foolish thing? ?:) > > Seriously, don't make your code a module, just build it into the kernel. > > greg k-h