aboutsummaryrefslogtreecommitdiff
path: root/core/console-log.c
diff options
context:
space:
mode:
authorBalbir Singh <bsingharora@gmail.com>2016-05-05 17:10:19 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-08-24 17:02:03 +1000
commita0a22b9883741b53c85fcea08a94bbdac892a9a3 (patch)
tree7a3141fc37fbb0b5f20555ca76bd0426613602c8 /core/console-log.c
parente36f4f219b642c6c5032208fca7191fbd75fe1a3 (diff)
downloadskiboot-a0a22b9883741b53c85fcea08a94bbdac892a9a3.zip
skiboot-a0a22b9883741b53c85fcea08a94bbdac892a9a3.tar.gz
skiboot-a0a22b9883741b53c85fcea08a94bbdac892a9a3.tar.bz2
Make console-log time more readable: seconds rather than timebase
I've tried to align it with what the kernel prints today The existing logs show: [20287269125,5] PSI[0x000]: Found PSI bridge [working=1, active=0] [890425679,5] BT: Interface initialized, IO 0x00e4 [1249199642,4] SLW: HB-provided idle states property found [1249344409,5] NVRAM: Size is 576 KB [1484422964,3] NVRAM: Layout appears sane The mftb() output is not very meaningful, the changed output shows: [ 38.315784591,5] CENTAUR: FSI host: 0x0 cMFSI0 port 2 [ 38.315922971,5] PSI[0x000]: Found PSI bridge [working=1, active=0] [ 1.448765255,5] BT: Interface initialized, IO 0x00e4 [ 2.398136129,5] NVRAM: Size is 576 KB [ 3.145017865,3] NVRAM: Layout appears sane For the output sample, I've taken bits where one can see the time move back w.r.t. previous log, but that was always the case. I don't think that is worth fixing here Adds an additional divide and modulo for every log printed. I've also fixed the test cases that run as a part of make check Signed-off-by: Balbir Singh <bsingharora@gmail.com> [stewart@linux.vnet.ibm.com: fix up tb in console tests] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/console-log.c')
-rw-r--r--core/console-log.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/console-log.c b/core/console-log.c
index 3b9475e..c70229f 100644
--- a/core/console-log.c
+++ b/core/console-log.c
@@ -32,6 +32,7 @@ static int vprlog(int log_level, const char *fmt, va_list ap)
int count;
char buffer[320];
bool flush_to_drivers = true;
+ unsigned long tb = mftb();
/* It's safe to return 0 when we "did" something here
* as only printf cares about how much we wrote, and
@@ -43,8 +44,8 @@ static int vprlog(int log_level, const char *fmt, va_list ap)
if (log_level > (debug_descriptor.console_log_levels >> 4))
return 0;
- count = snprintf(buffer, sizeof(buffer), "[%lu,%d] ",
- mftb(), log_level);
+ count = snprintf(buffer, sizeof(buffer), "[%5lu.%06lu,%d] ",
+ tb_to_secs(tb), tb_remaining_nsecs(tb), log_level);
count+= vsnprintf(buffer+count, sizeof(buffer)-count, fmt, ap);
if (log_level > (debug_descriptor.console_log_levels & 0x0f))