Reading /proc/stats

Asked by Michael Davis

I am writing a C program that is to read the /proc/[number]/stats file for its performance information. It appears that the structure layout of the records in this file are contained in the 'linux/proc_fs.h' header file.

I cannot find this file and cannot find any internet references to the file. This file is referenced in other examples and program source code. Does anyone know where this file is located and how I can get to it?

Thanks,

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu linux Edit question
Assignee:
No assignee Edit question
Solved by:
Ubfan
Solved:
Last query:
Last reply:
Revision history for this message
Best Ubfan (ubfan1) said :
#1

Install the packages starting with linux-headers for your kernel. There probably are three of them, e.g.
linux-headers-3.2.0-26, linux-headers-3.2.0-26-generic-pae, and linux-headers-generic-pae.
Maybe getting the build-essentials package would get these for you, but I'm not sure.

Revision history for this message
Michael Davis (madavis) said :
#2

The install still does move the headers out of the package and into the /usr/include directory. However, I should be able to discover the headers I need and then manually copy them over to the required include location.

Should I need more help, I know where to ask.

Thanks for the help.