Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Obtaining Process Name in Kernel Space

    Hi All

    I have a situation where I have a kernel module loggging in the description of the user processes calling the module.
    The Information expected to be logged include: Process ID, Process description/name, etc....

    I have no issues with the other data, but am stuck with regards to Process description/name. This data field is essential since Process ID being dyanamic doesnt give me any forthright useful info as to which user level module called my module.

    Referring to the Rubini booked yielded this: char comm[] array in task_struct carries the Process description. But I could not get further details on this array: Who updates this, is the user space supposed to give an input for this, is this a compulosory field, or only some processes have an entry in this array, etc...

    1.Could anyone please clarify on the status of the comm[] array, or any other better alternative to Log the process name.
    2.Which ID is better: pid or tgid.

    I am a Kernel newbie, and I am finding it tough to get a standard set of Kerenl APIs etc. For ex: there is no documentation in the kerenel regarding many semaphore APIs like: down_interruptible or variable description of variables like comm[] even though it is present in an important structure like task_struct. So where can I find good documentation/description of Kernel Structures, Variables and APIs.

    Thanks a lot for your patience and for the help.

  2. #2
    Linux Newbie dilbert's Avatar
    Join Date
    Sep 2006
    Lima, Peru
    I just read this

    If you search in your kernel source code for the function names specified in the table with system calls maybe this leads you to the whole family of those system calls with PIDs.

    Just an idea.
    Bus Error: Passengers dumped. Hech gap yo'q.

  3. #3
    Just Joined!
    Join Date
    Jan 2006
    I think the comm [], variable is updated by the "exec ()" set of system calls.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts