From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-renesas-soc@vger.kernel.org
Cc: Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: [VSP-Tests PATCH 3/3] scripts/logger: Use new monotonic-ts tool
Date: Wed, 16 Sep 2020 15:43:02 +0100 [thread overview]
Message-ID: <20200916144302.1483470-4-kieran.bingham@ideasonboard.com> (raw)
In-Reply-To: <20200916144302.1483470-1-kieran.bingham@ideasonboard.com>
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>
---
scripts/logger.sh | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/scripts/logger.sh b/scripts/logger.sh
index 97e1f582da2b..452ebc8c82ba 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
--
2.25.1
next prev parent reply other threads:[~2020-09-16 20:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 14:42 [VSP-Tests PATCH 0/3] Run as user, and python3 support Kieran Bingham
2020-09-16 14:43 ` [VSP-Tests PATCH 1/3] gen-lut: Update for python3 Kieran Bingham
2020-09-17 1:00 ` Laurent Pinchart
2020-09-16 14:43 ` [VSP-Tests PATCH 2/3] src: monotonic-ts: Monotonic timestamp logging Kieran Bingham
2020-09-17 1:17 ` Laurent Pinchart
2020-09-17 8:01 ` Kieran Bingham
2020-09-16 14:43 ` Kieran Bingham [this message]
2020-09-17 1:17 ` [VSP-Tests PATCH 3/3] scripts/logger: Use new monotonic-ts tool Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200916144302.1483470-4-kieran.bingham@ideasonboard.com \
--to=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).