Asg 0
Asg 0
In this assignment, you are required to measure the performance of the following two system calls in Linux:
You are required to measure the execution time, in terms of CPU cycles, of both the system calls. For this task,
you are required to learn how to use the processor’s hardware performance counter (the time stamp counter) to
measure time. Do not use a user-space utility such as date or gettimeofday(). Pick a fixed memory size (e.g.,
100MB) for your micro-benchmark (performance of fork depends on program size). Report your measurements
based on multiple runs (minimum 10) along with the standard deviation. In case you observe high variation across
different runs, state: 1) what causes such variations, and 2) how would you choose a representative value to indicate
execution cycles required for a system call.
Note: The fork system call returns in two processes, the parent and the child. You should measure the timing in
both and use the lower for your measurements.
You can use any Linux distribution (e.g., Ubuntu, Fedora etc.), and either of native or virtual machine for the
assignment. You must use Linux kernel v5.0, available at:
https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.0.tar.xz
If you’re using a virtual environment, you may consider using VirtualBox, Bochs, or QEMU.
What to submit: Submit a tarball consisting of three things: 1) the kernel patch for introducing the my precious
syscall. 2) User-space program(s) used to measure the timing of system calls and 3) your report in PDF form. Use
git, a version control system, to generate the kernel patch. If you submit the entire source code of the ker-
nel (and not a patch to the base version of Linux you’re using), you will get a zero on your submission.
How to submit: Send an email consisting of the above tarball to [email protected], [email protected]
and [email protected], with subject “OS Assignment-0 Submission”. Name the tarball as your SR Number.
• Learning how to set up your working environment (be it virtual or bare metal), i.e., learning how to compile
the kernel obtain a bootable image/ramdisk, and getting your system to boot your image.
• Learning how to use a debugger to figure out the problem if your program is crashing.
• Learning to use a version control system to backup your code and using it to obtain a kernel patch (which
you’ll be submitting)
All of these learning objectives may seem rather mundane, but are time consuming if you do not have prior
experience with them. Start early!