]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - resources/disk_bfq/mngr/diskbfq_mngr.c
BFQ: show units with determined throughput
[frescor/frsh.git] / resources / disk_bfq / mngr / diskbfq_mngr.c
index 7eb4f2e41eec6bab99fb2a2663051f17082528df..62a95808e58985dc3ad70fb4394dd879054bb601 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;
 }
@@ -284,7 +282,7 @@ err_usage:
 
        fprintf(stdout, "disk name: %s\n"
                "scheduler: %s\n"
-               "disk aggregate throughput: %f\n"
+               "disk aggregate throughput: %f KiB/s\n"
                "scheduling budget: %d\n",
                disk_name, SYSFS_BFQ_NAME, disk.throughput, disk.budget);