LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2009, 01:20 AM   #1
m1n
Member
 
Registered: Feb 2009
Posts: 33

Rep: Reputation: 15
Smile /proc/pid/stat information


Hi guys how to get something usefull from unstructured information in /proc/pid/stat file.

I want to get minflt value.How to do it? Which number is for certain parameter(vSize,rss and all otheres from 'man proc').

Last edited by m1n; 02-24-2009 at 05:30 AM.
 
Old 02-24-2009, 01:40 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,533

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
"man proc" then enter (no quotes) "/]stat" to position yourself at the right spot.
 
Old 02-24-2009, 01:51 AM   #3
m1n
Member
 
Registered: Feb 2009
Posts: 33

Original Poster
Rep: Reputation: 15
Well, you didn't get me. When i enter

cat /proc/12860/stat i am getting

12860 (sgroup) S 1 12860 12860 0 -1 0 27230 0 0 0 2877 97 0 0 16 0 1 200 630319606 644042752 27070 18446744073709551615 4194304 64877828 548682069520 18446744073709551615 182909096137 0 0 101208579 1233136892 18446744073709551615 0 0 17 1 0 0

When i look at man /proc/pid/stat:

/proc/[pid]/stat
Status information about the process. This is used by ps(1). It is
defined in /usr/src/linux/fs/proc/array.c.

The fields, in order, with their proper scanf(3) format specifiers,
are:

pid %d The process ID.

comm %s The filename of the executable, in parentheses. This is
visible whether or not the executable is swapped out.

state %c One character from the string "RSDZTW" where R is running,
S is sleeping in an interruptible wait, D is waiting in
uninterruptible disk sleep, Z is zombie, T is traced or
stopped (on a signal), and W is paging.

ppid %d The PID of the parent.

pgrp %d The process group ID of the process.

session %d The session ID of the process.

tty_nr %d The controlling terminal of the process. (The minor device
number is contained in the combination of bits 31 to 20 and
7 to 0; the major device number is in bits 15 t0 8.)

tpgid %d The ID of the foreground process group of the controlling
terminal of the process.

flags %u (%lu before Linux 2.6.22)
The kernel flags word of the process. For bit meanings,
see the PF_* defines in <linux/sched.h>. Details depend on
the kernel version.

and so on.

This elements in man page are not in the same order as they in proc/pid/stat.

How to find out which one is which?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/proc/<pid>/stat empty? Brian Moffet Linux - Kernel 1 04-27-2008 02:05 AM
reading /proc/pid/stat file? sanjaykhuntia Linux - Enterprise 1 10-29-2007 02:45 AM
/proc/<pid>/stat shows zero cpu usage simchac Linux - Kernel 0 07-25-2006 07:26 AM
How reliable is /proc/stat information vs LTT ? rbarara Linux - Software 0 11-25-2004 09:07 PM
about /proc/$pid/stat 's start time henryluo Programming 2 06-21-2004 09:15 AM


All times are GMT -5. The time now is 07:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration