reduced debugging output.

This commit is contained in:
gardners 2012-06-25 14:46:55 +09:30
parent d579693f3d
commit 0c0e5b73e9
4 changed files with 30 additions and 24 deletions

View File

@ -825,7 +825,7 @@ int overlay_tick_interface(int i, long long now)
return 0;
}
WHYF("Ticking interface #%d\n",i);
if (0) WHYF("Ticking interface #%d\n",i);
/* Get a buffer ready, and limit it's size appropriately.
XXX size limit should be reduced from MTU.
@ -932,10 +932,11 @@ int overlay_tick_interface(int i, long long now)
{
if ((*p)->dequeue) {
{
WHYF("dequeuing %s* -> %s* NOW (queue length=%d)",
overlay_render_sid_prefix((*p)->source,7),
overlay_render_sid_prefix((*p)->destination,7),
overlay_tx[q].length);
if (debug&DEBUG_QUEUES)
WHYF("dequeuing %s* -> %s* NOW (queue length=%d)",
overlay_render_sid_prefix((*p)->source,7),
overlay_render_sid_prefix((*p)->destination,7),
overlay_tx[q].length);
t=*p;
*p=t->next;
if (overlay_tx[q].last==t) overlay_tx[q].last=t->prev;
@ -984,10 +985,10 @@ void overlay_check_ticks(void) {
for(i = 0; i < overlay_interface_count; i++) {
/* Only tick live interfaces */
if (overlay_interfaces[i].observed > 0) {
if (1||debug & DEBUG_VERBOSE_IO) INFOF("Interface %s ticks every %dms, last at %lld.",
if (debug & DEBUG_VERBOSE_IO) INFOF("Interface %s ticks every %dms, last at %lld.",
overlay_interfaces[i].name,
overlay_interfaces[i].tick_ms,
overlay_interfaces[i].last_tick_ms);
overlay_interfaces[i].last_tick_ms);
if (now >= overlay_interfaces[i].last_tick_ms + overlay_interfaces[i].tick_ms) {
/* This interface is due for a tick */
@ -995,7 +996,7 @@ void overlay_check_ticks(void) {
overlay_interfaces[i].last_tick_ms = now;
}
} else
if (1||debug & DEBUG_VERBOSE_IO) INFOF("Interface %s is awol.", overlay_interfaces[i].name);
if (debug & DEBUG_VERBOSE_IO) INFOF("Interface %s is awol.", overlay_interfaces[i].name);
}
/* Update interval until next tick */
@ -1018,18 +1019,19 @@ long long overlay_time_until_next_tick()
long long thistick=
overlay_interfaces[i].tick_ms
-(now-overlay_interfaces[i].last_tick_ms);
WHYF("Interface %s ticks every %dms, last at T-%lldms, next needed in %lldms.\n",
overlay_interfaces[i].name,
overlay_interfaces[i].tick_ms,now-overlay_interfaces[i].last_tick_ms,
thistick);
if (0)
WHYF("Interface %s ticks every %dms, last at T-%lldms, next needed in %lldms.\n",
overlay_interfaces[i].name,
overlay_interfaces[i].tick_ms,now-overlay_interfaces[i].last_tick_ms,
thistick);
if (thistick<0) thistick=0;
if (thistick<nexttick) nexttick=thistick;
WHYF("nexttick is now %lldms",nexttick);
if (0) WHYF("nexttick is now %lldms",nexttick);
}
WHYF("Next tick required in %lldms",nexttick);
if (0) WHYF("Next tick required in %lldms",nexttick);
return nexttick;
}

View File

@ -410,9 +410,10 @@ int overlay_saw_mdp_frame(int interface, overlay_mdp_frame *mdp,long long now)
more prudent path.
*/
WHYF("Received packet with listener (MDP ports: src=%s*:%d, dst=%d)",
overlay_render_sid_prefix(mdp->out.src.sid,7),
mdp->out.src.port,mdp->out.dst.port);
if (0)
WHYF("Received packet with listener (MDP ports: src=%s*:%d, dst=%d)",
overlay_render_sid_prefix(mdp->out.src.sid,7),
mdp->out.src.port,mdp->out.dst.port);
if ((!overlay_address_is_local(mdp->out.dst.sid))

View File

@ -244,9 +244,10 @@ int overlay_payload_enqueue(int q,overlay_frame *p,int forceBroadcastP)
Complain if there are too many frames in the queue.
*/
WHYF("Enqueuing packet for %s* (q[%d]length = %d)",
overlay_render_sid_prefix(p->destination,7),
q,overlay_tx[q].length);
if (0)
WHYF("Enqueuing packet for %s* (q[%d]length = %d)",
overlay_render_sid_prefix(p->destination,7),
q,overlay_tx[q].length);
if (q==OQ_ISOCHRONOUS_VOICE&&(!forceBroadcastP)) {
/* Dispatch voice data immediately.
Also tell Rhizome to back off a bit, so that voice traffic
@ -256,7 +257,7 @@ int overlay_payload_enqueue(int q,overlay_frame *p,int forceBroadcastP)
int broadcast=overlay_address_is_broadcast(p->destination);
rhizome_saw_voice_traffic();
overlay_abbreviate_clear_most_recent_address();
if (broadcast) {

View File

@ -150,8 +150,10 @@ int rhizome_manifest_version_cache_lookup(rhizome_manifest *m)
long long dbVersion = -1;
if (sqlite_exec_int64(&dbVersion, "SELECT version FROM MANIFESTS WHERE id='%s';", id) == -1)
return WHY("Select failure");
if (dbVersion >= m->version)
return WHYF("We already have %s (%lld vs %lld)", id, dbVersion, m->version);
if (dbVersion >= m->version) {
if (0) WHYF("We already have %s (%lld vs %lld)", id, dbVersion, m->version);
return -1;
}
return 0;
/* Work out bin number in cache */