Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Add a new system call called trace to xv 6 . Its syntax is int trace ( int ) When called with a non -

Add a new system call called trace to xv6. Its syntax is
int trace(int)
When called with a non-zero parameter, e.g., trace(1), system call tracing is
turned on for that process. Each system call from that process will be printed to
the console in a user-friendly format showing:
the process ID
the process name
the system call number
the system call name
Any other processes will not have their system calls printed unless they also call
trace(1).
Calling trace(0) turns tracing off for that process. System calls will no longer be
printed to the console.
In all cases, the trace system call also returns the total number of system calls
that the process has made. Hence, you can write code such as:
printf("total system calls so far =%d
", trace(0));
The system call counting for each system call on a per-process basis. You will
need to keep track of this in the process control block, the proc structure.
Write a test program (try.c) to test your trace system call

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions