Find the answer to your Linux question:
Results 1 to 6 of 6
Hi all, I have some questions about monitoring of processes and threads in linux. I spent a lot of time searching them in the web and /proc files but without ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2011
    Posts
    4

    process and thread monitoring


    Hi all,

    I have some questions about monitoring of processes and threads in linux. I spent a lot of time searching them in the web and /proc files but without chance !
    I hope to find responses in this forum !

    1- Is it possible to get threads IDs of a given process (supposed that I have just the pid of this process) ?

    2- Is it possible to get more informations about threads through /proc ?

    3- Is it possible to know in which CPU a thread or a processes is running (if impossible to know which CPU, is it possible to know which node ID ?) ?

    Any suggestion will be very useful. Thanks for your attention.
    Last edited by joujou; 05-26-2011 at 02:44 PM.

  2. #2
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    218

  3. #3
    Just Joined!
    Join Date
    May 2011
    Posts
    4
    Thank you fanderal. Very interesting article.

    I don't know why "ps -L" don't work with my application.

    If I try this following command without the option -L, I get this :
    Code:
    #ps -C myAppli -o pid,tid,nlwp,comm 
    
    PID TID NLWP COMMAND
    849346880 849346880 4 myAppli
    I have the same ID in pid and tid, even if there is 4 threads!

    If I try same thing with -L, there is no information at all!
    Code:
    #ps -C myAppli -L -o pid,tid,nlwp,comm
    
    PID TID NLWP COMMAND
    Any idea about that ?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    218
    You're welcome. That second command might get a result if run as a user... unless you're running 'myAppli' as root?

    Good luck.

  6. #5
    Just Joined!
    Join Date
    May 2011
    Posts
    4
    Yes, I'm running as root!
    is there any equivalence ?

  7. #6
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    218
    If you're looking up a process that's running, you'll get a result. If you're looking up an app or process that isn't running, there's no result. If you're root and looking up a process for a user, but no users are logged in, you probably won't get a result.

    Yes, I'm running as root!
    If you're running 'myAppli' as root but logged in as a user, there's no need to run ps as root. I don't know ps well enough to walk you through what you're trying to accomplish. Hopefully, someone else will respond to any more questions you have.

    A suggestion about process monitoring: check out Conky. Examples: "conky" - Google Search

    Good luck.

Posting Permissions

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