]> rtime.felk.cvut.cz Git - frescor/frsh.git/commitdiff
Convert printf()s in managers to ul_log
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 27 Nov 2009 11:11:52 +0000 (12:11 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 27 Nov 2009 11:11:52 +0000 (12:11 +0100)
resources/cpu_aquosa/lib/aqcpu_fra.c
resources/cpu_aquosa/mngr/frm_aqcpu.c
resources/disk_bfq/mngr/diskbfq_mngr.c

index 2e236e30be691c6a47d5a541c583546a6a3b5010..34c7943f1dad9866e71f2829370679cd41f981dd 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;
@@ -306,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));
index ef680874cfd86619e90eaf5a4d6cc6305066807b..743c960795ff429a65c26492f957ab840affa3ab 100644 (file)
@@ -94,7 +94,7 @@ static int aqcpu_admtest(struct fres_sa_scenario *scenario, void *priv,
        if (*schedulable) {
                scenario->utilization = sum_utilization;
        }
-       printf("=> %s\n", *schedulable?"schedulable":"not schedulable");
+       ul_logmsg("=> %s\n", *schedulable?"schedulable":"not schedulable");
                
        return 0;
 }
index 7eb4f2e41eec6bab99fb2a2663051f17082528df..b2566142037269651adc7f9cca6fb6fc7d5dd26b 100644 (file)
@@ -124,8 +124,8 @@ static int diskbfq_admtest(struct fres_sa_scenario *scenario,
 
                period = fosa_rel_time_to_nsec(basic->period);
                budget = fosa_rel_time_to_nsec(basic->budget);
-               printf("processing: id=%s, period=%ld ms, budget=%ld ms\n",
-                      id, period, budget);
+               ul_logmsg("processing: id=%s, period=%ld us, budget=%ld us\n",
+                      id, period/1000, budget/1000);
 
                if (c->contract == c->new) {
                        int ret;
@@ -142,27 +142,25 @@ static int diskbfq_admtest(struct fres_sa_scenario *scenario,
                        ret = fres_contract_add_disk_sched(c->contract,
                                                           disk_sched);
                        if (ret) {
-                               fprintf(stderr,
-                                       "Cannot add disk_sched block\n");
+                               ul_logerr("Cannot add disk_sched block\n");
                                free(disk_sched);
                                return -1;
                        }
                } else {
                        disk_sched = fres_contract_get_disk_sched(c->contract);
                        if (!disk_sched) {
-                               fprintf(stderr,
-                                       "disk_sched is not present\n");
+                               ul_logerr("disk_sched is not present\n");
                                return -1;
                        }
                }
                sum_weight += disk_sched->weight;
        }
 
-       printf("sum_weight=%ld, max_weight=%d\n",
-              sum_weight,
-              DISKBFQ_WEIGHT_MAX);
+       ul_logmsg("sum_weight=%ld, max_weight=%d\n",
+                 sum_weight,
+                 DISKBFQ_WEIGHT_MAX);
        *schedulable = sum_weight < DISKBFQ_WEIGHT_MAX;
-       printf("=>%s\n", (*schedulable) ? "schedulable" : "not schedulable");
+       ul_logmsg("=> %s\n", (*schedulable) ? "schedulable" : "not schedulable");
 
        return 0;
 }