- Make sure you have installed: $ sudo apt-get install build-essential
- $ runLogger This will help compile the logger.c file and then run ./logger
- You will be asked whether the process should be logged. If not the output will be showed in the terminal directly.
- Will be asked for the rate at which the process will poll the proc folder (20 to 999 ms).
- Input the proc id for which the length of next CPU burst will be calculated (You can get this from the list of process ids in terminal with help of some command lines.).
- Get a log.txt file to store the actual length of next 10 CPU burst.
- Choose to continue executing the programming or quit
- $ make This will make the proclog kernel module
- $ sudo insmod proclog.ko This will install the kernel module. A file /proc/timing_log can now be written to by various programs
- To see an example of this run the following code:
- $ gcc -o test test.c
- $ sudo ./test You will need sudo privaleges to write to a proc file
- $ cat /proc/timing_log This shows that the test file ran andd printed "This is test output" to the proc file. Make sure that any writing done to the proc file ends with a new line character