From e55bac2214f87ee59ef60960dee85fbebd13f6e9 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 20 Nov 2014 12:08:50 -0800 Subject: [PATCH] Improve EC console messages for lightbar stuff I need more information to find the source of some problems. This just adds a little more context to the lightbar console messages. BUG=chrome-os-partner:33401 BRANCH=ToT,samus TEST=make buildall -j Signed-off-by: Bill Richardson Change-Id: I97a210754833c9384eae517f9df2e97d3a9ea6b4 Reviewed-on: https://chromium-review.googlesource.com/231136 Reviewed-by: Randall Spangler --- common/lightbar.c | 26 ++++++++++++++------------ include/lightbar.h | 3 ++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/common/lightbar.c b/common/lightbar.c index 5ae8ca5167..0300be2911 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -657,15 +657,13 @@ static uint32_t sequence_STOP(void) do { msg = TASK_EVENT_CUSTOM(task_wait_event(-1)); - CPRINTS("LB_stop got pending_msg %d", pending_msg); + CPRINTS("LB %s() got pending_msg %d", __func__, pending_msg); } while (msg != PENDING_MSG || ( pending_msg != LIGHTBAR_RUN && pending_msg != LIGHTBAR_S0S3 && pending_msg != LIGHTBAR_S3 && pending_msg != LIGHTBAR_S3S5 && pending_msg != LIGHTBAR_S5)); - - CPRINTS("LB_stop->running"); return 0; } @@ -1392,19 +1390,23 @@ void lightbar_task(void) lightbar_restore_state(); while (1) { - CPRINTS("LB task %d = %s", - st.cur_seq, lightbar_cmds[st.cur_seq].string); + CPRINTS("LB running cur_seq %d %s. prev_seq %d %s", + st.cur_seq, lightbar_cmds[st.cur_seq].string, + st.prev_seq, lightbar_cmds[st.prev_seq].string); msg = lightbar_cmds[st.cur_seq].sequence(); if (TASK_EVENT_CUSTOM(msg) == PENDING_MSG) { - CPRINTS("LB msg %d = %s", pending_msg, - lightbar_cmds[pending_msg].string); + CPRINTS("LB cur_seq %d %s returned pending msg %d %s", + st.cur_seq, lightbar_cmds[st.cur_seq].string, + pending_msg, lightbar_cmds[pending_msg].string); if (st.cur_seq != pending_msg) { if (is_normal_sequence(st.cur_seq)) st.prev_seq = st.cur_seq; st.cur_seq = pending_msg; } } else { - CPRINTS("LB msg 0x%x", msg); + CPRINTS("LB cur_seq %d %s returned value %d", + st.cur_seq, lightbar_cmds[st.cur_seq].string, + msg); switch (st.cur_seq) { case LIGHTBAR_S5S3: st.cur_seq = LIGHTBAR_S3; @@ -1433,17 +1435,17 @@ void lightbar_task(void) } /* Function to request a preset sequence from the lightbar task. */ -void lightbar_sequence(enum lightbar_sequence num) +void lightbar_sequence_f(enum lightbar_sequence num, const char *f) { if (num > 0 && num < LIGHTBAR_NUM_SEQUENCES) { - CPRINTS("LB_seq %d = %s", num, + CPRINTS("LB %s() requests %d %s", f, num, lightbar_cmds[num].string); pending_msg = num; task_set_event(TASK_ID_LIGHTBAR, - TASK_EVENT_WAKE | TASK_EVENT_CUSTOM(PENDING_MSG), + TASK_EVENT_CUSTOM(PENDING_MSG), 0); } else - CPRINTS("LB_seq %d - ignored", num); + CPRINTS("LB %s() requests %d - ignored", f, num); } /****************************************************************************/ diff --git a/include/lightbar.h b/include/lightbar.h index e3792b41f0..293eeb2ab2 100644 --- a/include/lightbar.h +++ b/include/lightbar.h @@ -35,7 +35,8 @@ enum lb_control { }; /* Request a preset sequence from the lightbar task. */ -void lightbar_sequence(enum lightbar_sequence s); +void lightbar_sequence_f(enum lightbar_sequence num, const char *f); +#define lightbar_sequence(A) lightbar_sequence_f(A, __func__) /****************************************************************************/ /* External stuff */