ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
The OS is a program that uses various data structures. Like 
all programs in execution, you can determine the 
performance and other behavior of the OS by inspecting its 
state - the values stored in its data structures. In this 
part of the assignment, we study some aspects of the 
organization and behavior of a Linux system by observing 
values of kernel data structures exposed through the /proc 
virtual file system. 
The /proc virtual file system: 
Linux uses the /proc file system to collect information 
from kernel data structures. The /proc implementation 
provided with Linux can read many different kernel data 
structures. If you cd to /proc on a Linux machine, you will 
see a number of files and directories at that location. 
Files in this directory subtree each corresponds to some 
kernel data structure. The subdirectories with numeric 
names contain virtual files with information about the 
process whose process ID is the same as the directory name. 
Files in /proc can be read like ordinary ASCII files. You 
can open each file and read it using library routines such 
as fgets() or fscanf(). The proc (5) manual page explains 
the virtual files and their content available through 
the /proc file system. 
Requirements in detail: 
In this part, you are asked to write a program to report 
the behavior of the Linux kernel. Your program should run 
in two different versions. The default version should print 
the following values on stdout: 
•	Processor type
•	Kernel version
•	The amount of memory configured into this computer
•	Amount of time since the system was last booted
A second version of the program should run continuously and 
print lists of the following dynamic values (each value in 
the lists is the average over a specified interval): 
•	The percentage of time the processor(s) spend in 
user mode, system mode, and the percentage of time the 
processor(s) are idle
•	The amount and percentage of available (or free) 
memory
•	The rate (number of sectors per second) of disk 
read/write in the system
•	The rate (number per second) of context switches in 
the kernel
•	The rate (number per second) of process creations 
in the system
If your program (compiled executable) is called proc_parse, 
running it without any parameter should print out 
information required for the first version. Running it with 
two parameters "proc_parse <read_rate> <printout_rate>" 
should print out information required for the second 
version. read_rate represents the time interval between two 
consecutive reads on the /proc file system. printout_rate 
indicates the time interval over which the average values 
should be calculated. Both read_rate and printout_rate are 
in seconds. For instance, proc_parse 2 60 should read 
kernel data structures once every two seconds. It should 
then print out averaged kernel statistics once a minute 
(average of 30 samples). The second version of your program 
doesn't need to terminate.


No Answer is Posted For this Question

Be the First to Post Answer

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What is macro? IBM4
write a program to sort the elements in a given array in c language  2
What is the difference between null pointer and void pointer CTS3
What are the preprocessors? HP6
Who is invented by c? Infosys14
difference between function & structure Verizon5
What is structure packing ? HP1
What is encapsulation?  1
how to implement stack work as a queue?  2
4.weight conversion: Write a program that will read weight in pounds and convert it into grams.print both the original weight and the converted value.There are 454 grams in a pound.design and carry out a test plan for this program. Wipro1
Write a program to generate prime factors of a given integer?  3
what is the output of the following program and explain the answer #include<stdio.h> exp() { main(5) } main(int a) { printf("%d",a); return; } Satyam3
code for copying two strings with out strcpy() function.  5
write a program in 'c' to find the value of p[i+1]^n.p,i,n are arguments of a macro and n is a integer  1
a memory of 20 bytes is allocated to a string declared as char *s then the following two statements are executed: s="Etrance" l=strlen(s); what is the value of l ? a.20 b.8 c.9 d.21 TCS4
i want explaination about the program and its stack reprasetaion fibbo(int n) { if(n==1 or n==0) return n; else return fibbo(n-1)+fibbo(n-2); } main() { fibbo(6); }  2
write a program for odd numbers?  6
How do I initialize a pointer to a function?  2
Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ... } c.x=0; do{ /*x unaltered within theloop*/ ... }while(x==0); d.# define TRUE 0 ... while(TRUE){ .... } TCS4
which one low Priority in c? a)=,b)++,c)==,d)+  8
 
For more C Interview Questions Click Here 
         
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com