]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - resources/cpu_aquosa/mngr/frm_aqcpu.c
Allow specification of the local CPU ID using environment variable
[frescor/frsh.git] / resources / cpu_aquosa / mngr / frm_aqcpu.c
index a7c210e92e45002c962c13839a7556919d33bf7d..fe657590c5126fa3a07f9ef93290ec7d76009d10 100644 (file)
@@ -90,16 +90,16 @@ static int aqcpu_admtest(struct fres_sa_scenario *scenario, void *priv,
 
                sum_utilization+= budget*100/period;
        }
-       *schedulable = sum_utilization < 100;
+       *schedulable = sum_utilization <= 88; // 100;
        if (*schedulable) {
                scenario->utilization = sum_utilization;
        }
-       printf("=> %s\n", *schedulable?"schedulable":"not schedulable");
+       ul_logmsg("=> %s\n", *schedulable?"schedulable":"not schedulable");
                
        return 0;
 }
 
-static const struct fres_res_manager frm = {
+static struct fres_res_manager frm = {
        .res_type = FRSH_RT_PROCESSOR,
        .res_id = FRSH_CPU_ID_DEFAULT,
        .admission_test = aqcpu_admtest,
@@ -142,7 +142,8 @@ int main(int argc, char *argv[])
        
        orb = forb_init(&argc, &argv, &attr);
        if (!orb) error(1, errno, "forb_init");
-       
+
+       frm.res_id = frsh_get_local_cpu_id();
        ret = frm_register_and_run(orb, &frm);
 
        if (ret != 0) {