void timer_handler(struct regs *r) { //Increase tick count timer_ticks++; //If ticks are a factor of 1000 then 1 seccond has passed if(timer_ticks%timer_ticksperseccond==0) rtc_tickseccond(); // Context switch if (timer_ticks%mt_context_switch_delay==0 || mt_first_process->first_thread->sleep_time) mt_switch(r); }
MET_DEFINE_PROBE(sched_switch, TP_PROTO(struct task_struct *prev, struct task_struct *next)) { if (met_switch.mode & 0x2) { mt_switch(prev, next); } if (met_switch.mode & 0x1) { int count; unsigned int pmu_value[8]; count = cpu_pmu->polling(cpu_pmu->pmu, cpu_pmu->nr_cnt, pmu_value); mp_cpu(count, pmu_value); } }