From 62f0b16f639a9ecb116a79819655bdf44e269443 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 16 May 2016 21:55:52 +0300 Subject: Initial commit Signed-off-by: Laurent Pinchart --- scripts/logger.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/logger.sh (limited to 'scripts/logger.sh') diff --git a/scripts/logger.sh b/scripts/logger.sh new file mode 100755 index 0000000..8123f0c --- /dev/null +++ b/scripts/logger.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +now() { + awk '/^now/ {time=$3; printf("[%u.%06u]", time / 1000000000, (time % 1000000000) / 1000) ; exit}' /proc/timer_list +} + +label=${1:+ [$1]} + +while read line ; do + echo "$(now)$label $line" +done -- cgit v1.2.3