Code Monkey home page Code Monkey logo

ps's Introduction

Some notes:

  1. WCHAN value 0 means the process isnt waiting for a resource
  2. I made the filename a parameter in the get_file_values and just used a '/stat' const to add support for later expansion (idk analyzing statm for more memory information and such)
  3. I initially added analsys for the 'status' file to get the UID's and GID's but was a pain in the ass to extract the values out, I dont want to waste my time on it. (but what is important is that I get the concept - it resides in the 'status' file in a process's directory)
  4. Utime and Stime are displayed in clock ticks.

Explanation of each of the fields displayed:

  1. PID 0 - the ID of the process

  2. Comm 1 - the name assosiacted with the process

  3. State 2 - the current state of the process

  4. PPID 3 - the ID of the parent of the process

  5. Utime 13 - the amount of time the process has been scheduled in user mode (in CPU ticks)

  6. Stime 14 - the amount of time the process has been scheduled in kernel mode (in CPU ticks)

  7. Priority 17 - the actual priority of the process the kernel sees

  8. Nice 18 - 'how nice the process is' this value affects the Priority value of the process. (from what I understand it differs between different kernel versions)

  9. Threads 19 - the number of threads the process has

  10. RSS 23 - the number of pages the process has in real memory

  11. Uid - status file - real, effective and saved uid

  12. Gid - status file - real, effective and saved gid

  13. Wchan - wchan file - the address of the kernel function the process is blocked in

  14. Tty - fd/0 symlink - the tty device the process is running on (in case there is no tty such as when the process is a daemon, a '?' is placed)

ps's People

Contributors

roeegg2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.