diff options
| author | Arkaitz Jimenez <arkaitzj@gmail.com> | 2012-06-04 01:53:24 +0100 |
|---|---|---|
| committer | Arkaitz Jimenez <arkaitzj@gmail.com> | 2012-06-04 01:53:24 +0100 |
| commit | dad300758486b59ac1356d55dbc2accd8e8d9720 (patch) | |
| tree | d58c8671852afaa4bd69f32af2cad7c985cff842 /src/rt/rust_sched_loop.cpp | |
| parent | 0ecf20c99a43d0d258b08ebbd62526b69f013794 (diff) | |
| download | rust-dad300758486b59ac1356d55dbc2accd8e8d9720.tar.gz rust-dad300758486b59ac1356d55dbc2accd8e8d9720.zip | |
Moved log method into logger class better than scheduler fixes #2495
Diffstat (limited to 'src/rt/rust_sched_loop.cpp')
| -rw-r--r-- | src/rt/rust_sched_loop.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/rt/rust_sched_loop.cpp b/src/rt/rust_sched_loop.cpp index 83540cdf6b1..e6297ec475c 100644 --- a/src/rt/rust_sched_loop.cpp +++ b/src/rt/rust_sched_loop.cpp @@ -49,26 +49,10 @@ rust_sched_loop::activate(rust_task *task) { DLOG(this, task, "task has returned"); } -// FIXME #2495: This logging code doesn't belong in the scheduler -void -rust_sched_loop::log(rust_task* task, uint32_t level, char const *fmt, ...) { - char buf[BUF_BYTES]; - va_list args; - va_start(args, fmt); - int formattedbytes = vsnprintf(buf, sizeof(buf), fmt, args); - if( formattedbytes and (unsigned)formattedbytes > BUF_BYTES ){ - const char truncatedstr[] = "[...]"; - memcpy( &buf[BUF_BYTES-sizeof(truncatedstr)], - truncatedstr, - sizeof(truncatedstr)); - } - _log.trace_ln(task, level, buf); - va_end(args); -} void rust_sched_loop::fail() { - log(NULL, log_err, "domain %s @0x%" PRIxPTR " root task failed", + _log.log(NULL, log_err, "domain %s @0x%" PRIxPTR " root task failed", name, this); kernel->fail(); } @@ -168,18 +152,18 @@ rust_sched_loop::log_state() { if (log_rt_task < log_debug) return; if (!running_tasks.is_empty()) { - log(NULL, log_debug, "running tasks:"); + _log.log(NULL, log_debug, "running tasks:"); for (size_t i = 0; i < running_tasks.length(); i++) { - log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR, + _log.log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR, running_tasks[i]->name, running_tasks[i]); } } if (!blocked_tasks.is_empty()) { - log(NULL, log_debug, "blocked tasks:"); + _log.log(NULL, log_debug, "blocked tasks:"); for (size_t i = 0; i < blocked_tasks.length(); i++) { - log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR + _log.log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR ", blocked on: 0x%" PRIxPTR " '%s'", blocked_tasks[i]->name, blocked_tasks[i], blocked_tasks[i]->get_cond(), |
