diff options
author | Vic Yang <victoryang@chromium.org> | 2014-05-19 15:03:27 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-21 20:32:17 +0000 |
commit | ffac23c0ea1bd4ff4568f5bd709a98f912b833a7 (patch) | |
tree | 362dd0ba205731aa07be97dd35b44b237799b23b /common/host_event_commands.c | |
parent | 478361de694b1fb45abf3c38dafbbf7fd1aa5f71 (diff) | |
download | chrome-ec-ffac23c0ea1bd4ff4568f5bd709a98f912b833a7.tar.gz |
Add cprints() and ccprints()
Our code base contains a lot of debug messages in this pattern:
CPRINTF("[%T xxx]\n") or ccprintf("[%T xxx]\n")
The strings are taking up spaces in the EC binaries, so let's refactor
this by adding cprints() and ccprints().
cprints() is just like cprintf(), except that it adds the brackets
and the timestamp. ccprints() is equivalent to cprints(CC_CONSOLE, ...)
This saves us hundreds of bytes in EC binaries.
BUG=chromium:374575
TEST=Build and check flash size
BRANCH=None
Change-Id: Ifafe8dc1b80e698b28ed42b70518c7917b49ee51
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/200490
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/host_event_commands.c')
-rw-r--r-- | common/host_event_commands.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c index 1d085b71cc..7d369b60db 100644 --- a/common/host_event_commands.c +++ b/common/host_event_commands.c @@ -14,7 +14,7 @@ /* Console output macros */ #define CPUTS(outstr) cputs(CC_EVENTS, outstr) -#define CPRINTF(format, args...) cprintf(CC_EVENTS, format, ## args) +#define CPRINTS(format, args...) cprints(CC_EVENTS, format, ## args) /* * Maintain two copies of the events that are set. @@ -41,7 +41,7 @@ void host_set_events(uint32_t mask) { /* Only print if something's about to change */ if ((events & mask) != mask || (events_copy_b & mask) != mask) - CPRINTF("[%T event set 0x%08x]\n", mask); + CPRINTS("event set 0x%08x", mask); atomic_or(&events, mask); atomic_or(&events_copy_b, mask); @@ -57,7 +57,7 @@ void host_clear_events(uint32_t mask) { /* Only print if something's about to change */ if (events & mask) - CPRINTF("[%T event clear 0x%08x]\n", mask); + CPRINTS("event clear 0x%08x", mask); atomic_clear(&events, mask); @@ -78,7 +78,7 @@ static void host_clear_events_b(uint32_t mask) { /* Only print if something's about to change */ if (events_copy_b & mask) - CPRINTF("[%T event clear B 0x%08x]\n", mask); + CPRINTS("event clear B 0x%08x", mask); atomic_clear(&events_copy_b, mask); } |