diff --git a/kernel/sched/perf_error_detection.c b/kernel/sched/perf_error_detection.c index 2d149a6cabf6e298639ba4ece02877365bdd87d1..803b954be92c05f79bbe309d9108e88ec34c77ba 100644 --- a/kernel/sched/perf_error_detection.c +++ b/kernel/sched/perf_error_detection.c @@ -21,7 +21,7 @@ int init_perf_event(struct plan_entry *plan_entry, struct perf_event **pevent){ pe.type = PERF_TYPE_HARDWARE; pe.size = sizeof(struct perf_event_attr); pe.config = PERF_COUNT_HW_INSTRUCTIONS; - pe.sample_period = plan_entry.n_instr; + pe.sample_period = plan_entry->n_instr; pe.disabled = 0; // start the counter as soon as we're in userland pe.pinned = 1; // ? pe.exclude_kernel = 1; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 7c60deb1a910ce7c63c7f1d13d4ee875f36ea56a..c35e8c52f55a20062b846af687bccb46ad47353f 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -551,52 +551,6 @@ struct pb_rq { }; int pb_init_rq(struct pb_init_struct *initstr, struct rq *rq); -// used to determine the next mode of the PB-Scheduler -// This function is located in sched.h since pb.c and fair.c are using this function -static inline int determine_next_mode_pb(struct rq *rq) -{ - int mode = PB_DISABLED_MODE; - struct pb_rq *pb = &(rq->pb); - - if (pb->c_entry < pb->size) - { - // initial switch - if (pb->mode == PB_DISABLED_MODE && pb->is_initialized) - { - return PB_EXEC_MODE; - } - else - { - if (pb->mode == PB_EXEC_MODE) - { - //stay for n timer interrupts cycles in exec mode - /* - * Is the tick interrupt active in this moment? - */ - if(pb->count_pb_cycles > pb->n_pb_cycles){ - mode = PB_ADMIN_MODE; - pb->count_pb_cycles = 0; - }else{ - mode = PB_EXEC_MODE; - } - } - else if (pb->mode == PB_ADMIN_MODE) - { - //stay for n timer interrupt cylces in uall mode for admin tasks - /* - * Is the tick interrupt active in this moment? - */ - if(pb->count_admin_cycles > pb->n_admin_cycles){ - mode = PB_EXEC_MODE; - pb->count_admin_cycles = 0; - }else{ - mode = PB_ADMIN_MODE; - } - } - } - } - return mode; -} static inline int rt_bandwidth_enabled(void) { @@ -914,6 +868,53 @@ static inline int cpu_of(struct rq *rq) #endif } +// used to determine the next mode of the PB-Scheduler +// This function is located in sched.h since pb.c and fair.c are using this function +static inline int determine_next_mode_pb(struct rq *rq) +{ + int mode = PB_DISABLED_MODE; + struct pb_rq *pb = &(rq->pb); + + if (pb->c_entry < pb->size) + { + // initial switch + if (pb->mode == PB_DISABLED_MODE && pb->is_initialized) + { + return PB_EXEC_MODE; + } + else + { + if (pb->mode == PB_EXEC_MODE) + { + //stay for n timer interrupts cycles in exec mode + /* + * Is the tick interrupt active in this moment? + */ + if(pb->count_pb_cycles > pb->n_pb_cycles){ + mode = PB_ADMIN_MODE; + pb->count_pb_cycles = 0; + }else{ + mode = PB_EXEC_MODE; + } + } + else if (pb->mode == PB_ADMIN_MODE) + { + //stay for n timer interrupt cylces in uall mode for admin tasks + /* + * Is the tick interrupt active in this moment? + */ + if(pb->count_admin_cycles > pb->n_admin_cycles){ + mode = PB_EXEC_MODE; + pb->count_admin_cycles = 0; + }else{ + mode = PB_ADMIN_MODE; + } + } + } + } + return mode; +} + #ifdef CONFIG_SCHED_SMT