diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-04-03 11:29:41 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-04-03 11:35:47 -0700 |
commit | 95462ad4fed6839f0b672d4fdef08d09265e3585 (patch) | |
tree | e2d44d80fbda4731018ff25b3c3b24712ad7c348 /common/uart_buffering.c | |
parent | ed33516e2e7414abf84b62d4426e4b4c61ff7892 (diff) | |
download | chrome-ec-95462ad4fed6839f0b672d4fdef08d09265e3585.tar.gz |
Add %T format code to print current timestamp.
Signed-off-by: Randall Spangler <rspangler@chromium.org>
BUG=chrome-os-partner:8724
TEST=if timestamps show up in the debug output, it works
Change-Id: I5264a3a40a07a824cc15b39a7bd81f2db02a3c13
Diffstat (limited to 'common/uart_buffering.c')
-rw-r--r-- | common/uart_buffering.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/uart_buffering.c b/common/uart_buffering.c index 5f6580d73c..6393ff47be 100644 --- a/common/uart_buffering.c +++ b/common/uart_buffering.c @@ -9,6 +9,7 @@ #include "console.h" #include "task.h" +#include "timer.h" #include "uart.h" #include "util.h" @@ -458,7 +459,11 @@ int uart_printf(const char *format, ...) /* TODO: (crosbug.com/p/7490) handle "%l" prefix for * uint64_t */ - v = va_arg(args, uint32_t); + /* Special-case: %T = current time */ + if (c == 'T') + v = get_time().le.lo; + else + v = va_arg(args, uint32_t); switch (c) { case 'd': @@ -468,6 +473,7 @@ int uart_printf(const char *format, ...) } break; case 'u': + case 'T': break; case 'x': case 'p': |