warn about blocking at log level 3

This commit is contained in:
Alexandre Ratchov 2016-01-29 12:12:03 +01:00
parent fcbcfd089a
commit 96e51185e0
1 changed files with 4 additions and 2 deletions

View File

@ -353,7 +353,8 @@ dev_sio_run(void *arg)
n = sio_read(d->sio.hdl, data, d->sio.todo);
d->sio.todo -= n;
#ifdef DEBUG
if (n == 0 && data == base && !sio_eof(d->sio.hdl)) {
if (log_level >= 3 &&
n == 0 && data == base && !sio_eof(d->sio.hdl)) {
dev_log(d);
log_puts(": read blocked at cycle start\n");
}
@ -436,7 +437,8 @@ dev_sio_run(void *arg)
n = sio_write(d->sio.hdl, data, d->sio.todo);
d->sio.todo -= n;
#ifdef DEBUG
if (n == 0 && data == base && !sio_eof(d->sio.hdl)) {
if (log_level >= 3 &&
n == 0 && data == base && !sio_eof(d->sio.hdl)) {
dev_log(d);
log_puts(": write blocked at cycle start\n");
}