aboutsummaryrefslogtreecommitdiffstats
path: root/main/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/sched.c')
-rw-r--r--main/sched.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/main/sched.c b/main/sched.c
index 30b0af243..5fc0ef9ed 100644
--- a/main/sched.c
+++ b/main/sched.c
@@ -201,7 +201,8 @@ static int sched_settime(struct timeval *tv, int when)
*tv = now;
*tv = ast_tvadd(*tv, ast_samp2tv(when, 1000));
if (ast_tvcmp(*tv, now) < 0) {
- ast_log(LOG_DEBUG, "Request to schedule in the past?!?!\n");
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Request to schedule in the past?!?!\n");
*tv = now;
}
return 0;
@@ -296,26 +297,29 @@ void ast_sched_dump(const struct sched_context *con)
struct sched *q;
struct timeval tv = ast_tvnow();
#ifdef SCHED_MAX_CACHE
- ast_log(LOG_DEBUG, "Asterisk Schedule Dump (%d in Q, %d Total, %d Cache)\n", con->schedcnt, con->eventcnt - 1, con->schedccnt);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Asterisk Schedule Dump (%d in Q, %d Total, %d Cache)\n", con->schedcnt, con->eventcnt - 1, con->schedccnt);
#else
- ast_log(LOG_DEBUG, "Asterisk Schedule Dump (%d in Q, %d Total)\n", con->schedcnt, con->eventcnt - 1);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Asterisk Schedule Dump (%d in Q, %d Total)\n", con->schedcnt, con->eventcnt - 1);
#endif
+ if (option_debug) {
ast_log(LOG_DEBUG, "=============================================================\n");
ast_log(LOG_DEBUG, "|ID Callback Data Time (sec:ms) |\n");
ast_log(LOG_DEBUG, "+-----+-----------------+-----------------+-----------------+\n");
- AST_LIST_TRAVERSE(&con->schedq, q, list) {
- struct timeval delta = ast_tvsub(q->when, tv);
-
- ast_log(LOG_DEBUG, "|%.4d | %-15p | %-15p | %.6ld : %.6ld |\n",
- q->id,
- q->callback,
- q->data,
- delta.tv_sec,
- (long int)delta.tv_usec);
+ AST_LIST_TRAVERSE(&con->schedq, q, list) {
+ struct timeval delta = ast_tvsub(q->when, tv);
+
+ ast_log(LOG_DEBUG, "|%.4d | %-15p | %-15p | %.6ld : %.6ld |\n",
+ q->id,
+ q->callback,
+ q->data,
+ delta.tv_sec,
+ (long int)delta.tv_usec);
+ }
+ ast_log(LOG_DEBUG, "=============================================================\n");
}
- ast_log(LOG_DEBUG, "=============================================================\n");
-
}
/*! \brief