-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: allow DEBUG in mutex.c to run without DEVELHELP #5270
Conversation
Could go into this release IMHO (since it is more a bug fix than a feature). |
Makes sense. |
Murdock is happy, but an ACK is missing. |
(two ACKs?) |
@@ -40,18 +40,18 @@ | |||
int _mutex_lock(mutex_t *mutex, int blocking) | |||
{ | |||
unsigned irqstate = irq_disable(); | |||
DEBUG("%s: Mutex in use.\n", sched_active_thread->name); | |||
DEBUG("PID[%u]: Mutex in use.\n", sched_active_thread->pid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PRIkernel_pid
?
Addressed comment and unified a few other things. |
ACK, please squash |
@authmillenon: please squash. @kaspar030, @OlegHahm: one of you up for a 2nd ack? |
@@ -107,7 +107,7 @@ void mutex_unlock(mutex_t *mutex) | |||
|
|||
void mutex_unlock_and_sleep(mutex_t *mutex) | |||
{ | |||
DEBUG("%s: unlocking mutex. queue.next: 0x%08x pid: %" PRIkernel_pid ", and taking a nap\n", sched_active_thread->name, (unsigned)mutex->queue.next, sched_active_pid); | |||
DEBUG("PID[%" PRIkernel_pid "]: unlocking mutex. queue.next: 0x%08x, and taking a nap\n", sched_active_pid, (unsigned)mutex->queue.next); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're at it, you could fix the length of this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
0f613d6
to
b762e27
Compare
Squashed and addressed comments. While I was at it, I piggy-backed some code-style fixes |
thread_t *me = (thread_t*) sched_active_thread; | ||
DEBUG("%s: Adding node to mutex queue: prio: %" PRIu32 "\n", me->name, (uint32_t)me->priority); | ||
thread_t *me = (thread_t *)sched_active_thread; | ||
DEBUG("PID[%" PRIkernel_pid "]: Adding node to mutex queue: prio: %" PRIu32 "\n", sched_active_pid, (uint32_t)me->priority); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you fix the line length with this PR, you might as well fix it for all DEBUG statements?!
re-ACK if the one comment is adderssed. @OlegHahm @kaspar030 ping |
b762e27
to
5e43d23
Compare
Addressed comment and squashed immediately. |
@@ -35,34 +35,38 @@ | |||
#define ENABLE_DEBUG (0) | |||
#include "debug.h" | |||
|
|||
#define MUTEX_LOCKED ((void*)-1) | |||
#define MUTEX_LOCKED ((void *)-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated (and unnecessary)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, but don't agree... Pointers should be spaced according to the CC, so why not their casts?
Apart from the - IMO superfluous - white spaces: ACK |
As they are debatable, please remove those. |
@kaspar030 where is the debate? I just see encouragements to shorten the lines.... |
5e43d23
to
13cd18d
Compare
Uglified casts ;-), squashed immediately. |
13cd18d
to
1750e1b
Compare
re-ACK |
CI is green -> go |
backport needed |
Murdock builds it again (I think). So I remove the label. |
Tried to debug something without DEVELHELP and found that
mutex.c
isn't able to run without it. So I replaced thread names with PIDs.