From: Michal Sojka Date: Fri, 27 Nov 2009 11:11:52 +0000 (+0100) Subject: Convert printf()s in managers to ul_log X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/frsh.git/commitdiff_plain/bbbee7cd7e0f53e01c6bf19b3bafdb5c815b0b3e?hp=55e5f518859f75c7e5978015ed5891cc4a8fedc2 Convert printf()s in managers to ul_log --- diff --git a/resources/cpu_aquosa/lib/aqcpu_fra.c b/resources/cpu_aquosa/lib/aqcpu_fra.c index 2e236e3..34c7943 100644 --- a/resources/cpu_aquosa/lib/aqcpu_fra.c +++ b/resources/cpu_aquosa/lib/aqcpu_fra.c @@ -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)); diff --git a/resources/cpu_aquosa/mngr/frm_aqcpu.c b/resources/cpu_aquosa/mngr/frm_aqcpu.c index ef68087..743c960 100644 --- a/resources/cpu_aquosa/mngr/frm_aqcpu.c +++ b/resources/cpu_aquosa/mngr/frm_aqcpu.c @@ -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; } diff --git a/resources/disk_bfq/mngr/diskbfq_mngr.c b/resources/disk_bfq/mngr/diskbfq_mngr.c index 7eb4f2e..b256614 100644 --- a/resources/disk_bfq/mngr/diskbfq_mngr.c +++ b/resources/disk_bfq/mngr/diskbfq_mngr.c @@ -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; }