leaf_t *leaf = NULL;
identity_t *ident = NULL;
- map_reset_iterate(instance->leaf_map);
- while ((leaf = (leaf_t *) map_next(instance->leaf_map))) {
- printf("%x:", leaf->xid);
- ident = leaf->parent;
- while (ident) {
- printf("%d:",ident->id);
- ident = ident->parent;
+ if (system_loglevel == LOG_DEBUG) {
+ map_reset_iterate(instance->leaf_map);
+ while ((leaf = (leaf_t *) map_next(instance->leaf_map))) {
+ printf("%x:", leaf->xid);
+ ident = leaf->parent;
+ while (ident) {
+ printf("%d:",ident->id);
+ ident = ident->parent;
+ }
+ printf("Leaf's parent pointer is %p\n", leaf->parent);
}
- printf("Leaf's parent pointer is %p\n", leaf->parent);
- }
- printf("instance->last_machine is %p\n", instance->last_machine);
+ printf("instance->last_machine is %p\n", instance->last_machine);
+ }
}
static int assign_htb_hierarchy(drl_instance_t *instance) {
} else {
/* Pointerific! */
instance->machines[i]->htb_parent =
- instance->machines[i]->parent->htb_node;
+ instance->machines[i]->parent->htb_node;
}
instance->machines[i]->htb_node = next_node;
instance->leaves[i].xid, instance->leaves[i].xid);
if (execute_cmd(cmd)) {
- //FIXME: remove this print and do a log.
- printf("GRD: pfifo qdisc wasn't there!\n");
+ printlog(LOG_DEBUG, "GRD: pfifo qdisc wasn't there!\n");
}
/* Add the netem qdisc. */
sprintf(cmd, "/sbin/tc qdisc del dev eth0 parent 1:1000 handle 1000 pfifo");
if (execute_cmd(cmd)) {
- //FIXME: remove this print and do a log.
- printf("GRD: pfifo qdisc wasn't there!\n");
+ printlog(LOG_DEBUG, "GRD: pfifo qdisc wasn't there!\n");
}
/* Add the netem qdisc. */
sprintf(cmd, "/sbin/tc qdisc del dev eth0 parent 1:1fff handle 1fff pfifo");
if (execute_cmd(cmd)) {
- //FIXME: remove this print and do a log.
- printf("GRD: pfifo qdisc wasn't there!\n");
+ printlog(LOG_DEBUG, "GRD: pfifo qdisc wasn't there!\n");
}
/* Add the netem qdisc. */
* see estimate.c
*/
if (pthread_create(&estimate_thread, NULL, (void*(*)(void*)) &handle_estimation, &limiter)!=0) {
- ulogd_log(ULOGD_ERROR, "couldn't start estimate thread for 0x%x %s\n",limiter.localaddr,
- limiter.ip);
+ printlog(LOG_CRITICAL, "Couldn't start estimate thread.\n");
fprintf(stderr, "An error has occured starting ulogd_DRL. Refer to your logfile (%s) for additional information.\n", drl_logfile.u.string);
exit(EXIT_FAILURE);
}