i want to make a C program that should wb able to do the following tasks.
one thing that i want to say is that we dont have to use ps and top all these commands
by C programmign only ..........
i am doing this by proc file system using CAT command in various files but .......its not correct
can anyone tell me how to see the parameters of task_struct
- Should be able to show the status of all the processes
- Should be able to show the new processes coming in
- Should be able to keep a log of the processes expired(The log should contain the starting time, expiry time, time slices used, total execution time, effective CPU usage time, time wasted for IO etc.)
- Should be able to show the CPU usage time, Transition time, Wait time in the queue, No of total time slices used to run etc.
- If possible should be able to show the memory usage of each process(both Physical and Virtual)
- If possible should be able to keep log of all this information. Also keep track of the swapping of the processes.
- Should be able to automatically analyse the information stored and show a graph of the usage times etc. And should suggest the best possible time slice for that environment.
- Should be able to show the resources used by each process. And should keep a log of resource allocation for a process.
- Should be able to show the percentage of Usage of CPU during a time slice by the process and a log should be maintained for this.
- Should be able to show the priorities of different processes and show how preemtion takes place. Also show the number of timeslices alloted for processes of different priorities.
- Should be able to show the processes waiting in the queue etc.