From 2efbab2aaf98d8f8f0df504efd4fdd0fac77d354 Mon Sep 17 00:00:00 2001 From: Andrea Shepard Date: Tue, 29 Oct 2013 02:13:53 -0700 Subject: Provide generic mechanism for scheduler to query writeable cells on a channel --- src/or/scheduler.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/or/scheduler.c') diff --git a/src/or/scheduler.c b/src/or/scheduler.c index e2dcdb5d32..7023eaae0a 100644 --- a/src/or/scheduler.c +++ b/src/or/scheduler.c @@ -324,6 +324,7 @@ void scheduler_run(void) { smartlist_t *tmp = NULL; + int n_cells; log_debug(LD_SCHED, "We have a chance to run the scheduler"); @@ -337,9 +338,18 @@ scheduler_run(void) channels_pending = smartlist_new(); SMARTLIST_FOREACH_BEGIN(tmp, channel_t *, chan) { - log_debug(LD_SCHED, - "Scheduler saw pending channel " U64_FORMAT " at %p", - U64_PRINTF_ARG(chan->global_identifier), chan); + n_cells = channel_num_cells_writeable(chan); + if (n_cells > 0) { + log_debug(LD_SCHED, + "Scheduler saw pending channel " U64_FORMAT " at %p with " + "%d cells writeable", + U64_PRINTF_ARG(chan->global_identifier), chan, n_cells); + } else { + log_info(LD_SCHED, + "Scheduler saw pending channel " U64_FORMAT " at %p with " + "no cells writeable", + U64_PRINTF_ARG(chan->global_identifier), chan); + } } SMARTLIST_FOREACH_END(chan); smartlist_free(tmp); -- cgit v1.2.3-54-g00ecf