Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/tracing: Fix to make --logdir option work again

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>
Tested-by: Gabriele Monaco <gmonaco@redhat.com>
Link: https://lore.kernel.org/r/177071725191.2369897.14781037901532893911.stgit@mhiramat.tok.corp.google.com
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Masami Hiramatsu (Google) and committed by
Shuah Khan
e011853d 6de23f81

+12 -6
+12 -6
tools/testing/selftests/ftrace/ftracetest
··· 130 130 shift 1 131 131 ;; 132 132 --logdir|-l) 133 - LOG_DIR=$2 134 - LINK_PTR= 133 + USER_LOG_DIR=$2 135 134 shift 2 136 135 ;; 137 136 --rv) ··· 198 199 TOP_DIR=`absdir $0` 199 200 TEST_DIR=$TOP_DIR/test.d 200 201 TEST_CASES=`find_testcases $TEST_DIR` 202 + USER_LOG_DIR= 201 203 KEEP_LOG=0 202 204 KTAP=0 203 205 DEBUG=0 ··· 210 210 # Parse command-line options 211 211 parse_opts $* 212 212 213 + [ $DEBUG -ne 0 ] && set -x 214 + 215 + # TOP_DIR can be changed for rv. Setting log directory. 213 216 LOG_TOP_DIR=$TOP_DIR/logs 214 217 LOG_DATE=`date +%Y%m%d-%H%M%S` 215 - LOG_DIR=$LOG_TOP_DIR/$LOG_DATE/ 216 - LINK_PTR=$LOG_TOP_DIR/latest 217 - 218 - [ $DEBUG -ne 0 ] && set -x 218 + if [ -n "$USER_LOG_DIR" ]; then 219 + LOG_DIR=$USER_LOG_DIR 220 + LINK_PTR= 221 + else 222 + LOG_DIR=$LOG_TOP_DIR/$LOG_DATE/ 223 + LINK_PTR=$LOG_TOP_DIR/latest 224 + fi 219 225 220 226 if [ $RV_TEST -ne 0 ]; then 221 227 TRACING_DIR=$TRACING_DIR/rv