Here, you will be tracing the system calls executed. For this, let us define two states within the kernel: trace on and trace off.

computer science

Description

2.1 Tracing the system call: 

 Here, you will be tracing the system calls executed. For this, let us define two states within the kernel: trace on and trace off. If the state is equal to trace off, which is the default, then nothing needs to be done. However, it is possible to set the state to trace on with a special system call, which we shall see in the next bullet point. The state can be subsequently reset (set to trace off ) as well. Whenever the state changes from trace off to trace on, you need to enable a custom form of system call tracing within the kernel. This will keep a count of the number of times a system call has been invoked since the state changed to trace on. Let us define a new system call called sys print count. It will print the list of system calls that have been invoked since the last transition to the trace on state with their counts. A representative example is shown below. The format is as follows. There are two columns separated by a single space. The first column contains the name of the system call, and the second column contains the count. There are no additional lines; the system call names are sorted alphabetically in ascending order.

Instruction Files
XV6ASS1.pdf
174.8 KB

Related Questions in computer science category