Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Shuah Khan <shuah@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	 linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,
	 linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 1/2] selftests/tracing: Fix to make --logdir option work again
Date: Wed, 11 Feb 2026 09:16:48 +0100	[thread overview]
Message-ID: <ada4f1dc5ca34d8adf3d68396080e6d2e5e834eb.camel@redhat.com> (raw)
In-Reply-To: <177071725191.2369897.14781037901532893911.stgit@mhiramat.tok.corp.google.com>

On Tue, 2026-02-10 at 18:54 +0900, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Since commit a0aa283c53a7 ("selftest/ftrace: Generalise ftracetest to
> use with RV") moved the default LOG_DIR setting after --logdir option
> parser, it overwrites the user given LOG_DIR.
> This fixes it to check the --logdir option parameter when setting new
> default LOG_DIR with a new TOP_DIR.
> 
> Fixes: a0aa283c53a7 ("selftest/ftrace: Generalise ftracetest to use with RV")
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> ---

Thanks for catching this! I should have tested all the options..
The fix works fine on my side.

Tested-by: Gabriele Monaco <gmonaco@redhat.com>

>  tools/testing/selftests/ftrace/ftracetest |   18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/testing/selftests/ftrace/ftracetest
> b/tools/testing/selftests/ftrace/ftracetest
> index 3230bd54dba8..0a56bf209f6c 100755
> --- a/tools/testing/selftests/ftrace/ftracetest
> +++ b/tools/testing/selftests/ftrace/ftracetest
> @@ -130,8 +130,7 @@ parse_opts() { # opts
>        shift 1
>      ;;
>      --logdir|-l)
> -      LOG_DIR=$2
> -      LINK_PTR=
> +      USER_LOG_DIR=$2
>        shift 2
>      ;;
>      --rv)
> @@ -199,6 +198,7 @@ fi
>  TOP_DIR=`absdir $0`
>  TEST_DIR=$TOP_DIR/test.d
>  TEST_CASES=`find_testcases $TEST_DIR`
> +USER_LOG_DIR=
>  KEEP_LOG=0
>  KTAP=0
>  DEBUG=0
> @@ -210,12 +210,18 @@ RV_TEST=0
>  # Parse command-line options
>  parse_opts $*
>  
> +[ $DEBUG -ne 0 ] && set -x
> +
> +# TOP_DIR can be changed for rv. Setting log directory.
>  LOG_TOP_DIR=$TOP_DIR/logs
>  LOG_DATE=`date +%Y%m%d-%H%M%S`
> -LOG_DIR=$LOG_TOP_DIR/$LOG_DATE/
> -LINK_PTR=$LOG_TOP_DIR/latest
> -
> -[ $DEBUG -ne 0 ] && set -x
> +if [ -n "$USER_LOG_DIR" ]; then
> +  LOG_DIR=$USER_LOG_DIR
> +  LINK_PTR=
> +else
> +  LOG_DIR=$LOG_TOP_DIR/$LOG_DATE/
> +  LINK_PTR=$LOG_TOP_DIR/latest
> +fi
>  
>  if [ $RV_TEST -ne 0 ]; then
>  	TRACING_DIR=$TRACING_DIR/rv


  parent reply	other threads:[~2026-02-11  8:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10  9:54 [PATCH 1/2] selftests/tracing: Fix to make --logdir option work again Masami Hiramatsu (Google)
2026-02-10  9:54 ` [PATCH 2/2] selftests/tracing: Fix to check awk supports non POSIX strtonum() Masami Hiramatsu (Google)
2026-02-11  8:16 ` Gabriele Monaco [this message]
2026-03-04  2:04 ` [PATCH 1/2] selftests/tracing: Fix to make --logdir option work again Masami Hiramatsu
2026-03-31 19:07   ` Shuah Khan

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=ada4f1dc5ca34d8adf3d68396080e6d2e5e834eb.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --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