I'm trying to modify schedule.c file ( /usr/src/minix/servers/sched/schedule.c ) in Minix 3. For every process that used up it's quantum, I want to see how much sys time passed. So I want to add following lines to do_noquantum():
...
rmp = &schedproc[proc_nr_n];
minix_time_type curr_time = minix_function_to_get_curr_time();
minix_time_type time_passed = curr_time - last_time[proc_nr_n];
//last_time[NR_PROCS] is a global array
last_time[proc_nr_n] = curr_time;
do_something_with_this_knowledge(time_passed);
...
But I don't know the proper types and functions. Also - maybe there's another, better way to do it.