public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Mark Brown <broonie@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Shuah Khan <shuah@kernel.org>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Aishwarya TCV <aishwarya.tcv@arm.com>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 1/2] tracing/selftests: Support log output when generating KTAP output
Date: Sun, 7 Apr 2024 02:03:52 +0500	[thread overview]
Message-ID: <0beb942b-e16b-4006-ab24-bb11eeb8ee3e@collabora.com> (raw)
In-Reply-To: <20240325-kselftest-ftrace-ktap-verbose-v1-1-3785199809da@kernel.org>

On 3/25/24 9:15 PM, Mark Brown wrote:
> When -v is specified ftracetest will dump logs of test execution to the
> console which if -K is also specified for KTAP output will result in
> output that is not properly KTAP formatted. All that's required for KTAP
> formatting is that anything we log have a '#' at the start of the line so
> we can improve things by washing the output through a simple read loop.
> This will help automated parsers when verbose mode is enabled.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

> ---
>  tools/testing/selftests/ftrace/ftracetest | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
> index 25d4e0fca385..cce72f8b03dc 100755
> --- a/tools/testing/selftests/ftrace/ftracetest
> +++ b/tools/testing/selftests/ftrace/ftracetest
> @@ -255,7 +255,13 @@ prlog() { # messages
>    [ "$LOG_FILE" ] && printf "$*$newline" | strip_esc >> $LOG_FILE
>  }
>  catlog() { #file
> -  cat $1
> +  if [ "${KTAP}" = "1" ]; then
> +    cat $1 | while read line ; do
> +      echo "# $line"
> +    done
> +  else
> +    cat $1
> +  fi
>    [ "$LOG_FILE" ] && cat $1 | strip_esc >> $LOG_FILE
>  }
>  prlog "=== Ftrace unit tests ==="
> 

-- 
BR,
Muhammad Usama Anjum

  reply	other threads:[~2024-04-06 21:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 16:15 [PATCH 0/2] tracing/selftests: Verbosity improvements to KTAP output Mark Brown
2024-03-25 16:15 ` [PATCH 1/2] tracing/selftests: Support log output when generating " Mark Brown
2024-04-06 21:03   ` Muhammad Usama Anjum [this message]
2024-03-25 16:15 ` [PATCH 2/2] tracing/selftests: Default to verbose mode when running in kselftest Mark Brown
2024-04-06 21:05   ` Muhammad Usama Anjum
2024-03-26 16:08 ` [PATCH 0/2] tracing/selftests: Verbosity improvements to KTAP output Steven Rostedt
2024-03-26 19:11   ` Shuah Khan
2024-04-04 16:32     ` Shuah Khan
2024-04-06 12:36       ` Masami Hiramatsu

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=0beb942b-e16b-4006-ab24-bb11eeb8ee3e@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=aishwarya.tcv@arm.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=shuah@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