All of lore.kernel.org
 help / color / mirror / Atom feed
From: arokux@gmail.com (Arokux B.)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Iterating through all the processes in a module
Date: Wed, 22 Feb 2012 14:07:22 +0100	[thread overview]
Message-ID: <CAPNxggbWfMioMGPokZ4qK0rtFThDJuJPaeA_LCH_tkUuz8OA3A@mail.gmail.com> (raw)
In-Reply-To: <20120207191702.GA9172@kroah.com>

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 <gregkh@linuxfoundation.org> 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

  reply	other threads:[~2012-02-22 13:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-07 17:45 Iterating through all the processes in a module Arokux B.
2012-02-07 19:17 ` Greg KH
2012-02-22 13:07   ` Arokux B. [this message]
2012-02-22 14:53     ` Greg KH
2012-02-23 11:12       ` Srivatsa Bhat
2012-02-22 15:30     ` Ezequiel García
2012-02-22 16:43       ` Javier Martinez Canillas
2012-02-23 11:07         ` Arokux B.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPNxggbWfMioMGPokZ4qK0rtFThDJuJPaeA_LCH_tkUuz8OA3A@mail.gmail.com \
    --to=arokux@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.