summaryrefslogtreecommitdiff
path: root/scripts/logger.sh
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-09-17 15:04:50 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-02-28 13:12:38 +0200
commit2e98a1bf774bc8516aa8027411a2fd511e52561c (patch)
treee70dfce016ea6231c46efdf4ffcf56507303d313 /scripts/logger.sh
parent56d5364fced642aa203bd74b9d92798985d3ca5c (diff)
scripts/logger: Use new monotonic-ts tool
Utilise the new monotonic timestamping tool to remove the manual parsing of timestamps via /proc/timer_list which can only be read by root. This also simplifies the processing required and contains all timestamping actions within a single process space. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'scripts/logger.sh')
-rwxr-xr-xscripts/logger.sh20
1 files changed, 4 insertions, 16 deletions
diff --git a/scripts/logger.sh b/scripts/logger.sh
index 97e1f58..75426a5 100755
--- a/scripts/logger.sh
+++ b/scripts/logger.sh
@@ -2,23 +2,11 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2016 Renesas Electronics Corporation
-now() {
- awk '/^now/ {time=$3; printf("[%u.%06u]", time / 1000000000, (time % 1000000000) / 1000) ; exit}' /proc/timer_list
-}
-
label=${1:+ [$1]}
TRACE_MARKER=/sys/kernel/debug/tracing/trace_marker
-if [ -e $TRACE_MARKER ]; then
- extra_log_files=$TRACE_MARKER
+if [ -e $TRACE_MARKER ] && [ "$(id -u)" = 0 ]; then
+ ./monotonic-ts "$label" | tee -a $TRACE_MARKER
+else
+ ./monotonic-ts "$label"
fi
-
-while read line ; do
- newline="$(now)$label $line"
-
- echo "$newline"
-
- for f in $extra_log_files; do
- echo "$newline" >> $f;
- done;
-done