]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - resources/cpu_aquosa/lib/aqcpu_fra.c
Allow specification of the local CPU ID using environment variable
[frescor/frsh.git] / resources / cpu_aquosa / lib / aqcpu_fra.c
index fb1713a9551d44a5829f834b312e7988a888c310..2c6a9a53a5dc2425e58d512a40574a6c03c57709 100644 (file)
@@ -99,7 +99,7 @@ static int aqcpu_create_vres(fres_vres_t *vres, void *priv)
                return qos_rv_int(rv);  
        }
        
-       printf("Created AQCPU VRES(sid=%d period=%lld us, budget=%lld us)\n",
+       ul_logdeb("Created AQCPU VRES(sid=%d period=%lld us, budget=%lld us)\n",
                        sid, cpu_params.P, cpu_params.Q);
        if ((vres->priv = malloc(sizeof(qres_sid_t)))) {
                memcpy(vres->priv, &sid, sizeof(qres_sid_t));
@@ -131,7 +131,7 @@ static int aqcpu_cancel_vres(fres_vres_t *vres, void *priv)
        if (qrv != QOS_OK) {
                return qos_rv_int(qrv);
        }
-       printf("Canceled AQCPU VRES(sid=%d)\n",sid);
+       ul_logdeb("Canceled AQCPU VRES(sid=%d)\n",sid);
        free(vres->priv);
 
        return 0;
@@ -164,6 +164,8 @@ int aqcpu_change_vres(fres_vres_t *vres, void *priv)
        
        /* set cpu params */
        qrv = qres_set_params(sid, &cpu_params);
+
+       vres->perceived = vres->new;
        
        ul_logmsg("AQCPU VRES(sid=%d) params changed(period=%lld us,"
                        "budget=%lld us)\n",sid, cpu_params.P,cpu_params.Q);
@@ -304,7 +306,7 @@ int fra_CPU_set_spare_bandwidth(fres_vres_t *vres)
        rv = qsup_reserve_spare(r2bw(cpu_params.Q, cpu_params.P));
        if (rv != QOS_OK) return qos_rv_int(rv);
 
-       printf("Created AQCPU spare (period=%lld us, budget=%lld us)\n",
+       ul_logdeb("Created AQCPU spare (period=%lld us, budget=%lld us)\n",
                        cpu_params.P, cpu_params.Q);
        if ((vres->priv = malloc(sizeof(qres_sid_t)))) {
                memcpy(vres->priv, &fake_sid, sizeof(qres_sid_t));
@@ -441,6 +443,8 @@ int aqcpu_fra_init(void)
 {
        int rv;
 
+       aqcpu_allocator.res_id = frsh_get_local_cpu_id();
+               
        if ((rv = fra_register(&aqcpu_allocator))) {
                return rv;
        }